Vimba X and Vimba offer numerous possibilities to cross-compile source code from a PC to an ARM board. The following documents describe a tried and tested easy solution.
Vimba X on Ubuntu 20.04 Crashes in VmbStartup()
I am developing a C++ application that uses the Vimba X API to connect to a set of Alvium G5 cameras over a GigE link. This application functions properly in Windows. However, on Linux, Ubuntu 20.04 with GCC 13.1, I observe unexpected behavior during Vimba X’s initialization. I require this linux setup to eventually port to NVIDIA’s Jetson Orin Arm64 running Ubuntu 20.04 with GC 13.1.
When my program calls Vimba’s startup function, I receive the seg fault shown below. My code looks like this:
using namespace VmbCPP;
VmbCPP::VmbSystem& sys = VmbSystem::GetInstance(); // Get a reference to the VimbaSystem singleton
VmbVersionInfo_t versionInfo;
sys.QueryVersion( versionInfo );
fmt::print( "Vmb Version Major: {} Minor: {} Patch: {}\n\n",
versionInfo.major, versionInfo.minor, versionInfo.patch ); //prints 1.0.2
fmt::print("Calling startup...\n" );
VmbErrorType err = sys.Startup(); // Initialize the Vmb API //CRASHES HERE!
fmt::print("RETURNED from calling startup()\n"); //Never reach this line of code
The callstack / backtrace from gdb debug mode shows the crash occurring inside of VmbC.so.
Thread 1 "example_NetMsgT" received signal SIGSEGV, Segmentation fault.
0x000055555567f657 in std::unique_ptr<std::filesystem::__cxx11::path::_List::_Impl, std::filesystem::__cxx11::path::_List::_Impl_deleter>::~unique_ptr (this=0x20, __in_chrg=<optimized out>) at /usr/include/c++/13/bits/unique_ptr.h:403
403 if (__ptr != nullptr)
(gdb) bt
#0 0x000055555567f657 in std::unique_ptr<std::filesystem::__cxx11::path::_List::_Impl, std::filesystem::__cxx11::path::_List::_Impl_deleter>::~unique_ptr (this=0x20, __in_chrg=<optimized out>) at /usr/include/c++/13/bits/unique_ptr.h:403
#1 0x000055555567f298 in std::filesystem::__cxx11::path::_List::~_List (this=0x20, __in_chrg=<optimized out>) at /usr/include/c++/13/bits/fs_path.h:689
#2 0x000055555567f2bc in std::filesystem::__cxx11::path::~path (this=0x0, __in_chrg=<optimized out>) at /usr/include/c++/13/bits/fs_path.h:355
#3 0x00007ffff5fc0034 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#4 0x00007ffff5fb0820 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#5 0x00007ffff5fb1154 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#6 0x00007ffff5f54816 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#7 0x00007ffff5f55bef in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#8 0x00007ffff5f5926c in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#9 0x00007ffff5f59d4c in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#10 0x00007ffff5f0ff19 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#11 0x00007ffff5f1071b in VmbStartup () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#12 0x00007ffff6cb7780 in VmbCPP::VmbSystem::Startup(char const*) () from /repos/VimbaX_2023-1/api/lib/libVmbCPP.so
#13 0x00005555555e9b1b in Aftr::GLView_example_NetMsgTCP::onKeyDown(SDL_KeyboardEvent const&) ()
#14 0x000055555567cb2f in Aftr::GLView::handleEvent (this=0x555555fa2cc0, sdlEvent=...) at /repos/aburn/engine/src/aftr/GLView.cpp:416
#15 0x000055555567eacc in Aftr::GLView::startWorldSimulationLoop (this=0x555555fa2cc0) at /repos/aburn/engine/src/aftr/GLView.cpp:943#16 0x00005555555fb5c9 in main ()
(gdb)
The Vimba examples from the SDK compile, link, and run without a problem on the same Ubuntu 20.04 install. This leads me to believe that one of the other libraries my application links to may conflict or perhaps cause some ODR violation as a result of transitive dependencies? I require Boost-1.8x and am using OpenGL and other cross platform libraries… The LDD tree output of my exe looks like:
I am using GCC 13.1 as my C++ compiler.
usr@ubu:/repos/aburn/usr/hub/example_NetMsgTCP/bg$ lddtree example_NetMsgTCP
example_NetMsgTCP => ./example_NetMsgTCP (interpreter => /lib64/ld-linux-x86-64.so.2)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0
libSDL2_image-2.0.so.0 => /usr/local/lib/libSDL2_image-2.0.so.0
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
libGLEW.so.2.1 => /lib/x86_64-linux-gnu/libGLEW.so.2.1
libassimp.so.5 => /usr/local/lib/libassimp.so.5
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1
libVmbCPP.so => /repos/VimbaX_2023-1/api/lib/libVmbCPP.so
libVmbC.so => /repos/VimbaX_2023-1/api/lib/libVmbC.so
libGenApi_GNU8_4_0_v3_2_AVT.so => not found
libGCBase_GNU8_4_0_v3_2_AVT.so => not found
libSDL2-2.0.so.0 => /usr/local/lib/libSDL2-2.0.so.0
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
usr@ubu:/repos/aburn/usr/hub/example_NetMsgTCP/bg$
Repeating the same information above, but in a flat list, the lddtree -l lists all linked libraries included here:
usr@ubu:/repos/aburn/usr/hub/example_NetMsgTCP/bg$ lddtree -l ./example_NetMsgTCP
./example_NetMsgTCP
/lib64/ld-linux-x86-64.so.2
/lib/x86_64-linux-gnu/libGL.so.1
/lib/x86_64-linux-gnu/libGLdispatch.so.0
/lib/x86_64-linux-gnu/libGLX.so.0
/lib/x86_64-linux-gnu/libX11.so.6
/lib/x86_64-linux-gnu/libxcb.so.1
/lib/x86_64-linux-gnu/libXau.so.6
/lib/x86_64-linux-gnu/libXdmcp.so.6
/lib/x86_64-linux-gnu/libbsd.so.0
/usr/local/lib/libSDL2_image-2.0.so.0
/lib/x86_64-linux-gnu/libdl.so.2
/lib/x86_64-linux-gnu/libGLEW.so.2.1
/usr/local/lib/libassimp.so.5
/lib/x86_64-linux-gnu/libz.so.1
/repos/VimbaX_2023-1/api/lib/libVmbCPP.so
/repos/VimbaX_2023-1/api/lib/libVmbC.so
libGenApi_GNU8_4_0_v3_2_AVT.so
libGCBase_GNU8_4_0_v3_2_AVT.so
/usr/local/lib/libSDL2-2.0.so.0
/lib/x86_64-linux-gnu/libpthread.so.0
/lib/x86_64-linux-gnu/libstdc++.so.6
/lib/x86_64-linux-gnu/libm.so.6
/lib/x86_64-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libc.so.6
Any help would be greatly appreciated.
Thanks,
It seems VmbC has a problem with certain boost versions. Not sure what’s the latest one supported officially, I thought ist was 1.7. If Boost-1.8x is linked statically I’d suggest to link it dynamically if applicable.
Norman,
Thank you for the reply. I have switched my build process to dynamically link my test executable to boost 1.83. To verify, the lddtree -l
command now shows /usr/local/lib/libboost_thread.so.1.83.0
as a dynamically linked library.
usr@ubu:/repos/aburn/usr/modules/NewModule/bg$ lddtree -l ./NewModule
./NewModule
/lib64/ld-linux-x86-64.so.2
/lib/x86_64-linux-gnu/libGL.so.1
/lib/x86_64-linux-gnu/libGLdispatch.so.0
/lib/x86_64-linux-gnu/libGLX.so.0
/lib/x86_64-linux-gnu/libX11.so.6
/lib/x86_64-linux-gnu/libxcb.so.1
/lib/x86_64-linux-gnu/libXau.so.6
/lib/x86_64-linux-gnu/libXdmcp.so.6
/lib/x86_64-linux-gnu/libbsd.so.0
/usr/local/lib/libSDL2_image-2.0.so.0
/lib/x86_64-linux-gnu/libdl.so.2
/lib/x86_64-linux-gnu/libGLEW.so.2.1
/usr/local/lib/libassimp.so.5
/lib/x86_64-linux-gnu/libz.so.1
/repos/VimbaX_2023-1/api/lib/libVmbCPP.so
/repos/VimbaX_2023-1/api/lib/libVmbC.so
libGenApi_GNU8_4_0_v3_2_AVT.so
libGCBase_GNU8_4_0_v3_2_AVT.so
/usr/local/lib/libSDL2-2.0.so.0
/usr/local/lib/libboost_thread.so.1.83.0
/lib/x86_64-linux-gnu/libpthread.so.0
/lib/x86_64-linux-gnu/libstdc++.so.6
/lib/x86_64-linux-gnu/libm.so.6
/lib/x86_64-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libc.so.6
However, when I run the executable, I see this callstack:
usr@ubu:/repos/aburn/usr/modules/NewModule/bg$ gdb ./NewModule
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./NewModule...
sta(gdb) start
Temporary breakpoint 1 at 0x9715b: file /repos/aburn/usr/modules/NewModule/src/main.cpp, line 88.
Starting program: /repos/aburn/usr/modules/NewModule/bg/NewModule
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
test
Created the singleton...
Calling startup...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff611c134 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
(gdb) bt
#0 0x00007ffff611c134 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#1 0x00007ffff610d7f0 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#2 0x00007ffff610e154 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#3 0x00007ffff60b1816 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#4 0x00007ffff60b2bef in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#5 0x00007ffff60b626c in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#6 0x00007ffff60b6d4c in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#7 0x00007ffff606cf19 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#8 0x00007ffff606d71b in VmbStartup () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#9 0x00007ffff6e9697d in VmbCPP::VmbSystem::Startup(char const*) () from /repos/VimbaX_2023-1/api/lib/libVmbCPP.so
#10 0x00007ffff6e969e1 in VmbCPP::VmbSystem::Startup() () from /repos/VimbaX_2023-1/api/lib/libVmbCPP.so
#11 0x00005555555eb465 in Singleton::get () at /repos/aburn/usr/modules/NewModule/src/main.cpp:24
#12 0x00005555555eb340 in __static_initialization_and_destruction_0 () at /repos/aburn/usr/modules/NewModule/src/main.cpp:49
#13 0x00005555555eb357 in _GLOBAL__sub_I__Z3foov () at /repos/aburn/usr/modules/NewModule/src/main.cpp:102
#14 0x0000555555d785fd in __libc_csu_init ()
#15 0x00007ffff649a010 in __libc_start_main (main=0x5555555eb15b <main(int, char**)>, argc=1, argv=0x7fffffffe0b8, init=0x555555d785b0 <__libc_csu_init>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe0a8) at ../csu/libc-start.c:264
#16 0x00005555555e3fbe in _start ()
(gdb) q
It appears Vimba uses a Singleton to initialize itself. From the usage, the Singleton may be implemented as a Meyers Singleton. Could some type of static initialization problem be occurring?
For fun, I created my own Meyer’s Singleton and called Vimba Startup() as soon as possible. Below is the source code I am using as a test:
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include "GLViewNewModule.h" //GLView subclass instantiated to drive this simulation
#include <fmt/core.h>
#include <fmt/os.h>
#include <VmbCPP/VmbCPP.h>
class Singleton
{
public:
static VmbCPP::VmbSystem &get()
{
static Singleton s;
fmt::print("Calling startup...\n");
//VmbErrorType err = s.sys.Startup("/repos/VimbaX_2023-1/cti/VimbaGigETL.cti"); // Initialize the Vmb API
VmbErrorType err = s.sys.Startup(); // Initialize the Vmb API
VmbVersionInfo_t versionInfo;
s.sys.QueryVersion(versionInfo);
fmt::print("Vmb Version Major: {} Minor: {} Patch: {}\n\n",
versionInfo.major, versionInfo.minor, versionInfo.patch);
return s.sys;
}
Singleton(Singleton const &) = delete;
Singleton &operator=(Singleton const &) = delete;
private:
Singleton() : sys(VmbCPP::VmbSystem::GetInstance())
{
std::cout << "test\n";
fmt::print("Created the singleton...\n");
}
~Singleton() {}
VmbCPP::VmbSystem &sys;
};
static auto &s = Singleton::get();
// VmbCPP::VmbSystem* Singleton::ptr = &(VmbCPP::VmbSystem::GetInstance());
void foo()
{
using namespace VmbCPP;
// VmbCPP::VmbSystem& sys = VmbSystem::GetInstance(); // Get a reference to the VimbaSystem singleton
VmbVersionInfo_t versionInfo;
s.QueryVersion(versionInfo);
fmt::print("Vmb Version Major: {} Minor: {} Patch: {}\n\n",
versionInfo.major, versionInfo.minor, versionInfo.patch);
fmt::print("Calling shutdown...\n");
s.Shutdown();
fmt::print("done calling shutdown...\n");
fmt::print("Calling startup...\n");
VmbErrorType err = s.Startup("/repos/VimbaX_2023-1/cti/VimbaGigETL.cti"); // Initialize the Vmb API
fmt::print("RETURNED from calling startup()\n");
if (VmbErrorSuccess == err)
{
fmt::print("Startup successful\n\n");
}
else if (VmbErrorAlready == err)
{
fmt::print("Already init...\n");
}
}
/**
This creates a GLView subclass instance and begins the GLView's main loop.
Each iteration of this loop occurs when a reset request is received. A reset
request causes the entire GLView to be destroyed (since its exits scope) and
begin again (simStatus == -1). This loop exits when a request to exit the
application is received (simStatus == 0 ).
*/
int main(int argc, char *argv[])
{
///The Singleton class above invokes Vimba Startup() *before* main() begins. I've tried both ways (before main() and during main() via foo()) -- In both cases, Vimba crashes in the same way.
fmt::print("Addr of Vmb is {}...\n", fmt::ptr(&s));
foo();
std::vector<std::string> args{argv, argv + argc}; ///< Command line arguments passed via argc and argv, reserved to size of argc
int simStatus = 0;
do
{
std::unique_ptr<Aftr::GLViewNewModule> glView(Aftr::GLViewNewModule::New(args));
simStatus = glView->startWorldSimulationLoop(); // Runs until simulation exits or requests a restart (values 0 or -1, respectively)
} while (simStatus != 0);
std::cout << "Exited AftrBurner Engine Normally..." << std::endl;
return 0;
}
The Singleton class above invokes Vimba Startup() before main() begins – still crashes and this is the first thing to be done as far as I can tell. Of course, I’ve tried calling StartUp() as a normal function call in main as well. In both cases, Vimba crashes in the same way.
Do you have any other ideas or things to try? We’ve spent about 17 hours debugging this issue – all works perfectly on Windows. On Linux, the standalone Vimba exes work properly and our application works properly. As soon as Vimba is linked into our exe, the Startup() fails immediately.
Norman,
I was able to use Valgrind and get some additional information. It appears Valgrind reports Vimba’s initialization is using uninitialized memory inside of VmbC.so and subsequently crashing. Perhaps the stack dump below created via valgrind --track-origins=yes -s ./NewModule
may be helpful.
I’d appreciate any help – we are “shipping” this week and our target CPU doesn’t yet support windows, so we are stuck on linux.
usr@ubu:/repos/aburn/usr/modules/NewModule/bg$ valgrind --track-origins=yes -s ./NewModule
==68145== Memcheck, a memory error detector
==68145== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==68145== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==68145== Command: ./NewModule
==68145==
ManagerSerializableNetMsgMap - New Registered 'NetMsgGeneric' '1'
ManagerSerializableNetMsgMap - New Registered 'NetMsg' '4206933173'
ManagerSerializableNetMsgMap - Already Registered 'NetMsgGeneric' '1'
Vmb Version Major: 1 Minor: 0 Patch: 2
Calling shutdown...
done calling shutdown...
Calling startup...
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x653479D: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65347EB: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x65347C0: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65347EB: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x653480A: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65347EB: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x653481B: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
RETURNED from calling startup()
Startup successful
Exited AftrBurner Engine Normally...
==68145== Invalid read of size 8
==68145== at 0x87D4D7D: ??? (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x879E8AB: IFClose_ (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x879EA4C: IFClose (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x652BA68: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6546BCF: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65473E0: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6564B66: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6564BD8: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x656324F: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6563278: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x652755D: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6527638: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== Address 0x18 is not stack'd, malloc'd or (recently) free'd
==68145==
==68145==
==68145== Process terminating with default action of signal 11 (SIGSEGV)
==68145== Access not within mapped region at address 0x18
==68145== at 0x87D4D7D: ??? (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x879E8AB: IFClose_ (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x879EA4C: IFClose (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x652BA68: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6546BCF: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65473E0: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6564B66: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6564BD8: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x656324F: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6563278: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x652755D: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6527638: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== If you believe this happened as a result of a stack
==68145== overflow in your program's main thread (unlikely but
==68145== possible), you can try to increase the size of the
==68145== main thread stack using the --main-stacksize= flag.
==68145== The main thread stack size used in this run was 8388608.
==68145==
==68145== HEAP SUMMARY:
==68145== in use at exit: 325,425 bytes in 2,151 blocks
==68145== total heap usage: 24,583 allocs, 22,432 frees, 1,983,559 bytes allocated
==68145==
==68145== LEAK SUMMARY:
==68145== definitely lost: 48 bytes in 1 blocks
==68145== indirectly lost: 103 bytes in 4 blocks
==68145== possibly lost: 1,696 bytes in 9 blocks
==68145== still reachable: 323,578 bytes in 2,137 blocks
==68145== of which reachable via heuristic:
==68145== multipleinheritance: 4,720 bytes in 4 blocks
==68145== suppressed: 0 bytes in 0 blocks
==68145== Rerun with --leak-check=full to see details of leaked memory
==68145==
==68145== ERROR SUMMARY: 18 errors from 5 contexts (suppressed: 0 from 0)
==68145==
==68145== 1 errors in context 1 of 5:
==68145== Invalid read of size 8
==68145== at 0x87D4D7D: ??? (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x879E8AB: IFClose_ (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x879EA4C: IFClose (in /repos/VimbaX_2023-1/cti/VimbaGigETL.cti)
==68145== by 0x652BA68: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6546BCF: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65473E0: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6564B66: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6564BD8: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x656324F: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6563278: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x652755D: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6527638: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== Address 0x18 is not stack'd, malloc'd or (recently) free'd
==68145==
==68145==
==68145== 2 errors in context 2 of 5:
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x653481B: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
==68145==
==68145== 5 errors in context 3 of 5:
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x653480A: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65347EB: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
==68145==
==68145== 5 errors in context 4 of 5:
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x65347C0: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65347EB: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
==68145==
==68145== 5 errors in context 5 of 5:
==68145== Conditional jump or move depends on uninitialised value(s)
==68145== at 0x653479D: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x65347EB: std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::operator=(std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> > const&) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6591AD7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145== Uninitialised value was created by a heap allocation
==68145== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==68145== by 0x65919AD: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x6533935: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64E9F18: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x64EA71A: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==68145== by 0x59D297C: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==68145== by 0x19EFE3: foo() (main.cpp:68)
==68145== by 0x19F16E: main (main.cpp:90)
==68145==
==68145== ERROR SUMMARY: 18 errors from 5 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
@NormanDeh @AlliedVision Any thoughts would be greatly appreciated. Thanks!
I just opened up a support ticket, asking for quick help internally.
Please confirm you’re running VmbCPP API 1.0.2 from 2023-1 setup?
Ok, that can be assumed.
It turnes out that VimbaUSBTL.cti is the only VimbaX component with boost dependencies, loaded at VmbStartup(). As you could surrender USB support for now just try to delete VimbaUSBTL.cti from your cti folder. Any changes?
I am using VmbCPP API 1.0.2 from 2023-1 setup, yes.
I do not require USB. When I remove VimbaUSBTL.cti
from my install, the behavior, sadly, remains unchanged.
There are two different behaviors I am observing. The first behavior seems nearly correct and is described here:
When I write a simple program that initializes Vimba, I can make it work so long as I avoid including a header from to our application’s library into the compiled executable. When I do this, Vimba initializes properly and provides this output.
Here is the CMake file for the simple main.cpp only program which includes all the dependencies we ultimately must link against:
cmake_minimum_required(VERSION 3.20)
project(vexe LANGUAGES CXX)
find_package(Boost REQUIRED COMPONENTS thread)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost Not found")
endif()
find_package( fmt )
if( NOT fmt_FOUND )
message( FATAL_ERROR "libfmt not found" )
endif()
message( "Vimba info: $ENV{VIMBA_X_HOME}" )
#/repos/VimbaX_2023-1/api/lib/cmake/vmb
#export VIMBA_X_HOME=/repos/VimbaX_2023-1
find_package( Vmb REQUIRED COMPONENTS CPP HINTS /repos/VimbaX_2023-1/api/lib/cmake/vmb )
if( NOT Vmb_FOUND )
message( FATAL_ERROR "vmb not found" )
endif()
find_package( SDL2 )
if( NOT SDL2_FOUND )
message( FATAL_ERROR "SDL2 not found" )
endif()
find_package( SDL2_image )
if( NOT SDL2_image_FOUND )
message( FATAL_ERROR "SDL2_image not found" )
endif()
find_package( assimp )
if( NOT assimp_FOUND )
message( FATAL_ERROR "assimp not found" )
endif()
find_package( glm )
if( NOT glm_FOUND )
message( FATAL_ERROR "glm not found" )
endif()
find_package( Eigen3 )
if( NOT Eigen3_FOUND )
message( FATAL_ERROR "Eigen3 not found" )
endif()
find_package( GLEW )
if( NOT GLEW_FOUND )
message( FATAL_ERROR "GLEW not found" )
endif()
include ("/repos/aburn/usr/include/cmake/AftrBurnerEngine.cmake")
### RIGHT HERE I ONLY compile main.cpp into the final exe, producing positive behavior.
add_executable(vexe main.cpp ) ### bar.cpp GLViewNewModule.cpp )
set_property(TARGET vexe PROPERTY CXX_STANDARD 23)
target_include_directories( vexe PUBLIC /repos/aburn/usr/include/aftr )
target_include_directories( vexe PUBLIC /repos/aburn/usr/include/external )
target_link_libraries( vexe PUBLIC AftrBurnerEngine::AftrBurnerEngine )
target_link_libraries(vexe PUBLIC Boost::thread fmt::fmt Vmb::CPP SDL2::SDL2 SDL2_image::SDL2_image assimp::assimp Eigen3::Eigen glm::glm GLEW::GLEW "GL" "dl" )
The source code for main.cpp is:
//**********************************************************************************
// STEAMiE's Entry Point.
//**********************************************************************************
#include <VmbCPP/VmbCPP.h>
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <fmt/core.h>
#include <fmt/os.h>
#include <thread>
#include <chrono>
#include <boost/thread.hpp>
void bar( std::vector<std::string> const& args );
void foo()
{
using namespace VmbCPP;
VmbCPP::VmbSystem& s = VmbSystem::GetInstance(); // Get a reference to the VimbaSystem singleton
fmt::print("Calling shutdown...\n");
s.Shutdown();
fmt::print("done calling shutdown...\n");
std::this_thread::sleep_for( std::chrono::seconds(2) );
fmt::print("Calling startup...\n");
//VmbErrorType err = s.Startup("/repos/VimbaX_2023-1/cti/VimbaCSITL.cti"); // Initialize the Vmb API
VmbErrorType err = s.Startup(); // Initialize the Vmb API
fmt::print( "Startup() result is {:s}\n", std::to_string(err) );
fmt::print("RETURNED from calling startup()\n");
if (VmbErrorSuccess == err)
{
fmt::print("Startup successful\n\n");
}
else if (VmbErrorAlready == err)
{
fmt::print("Already init...\n");
}
else
{
fmt::print( "vimba init failed...{:d}\n", (int)err);
}
VmbVersionInfo_t versionInfo;
s.QueryVersion(versionInfo);
fmt::print("Vmb Version Major: {} Minor: {} Patch: {}\n\n",
versionInfo.major, versionInfo.minor, versionInfo.patch);
}
int main(int argc, char *argv[])
{
std::this_thread::sleep_for( std::chrono::seconds(2) );
foo();
std::vector<std::string> args{argv, argv + argc}; ///< Command line arguments passed via argc and argv, reserved to size of argc
std::cout << "Exited AftrBurner Engine Normally..." << std::endl;
return 0;
}
When I run the program, I receive this output. The exe initializes properly and functions, after main exits, there is a crash and Vimba outputs something about /data/boost_1_79_0
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ ./vexe
Calling shutdown...
done calling shutdown...
Calling startup...
Startup() result is 0
RETURNED from calling startup()
Startup successful
Vmb Version Major: 1 Minor: 0 Patch: 2
Calling shutdown...
done calling shutdown...
Calling startup...
Startup() result is 0
RETURNED from calling startup()
Startup successful
Vmb Version Major: 1 Minor: 0 Patch: 2
Exited AftrBurner Engine Normally...
vexe: /data/boost_1_79_0_Install_arm64/include/boost-1_79/boost/thread/pthread/condition_variable.hpp:183: boost::condition_variable_any::~condition_variable_any(): Assertion `!posix::pthread_mutex_destroy(&internal_mutex)' failed.
vexe: /data/boost_1_79_0_Install_arm64/include/boost-1_79/boost/thread/pthread/pthread_mutex_scoped_lock.hpp:27: boost::pthread::pthread_mutex_scoped_lock::pthread_mutex_scoped_lock(pthread_mutex_t*): Assertion `!posix::pthread_mutex_lock(m)' failed.
Aborted (core dumped)
It appears that the above code may properly work, however, I must include a header file for our internal application that compiles into this .exe. I will post that behavior next. Including this header file works correctly on windows (and has been for months using both the older 2022 Vimba X API and the 2023 API). On Windows, our product is ready to ship. However, on Linux, this exact same code then causes the Startup() command to segfault. I will post more in my next post now.
Our internal application also uses a few Meyer’s singletons to initialize various other parts of the application, like GLEW and other utilities that are unrelated to Vimba.
For clarify, here is the exact same main.cpp
run again through valgrind as it crashes on exit:
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ valgrind ./vexe
==231319== Memcheck, a memory error detector
==231319== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==231319== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==231319== Command: ./vexe
==231319==
Calling shutdown...
done calling shutdown...
Calling startup...
==231319== Thread 8:
==231319== Syscall param pselect6(exceptfds) points to uninitialised byte(s)
==231319== at 0x4DDC624: select (select.c:53)
==231319== by 0x7DFB32B: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x7E591CF: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x7E58F8F: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x7E58B33: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x48703A7: thread_proxy (in /usr/local/lib/libboost_thread.so.1.79.0)
==231319== by 0x4A58623: start_thread (pthread_create.c:477)
==231319== by 0x4DE349B: thread_start (clone.S:78)
==231319== Address 0x90876b8 is on thread 8's stack
==231319==
Startup() result is 0
RETURNED from calling startup()
Startup successful
Vmb Version Major: 1 Minor: 0 Patch: 2
Calling shutdown...
done calling shutdown...
Calling startup...
==231319== Syscall param pselect6(exceptfds) points to uninitialised byte(s)
==231319== at 0x4DDC624: select (select.c:53)
==231319== by 0x5D6732B: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5DC51CF: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5DC4F8F: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5DC4B33: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x48703A7: thread_proxy (in /usr/local/lib/libboost_thread.so.1.79.0)
==231319== by 0x4A58623: start_thread (pthread_create.c:477)
==231319== by 0x4DE349B: thread_start (clone.S:78)
==231319== Address 0x82d16b8 is on thread 8's stack
==231319==
Startup() result is 0
RETURNED from calling startup()
Startup successful
Vmb Version Major: 1 Minor: 0 Patch: 2
Exited AftrBurner Engine Normally...
vexe: /data/boost_1_79_0_Install_arm64/include/boost-1_79/boost/thread/pthread/condition_variable.hpp:183: boost::condition_variable_any::~condition_variable_any(): Assertion `!posix::pthread_mutex_destroy(&internal_mutex)' failed.
vexe: /data/boost_1_79_0_Install_arm64/include/boost-1_79/boost/thread/pthread/pthread_mutex_scoped_lock.hpp:27: boost::pthread::pthread_mutex_scoped_lock::pthread_mutex_scoped_lock(pthread_mutex_t*): Assertion `!posix::pthread_mutex_lock(m)' failed.
==231319==
==231319== Process terminating with default action of signal 6 (SIGABRT)
==231319== at 0x4D45D78: raise (raise.c:51)
==231319== by 0x4D32AAB: abort (abort.c:79)
==231319== by 0x4D3F48F: __assert_fail_base (assert.c:92)
==231319== by 0x4D3F4F3: __assert_fail (assert.c:101)
==231319== by 0x5C9A3B7: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5C9A6A7: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5D8C233: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5D8C2B3: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5DC4B57: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5AA791F: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5AA79FF: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319== by 0x5D76A7F: ??? (in /repos/VimbaX_2023-1/cti/VimbaCSITL.cti)
==231319==
==231319== HEAP SUMMARY:
==231319== in use at exit: 1,755,755 bytes in 12,520 blocks
==231319== total heap usage: 108,822 allocs, 96,302 frees, 10,734,342 bytes allocated
==231319==
==231319== LEAK SUMMARY:
==231319== definitely lost: 0 bytes in 0 blocks
==231319== indirectly lost: 0 bytes in 0 blocks
==231319== possibly lost: 3,648 bytes in 12 blocks
==231319== still reachable: 1,752,107 bytes in 12,508 blocks
==231319== of which reachable via heuristic:
==231319== multipleinheritance: 15,696 bytes in 17 blocks
==231319== suppressed: 0 bytes in 0 blocks
==231319== Rerun with --leak-check=full to see details of leaked memory
==231319==
==231319== Use --track-origins=yes to see where uninitialised values come from
==231319== For lists of detected and suppressed errors, rerun with: -s
==231319== ERROR SUMMARY: 6 errors from 2 contexts (suppressed: 0 from 0)
Aborted (core dumped)
When VIMBA SEGFAULTs on Startup()
As I mentioned above, the simple main.cpp
appears to initialize properly. The crash on exit may not affect acquisition during runtime, so I will pretend that is currently not a problem.
Now, if I modify the CMake file above to also compile a translation unit that include our business logic for using the camera, the Startup() fails. Here is the relevant change to the above CMakeLists.txt
add_executable(vexe main.cpp bar.cpp GLViewNewModule.cpp )
bar.cpp is simply a stub file that avoids including the header file for GLViewNewModule.cpp inside of main.cpp. I believe this is unnecessary and have never had to use this approach in the past 18 years of programming with our AftrBurner API, but for the sake of isolation, I ensured main.cpp did not include any header files from our internal AftrBurner API (C++ 3D visualization engine).
Here is the contents of bar.cpp:
#include "GLViewNewModule.h" //GLView subclass instantiated to drive this simulation
#include <memory>
#include <vector>
#include <string>
void bar( std::vector<std::string> const& args )
{
int simStatus{0};
do
{
std::unique_ptr<Aftr::GLViewNewModule> glView(Aftr::GLViewNewModule::New(args));
simStatus = glView->startWorldSimulationLoop();
} while (simStatus != 0);
}
Now, the only change to main.cpp
is a call to bar()
(after the call to foo()
, the code is the same as above with one additional function call in main():
int main(int argc, char *argv[])
{
std::this_thread::sleep_for( std::chrono::seconds(2) );
foo();
std::vector<std::string> args{argv, argv + argc};
bar( args ); //THIS IS THE NEW CALL
std::cout << "Exited AftrBurner Engine Normally..." << std::endl;
return 0;
}
Now I compile and link (no warnings, no errors). When I run the executable, I see:
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ ./vexe
ManagerSerializableNetMsgMap - New Registered 'NetMsgGeneric' '1'
ManagerSerializableNetMsgMap - New Registered 'NetMsg' '1929798847'
ManagerSerializableNetMsgMap - Already Registered 'NetMsgGeneric' '1'
Calling shutdown...
done calling shutdown...
Calling startup...
Segmentation fault (core dumped)
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$
The ManagerSerializableNetMsgMap is a static initialization manager that registers some network messages.
When I run this in gdb, I see:
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ gdb ./vexe
GNU gdb (Ubuntu 10.2-0ubuntu1~20.04~1) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./vexe...
(gdb) run
Starting program: /repos/aburn/usr/hub/Vexe/bg/vexe
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
ManagerSerializableNetMsgMap - New Registered 'NetMsgGeneric' '1'
ManagerSerializableNetMsgMap - New Registered 'NetMsg' '1929798847'
ManagerSerializableNetMsgMap - Already Registered 'NetMsgGeneric' '1'
Calling shutdown...
done calling shutdown...
Calling startup...
Program received signal SIGSEGV, Segmentation fault.
0x0000fffff677d5d4 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
(gdb) bt
#0 0x0000fffff677d5d4 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#1 0x0000fffff67700dc in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#2 0x0000fffff67708c4 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#3 0x0000fffff6720a8c in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#4 0x0000fffff6721a6c in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#5 0x0000fffff6724bb8 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#6 0x0000fffff6725514 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#7 0x0000fffff66dade4 in ?? () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#8 0x0000fffff66db2c0 in VmbStartup () from /repos/VimbaX_2023-1/api/lib/libVmbC.so
#9 0x0000fffff7f710d0 in VmbCPP::VmbSystem::Startup(char const*) () from /repos/VimbaX_2023-1/api/lib/libVmbCPP.so
#10 0x0000aaaaaab2e9b8 in foo () at /repos/aburn/usr/hub/Vexe/src/main.cpp:76
#11 0x0000aaaaaab2eca4 in main (argc=1, argv=0xfffffffff008) at /repos/aburn/usr/hub/Vexe/src/main.cpp:101
(gdb)
When I run again in Valgrind with very verbose options, I can see some internal Vimba callstacks that may be helpful. There is also some reported memory leaks inside AftrBurner and Vimba, but keep in mind, the exe crashes, so the d’tors are never called:
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ valgrind -s --track-origins=yes --leak-check=full --show-leak-kinds=all ./vexe
==233175== Memcheck, a memory error detector
==233175== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==233175== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==233175== Command: ./vexe
==233175==
ManagerSerializableNetMsgMap - New Registered 'NetMsgGeneric' '1'
ManagerSerializableNetMsgMap - New Registered 'NetMsg' '1929798847'
ManagerSerializableNetMsgMap - Already Registered 'NetMsgGeneric' '1'
Calling shutdown...
done calling shutdown...
Calling startup...
==233175== Conditional jump or move depends on uninitialised value(s)
==233175== at 0x61345B0: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61270DB: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61278C3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D7A8B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D8A6B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DBBB7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DC513: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6091DE3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60922BF: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x48C80CF: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
...
==233175== Process terminating with default action of signal 11 (SIGSEGV)
==233175== Access not within mapped region at address 0xFFFFFFFFFFFFFFC0
==233175== at 0x61345D4: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61270DB: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61278C3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D7A8B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D8A6B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DBBB7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DC513: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6091DE3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60922BF: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x48C80CF: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x1969B7: foo() (main.cpp:76)
==233175== by 0x196CA3: main (main.cpp:101)
==233175== If you believe this happened as a result of a stack
==233175== overflow in your program's main thread (unlikely but
==233175== possible), you can try to increase the size of the
==233175== main thread stack using the --main-stacksize= flag.
==233175== The main thread stack size used in this run was 8388608.
==233175==
==233175== HEAP SUMMARY:
==233175== in use at exit: 81,382 bytes in 481 blocks
==233175== total heap usage: 523 allocs, 42 frees, 174,204 bytes allocated
==233175==
==233175== 8 bytes in 1 blocks are still reachable in loss record 1 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48C26F3: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175== 22 bytes in 1 blocks are still reachable in loss record 8 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x612709B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61278C3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D7A8B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D8A6B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DBBB7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DC513: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6091DE3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60922BF: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x48C80CF: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x1969B7: foo() (main.cpp:76)
==233175== by 0x196CA3: main (main.cpp:101)
==233175==
==233175== 24 bytes in 1 blocks are still reachable in loss record 9 of 144
==233175== at 0x484C0A4: calloc (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x61075DB: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61076A3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6086BA3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60841FF: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 24 bytes in 1 blocks are still reachable in loss record 10 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x487794F: boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>() (in /usr/local/lib/libboost_thread.so.1.79.0)
==233175== by 0x486EE53: _GLOBAL__sub_I_thread.cpp (in /usr/local/lib/libboost_thread.so.1.79.0)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 24 bytes in 1 blocks are still reachable in loss record 11 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x4877C7F: boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>() (in /usr/local/lib/libboost_thread.so.1.79.0)
==233175== by 0x486EE8F: _GLOBAL__sub_I_thread.cpp (in /usr/local/lib/libboost_thread.so.1.79.0)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 24 bytes in 1 blocks are still reachable in loss record 12 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x19C273: boost::detail::shared_count::shared_count<boost::exception_detail::clone_impl<boost::exception_detail::bad_alloc_> >(boost::exception_detail::clone_impl<boost::exception_detail::bad_alloc_>*) (shared_count.hpp:150)
==233175== by 0x19BE97: void boost::detail::sp_pointer_construct<boost::exception_detail::clone_base const, boost::exception_detail::clone_impl<boost::exception_detail::bad_alloc_> >(boost::shared_ptr<boost::exception_detail::clone_base const>*, boost::exception_detail::clone_impl<boost::exception_detail::bad_alloc_>*, boost::detail::shared_count&) (shared_ptr.hpp:279)
==233175== by 0x19B63F: boost::shared_ptr<boost::exception_detail::clone_base const>::shared_ptr<boost::exception_detail::clone_impl<boost::exception_detail::bad_alloc_> >(boost::exception_detail::clone_impl<boost::exception_detail::bad_alloc_>*) (shared_ptr.hpp:373)
==233175== by 0x19A703: boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>() (exception_ptr.hpp:176)
==233175== by 0x196DDF: __static_initialization_and_destruction_0() (exception_ptr.hpp:189)
==233175== by 0x196EAB: _GLOBAL__sub_I__Z3foov (main.cpp:107)
==233175== by 0x8C3E7F: __libc_csu_init (in /repos/aburn/usr/hub/Vexe/bg/vexe)
==233175== by 0x5F04DB7: (below main) (libc-start.c:264)
==233175==
==233175== 24 bytes in 1 blocks are still reachable in loss record 13 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x19C357: boost::detail::shared_count::shared_count<boost::exception_detail::clone_impl<boost::exception_detail::bad_exception_> >(boost::exception_detail::clone_impl<boost::exception_detail::bad_exception_>*) (shared_count.hpp:150)
==233175== by 0x19BF9F: void boost::detail::sp_pointer_construct<boost::exception_detail::clone_base const, boost::exception_detail::clone_impl<boost::exception_detail::bad_exception_> >(boost::shared_ptr<boost::exception_detail::clone_base const>*, boost::exception_detail::clone_impl<boost::exception_detail::bad_exception_>*, boost::detail::shared_count&) (shared_ptr.hpp:279)
==233175== by 0x19B8B7: boost::shared_ptr<boost::exception_detail::clone_base const>::shared_ptr<boost::exception_detail::clone_impl<boost::exception_detail::bad_exception_> >(boost::exception_detail::clone_impl<boost::exception_detail::bad_exception_>*) (shared_ptr.hpp:373)
==233175== by 0x19AAEB: boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>() (exception_ptr.hpp:176)
==233175== by 0x196E33: __static_initialization_and_destruction_0() (exception_ptr.hpp:189)
==233175== by 0x196EAB: _GLOBAL__sub_I__Z3foov (main.cpp:107)
==233175== by 0x8C3E7F: __libc_csu_init (in /repos/aburn/usr/hub/Vexe/bg/vexe)
==233175== by 0x5F04DB7: (below main) (libc-start.c:264)
==233175== ...
==233175== 32 bytes in 1 blocks are still reachable in loss record 30 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC6E7: VmbCPP::Condition::Condition() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ACBF3: VmbCPP::ConditionHelper::ConditionHelper() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C2643: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 32 bytes in 1 blocks are still reachable in loss record 31 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC6E7: VmbCPP::Condition::Condition() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ACBFB: VmbCPP::ConditionHelper::ConditionHelper() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C2643: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 32 bytes in 1 blocks are still reachable in loss record 32 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC6E7: VmbCPP::Condition::Condition() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ACBF3: VmbCPP::ConditionHelper::ConditionHelper() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C2683: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 48 bytes in 1 blocks are still reachable in loss record 47 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC0A3: VmbCPP::BasicLockable::BasicLockable() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C256F: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 48 bytes in 1 blocks are still reachable in loss record 48 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC0A3: VmbCPP::BasicLockable::BasicLockable() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C25CF: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 48 bytes in 1 blocks are still reachable in loss record 49 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC0A3: VmbCPP::BasicLockable::BasicLockable() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C260F: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 48 bytes in 1 blocks are still reachable in loss record 50 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC0A3: VmbCPP::BasicLockable::BasicLockable() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C264F: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 48 bytes in 1 blocks are still reachable in loss record 51 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC0A3: VmbCPP::BasicLockable::BasicLockable() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C268F: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 72 bytes in 1 blocks are still reachable in loss record 85 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC0BB: VmbCPP::BasicLockable::BasicLockable() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C264F: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 72 bytes in 1 blocks are still reachable in loss record 86 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x48AC6FF: VmbCPP::Condition::Condition() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ACBF3: VmbCPP::ConditionHelper::ConditionHelper() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48C2683: VmbCPP::VmbSystem::VmbSystem() (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x48ABE1B: _GLOBAL__sub_I_VmbSystem.cpp (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x400E8B3: call_init.part.0 (dl-init.c:72)
==233175== by 0x400E9B3: call_init (dl-init.c:30)
==233175== by 0x400E9B3: _dl_init (dl-init.c:119)
==233175== by 0x4001183: ??? (in /usr/lib/aarch64-linux-gnu/ld-2.31.so)
==233175==
==233175== 96 bytes in 1 blocks are still reachable in loss record 100 of 144
==233175== at 0x484C0A4: calloc (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x610BC57: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x610BD6B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x610A2C3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x610A35B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D1BCF: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D1D0F: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6091B83: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60922BF: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x48C80CF: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x1969B7: foo() (main.cpp:76)
==233175== by 0x196CA3: main (main.cpp:101)
==233175==
==233175== 96 bytes in 1 blocks are still reachable in loss record 101 of 144
==233175== at 0x484C0A4: calloc (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x610BC57: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x610BD6B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61145A7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6114633: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D1BF3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D1D0F: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6091B83: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60922BF: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x48C80CF: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x1969B7: foo() (main.cpp:76)
==233175== by 0x196CA3: main (main.cpp:101)
==233175==
==233175== 96 bytes in 1 blocks are still reachable in loss record 102 of 144
==233175== at 0x484C0A4: calloc (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x610BC57: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x610BD6B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61147F7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6114883: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D1C07: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D1D0F: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6091B83: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60922BF: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x48C80CF: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x1969B7: foo() (main.cpp:76)
==233175== by 0x196CA3: main (main.cpp:101)
==233175==
==233175== 104 bytes in 1 blocks are still reachable in loss record 103 of 144
==233175== at 0x484A3C4: operator new(unsigned long) (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==233175== by 0x612273B: TiXmlNode::Identify(char const*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6122A9B: TiXmlElement::ReadValue(char const*, TiXmlParsingData*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6122F07: TiXmlElement::Parse(char const*, TiXmlParsingData*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6122ABB: TiXmlElement::ReadValue(char const*, TiXmlParsingData*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6122F07: TiXmlElement::Parse(char const*, TiXmlParsingData*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6122ABB: TiXmlElement::ReadValue(char const*, TiXmlParsingData*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6122F07: TiXmlElement::Parse(char const*, TiXmlParsingData*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6123567: TiXmlDocument::Parse(char const*, TiXmlParsingData*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6121167: TiXmlDocument::LoadFile(_IO_FILE*, TiXmlEncoding) (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61163D7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61167F7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175==
==233175==
==233175==
==233175== LEAK SUMMARY:
==233175== definitely lost: 0 bytes in 0 blocks
==233175== indirectly lost: 0 bytes in 0 blocks
==233175== possibly lost: 160 bytes in 2 blocks
==233175== still reachable: 81,222 bytes in 479 blocks
==233175== suppressed: 0 bytes in 0 blocks
==233175==
==233175== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
==233175==
==233175== 1 errors in context 1 of 6:
==233175== Invalid read of size 8
==233175== at 0x61345D4: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61270DB: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x61278C3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D7A8B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60D8A6B: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DBBB7: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60DC513: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x6091DE3: ??? (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x60922BF: VmbStartup (in /repos/VimbaX_2023-1/api/lib/libVmbC.so)
==233175== by 0x48C80CF: VmbCPP::VmbSystem::Startup(char const*) (in /repos/VimbaX_2023-1/api/lib/libVmbCPP.so)
==233175== by 0x1969B7: foo() (main.cpp:76)
==233175== by 0x196CA3: main (main.cpp:101)
==233175== Address 0xffffffffffffffc0 is not stack'd, malloc'd or (recently) free'd
==233175==
==233175== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$
Interestinly enough, if I simply run the same exe with sudo:
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ sudo ./vexe
[sudo] password for user:
ManagerSerializableNetMsgMap - New Registered 'NetMsgGeneric' '1'
ManagerSerializableNetMsgMap - New Registered 'NetMsg' '1929798847'
ManagerSerializableNetMsgMap - Already Registered 'NetMsgGeneric' '1'
Calling shutdown...
done calling shutdown...
Calling startup...
Startup() result is -3
RETURNED from calling startup()
vimba init failed...-3
Vmb Version Major: 1 Minor: 0 Patch: 2
ManagerVimba::init()...
ManagerVimba Startup() return status 0...
ManagerVimba successfully initialized...
Found Config file "../aftr.conf" located in additional search directory "../"...
args[0]="./vexe"
'NetServerListenPort' = '12683'
'SDL_GL_MULTISAMPLESAMPLES' = '0'
'createwindow' = '1'
'defaultfont' = 'cour.ttf'
'fullscreen' = 'false'
'glContextProfile' = 'compatibility'
...
The Vimba Startup immediately failes with status -3 and the rest of the application loads and functions completely normally – the 3D rendering works and all other parts of the software work. But we cannot init Vimba nor connect to the cameras.
Of course, one isn’t supposed to launch the Vimba examples with sudo as that causes Vimba Startup() to report the designated instance cannot be found.
Any thoughts or ideas? I am more than willing to download an unofficial patch from any willing devs for ARM64 Ubuntu who can perhaps fix the init. I hope the verbose valgrind callstacks can point to a useful hint within the Startup (I had to trim down some output so this post would fit in 32,000 chars)
In the valgrind output, there appears to be use of an Vimba XML parser as well as boost condition variables, mutexes, and other threaded things – of course, these can be very tricky to manage during static initialization.
Thanks,
Scott
For fun, I’ve turned on -fsanitize=address and run the program when linked to my AftrBurner library and when not linked. The only change is the static link. The main.cpp still immediately calls vimba’s Startup() via foo()
.
Here is the main.cpp
//**********************************************************************************
// STEAMiE's Entry Point.
//**********************************************************************************
#include <VmbCPP/VmbCPP.h>
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <fmt/core.h>
#include <fmt/os.h>
#include <thread>
#include <chrono>
#include <boost/thread.hpp>
void bar( std::vector<std::string> const& args );
class Singleton
{
public:
static VmbCPP::VmbSystem &get()
{
static Singleton s;
return s.sys;
}
Singleton(Singleton const &) = delete;
Singleton &operator=(Singleton const &) = delete;
private:
Singleton() : sys(VmbCPP::VmbSystem::GetInstance())
{
fmt::print("Created the singleton...\n");
fmt::print("Calling startup...\n");
//get().Startup();
// VmbErrorType err = sys.Startup("/repos/VimbaX_2023-1/cti/VimbaGigETL.xml"); // Initialize the Vmb API
VmbErrorType err = VmbCPP::VmbSystem::GetInstance().Startup(); // Initialize the Vmb API
fmt::print( "Startup() result is {:s}\n", std::to_string(err) );
if( !err )
{
fmt::print( "SUCCESS, the INIT WORKED PROPERLY FOR VIMBA!!!!!!\n\n\n" );
}
else
{
fmt::print( "failed to init properly, code {:d}...\n", int(err) );
}
VmbVersionInfo_t versionInfo;
sys.QueryVersion(versionInfo);
fmt::print("Vmb Version Major: {} Minor: {} Patch: {}\n\n",
versionInfo.major, versionInfo.minor, versionInfo.patch);
}
~Singleton() {}
VmbCPP::VmbSystem &sys;
};
//static auto &s = Singleton::get(); //when uncommented, uses a Meyer's Singleton & static initialization to call VmbStartUp() before main() begins running
// VmbCPP::VmbSystem* Singleton::ptr = &(VmbCPP::VmbSystem::GetInstance());
void foo()
{
using namespace VmbCPP;
VmbCPP::VmbSystem& s = VmbSystem::GetInstance(); // Get a reference to the VimbaSystem singleton
fmt::print("Calling shutdown...\n");
s.Shutdown();
fmt::print("done calling shutdown...\n");
std::this_thread::sleep_for( std::chrono::seconds(2) );
fmt::print("Calling startup...\n");
//VmbErrorType err = s.Startup("/repos/VimbaX_2023-1/cti/VimbaCSITL.cti"); // Initialize the Vmb API
VmbErrorType err = s.Startup(); // Initialize the Vmb API
fmt::print( "Startup() result is {:s}\n", std::to_string(err) );
fmt::print("RETURNED from calling startup()\n");
if (VmbErrorSuccess == err)
{
fmt::print("Startup successful\n\n");
}
else if (VmbErrorAlready == err)
{
fmt::print("Already init...\n");
}
else
{
fmt::print( "vimba init failed...{:d}\n", (int)err);
}
VmbVersionInfo_t versionInfo;
s.QueryVersion(versionInfo);
fmt::print("Vmb Version Major: {} Minor: {} Patch: {}\n\n",
versionInfo.major, versionInfo.minor, versionInfo.patch);
}
int main(int argc, char *argv[])
{
fmt::print( "In main\n" );
//std::this_thread::sleep_for( std::chrono::seconds(2) );
foo();
std::vector<std::string> args{argv, argv + argc};
//foo();
bar( args );
VmbCPP::VmbSystem::GetInstance().Shutdown();
std::cout << "Exited AftrBurner Engine Normally..." << std::endl;
return 0;
}
Before completing foo(), the Vimba driver appears to dereference an invalid memory location. I believe there may be some place in the Vimba driver that potentially has a bug and is affected by the binary layout changed when linking several static binaries together??
Here is the output with -fsanitize=address showing the problem.
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ ./vexe
In main
Calling shutdown...
done calling shutdown...
Calling startup...
AddressSanitizer:DEADLYSIGNAL
=================================================================
==254919==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000020 (pc 0xaaaabef16c0c bp 0xfffff1f97f80 sp 0xfffff1f97f80 T0)
==254919==The signal is caused by a READ memory access.
==254919==Hint: address points to the zero page.
#0 0xaaaabef16c0c in std::unique_ptr<std::filesystem::__cxx11::path::_List::_Impl, std::filesystem::__cxx11::path::_List::_Impl_deleter>::~unique_ptr() /usr/include/c++/13/bits/unique_ptr.h:403
#1 0xaaaabef163d0 in std::filesystem::__cxx11::path::_List::~_List() /usr/include/c++/13/bits/fs_path.h:689
#2 0xaaaabef163f4 in std::filesystem::__cxx11::path::~path() /usr/include/c++/13/bits/fs_path.h:355
#3 0xffff97a9c478 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0xde478) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#4 0xffff97a8e100 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0xd0100) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#5 0xffff97a8e8c0 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0xd08c0) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#6 0xffff97a3ea88 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0x80a88) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#7 0xffff97a3fa68 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0x81a68) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#8 0xffff97a42bb4 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0x84bb4) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#9 0xffff97a43510 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0x85510) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#10 0xffff979f8de0 (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0x3ade0) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#11 0xffff979f92bc in VmbStartup (/repos/VimbaX_2023-1/api/lib/libVmbC.so+0x3b2bc) (BuildId: 3b769612fd19963e5256e6b0d71efbd9e7e3b299)
#12 0xffff98d910cc in VmbCPP::VmbSystem::Startup(char const*) (/repos/VimbaX_2023-1/api/lib/libVmbCPP.so+0x360cc) (BuildId: 88d4a41ac7f2f05f8362958d4f4c731c2986854e)
#13 0xaaaabedc4ed8 in foo() /repos/aburn/usr/hub/Vexe/src/main.cpp:76
#14 0xaaaabedc5b74 in main /repos/aburn/usr/hub/Vexe/src/main.cpp:102
#15 0xffff974bde0c in __libc_start_main ../csu/libc-start.c:308
#16 0xaaaabedc3f84 (/repos/aburn/usr/hub/Vexe/bg/vexe+0x243f84) (BuildId: dd85a73150aa5b0b7d6bf48213b597e27e71dd88)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /usr/include/c++/13/bits/unique_ptr.h:403 in std::unique_ptr<std::filesystem::__cxx11::path::_List::_Impl, std::filesystem::__cxx11::path::_List::_Impl_deleter>::~unique_ptr()
==254919==ABORTING
If I remove the link to my static library from cmake, and run again, the library properly initializes:
user@AFIT-Jetson-20:/repos/aburn/usr/hub/Vexe/bg$ ./vexe
In main
Calling shutdown...
done calling shutdown...
Calling startup...
Startup() result is 0
RETURNED from calling startup()
Startup successful
Vmb Version Major: 1 Minor: 0 Patch: 2
Exited AftrBurner Engine Normally...
Again, no function from the library is ever called or used (I commented out the call to bar()
). The library is only linked and then the behavior of Vimba’s Startup() is affected.
Hopefully this provides a hint as well.
Thanks,
Scott