Same execute file crashed when start application from cmd prompt but works when start from clion
Hey as I pointed in title. My application crashed when I launched the execute file from cmd prompt while worked when I started it through IDE.
System: Ubuntu 18.04 IDE: Clion
It crashed during Application::startUp(); gdb log:
Starting program: /home/hejia/Projects/interactive-simulation/ids_visualizer/cmake-build-debug/bin/x64/Debug/ids_visualizer -m /home/hejia/Projects/interactive-simulation/ids_visualizer/assets/acrobot.xml [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff24d7700 (LWP 6935)] [New Thread 0x7ffff1bd5700 (LWP 6936)]
Thread 3 "ids_visualizer" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1bd5700 (LWP 6936)]
0x0000000000000000 in ?? ()
(gdb) thread backtrace all
Invalid thread ID: backtrace all
(gdb) backtrace
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff101ee63 in bs::ct::GLRenderAPI::initFromCaps (this=0x555555850560, caps=0x7fffe420d380) at /home/hejia/Projects/interactive-simulation/ids_visualizer/src/bsf/Source/Plugins/bsfGLRenderAPI/BsGLRenderAPI.cpp:2383
#2 0x00007ffff1016698 in bs::ct::GLRenderAPI::initializeWithWindow (this=0x555555850560, primaryWindow=std::shared_ptrbs::ct::RenderWindow (use count 3, weak count 1) = {...})
at /home/hejia/Projects/interactive-simulation/ids_visualizer/src/bsf/Source/Plugins/bsfGLRenderAPI/BsGLRenderAPI.cpp:167
#3 0x00007ffff6ccac43 in std::__invoke_impl<void, void (bs::ct::RenderAPI::&)(std::shared_ptrbs::ct::RenderWindow const&), bs::ct::RenderAPI&, std::shared_ptrbs::ct::RenderWindow&> (
__f=@0x5555558512f0: &virtual bs::ct::RenderAPI::initializeWithWindow(std::shared_ptrbs::ct::RenderWindow const&), __t=@0x555555851310: 0x555555850560, __args#0=std::shared_ptrbs::ct::RenderWindow (use count 3, weak count 1) = {...})
at /usr/include/c++/7/bits/invoke.h:73
#4 0x00007ffff6cc91ce in std::__invoke<void (bs::ct::RenderAPI::&)(std::shared_ptrbs::ct::RenderWindow const&), bs::ct::RenderAPI&, std::shared_ptrbs::ct::RenderWindow&> (
__fn=@0x5555558512f0: &virtual bs::ct::RenderAPI::initializeWithWindow(std::shared_ptrbs::ct::RenderWindow const&), __args#0=@0x555555851310: 0x555555850560, __args#1=std::shared_ptrbs::ct::RenderWindow (use count 3, weak count 1) = {...})
at /usr/include/c++/7/bits/invoke.h:95
#5 0x00007ffff6cc7242 in std::_Bind<void (bs::ct::RenderAPI::(bs::ct::RenderAPI, std::shared_ptrbs::ct::RenderWindow))(std::shared_ptrbs::ct::RenderWindow const&)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) (this=0x5555558512f0,
__args=...) at /usr/include/c++/7/functional:467
#6 0x00007ffff6cc53d7 in std::_Bind<void (bs::ct::RenderAPI::(bs::ct::RenderAPI, std::shared_ptrbs::ct::RenderWindow))(std::shared_ptrbs::ct::RenderWindow const&)>::operator()<, void>() (this=0x5555558512f0) at /usr/include/c++/7/functional:551
#7 0x00007ffff6cc24a0 in std::_Function_handler<void (), std::_Bind<void (bs::ct::RenderAPI::(bs::ct::RenderAPI, std::shared_ptrbs::ct::RenderWindow))(std::shared_ptrbs::ct::RenderWindow const&)> >::_M_invoke(std::_Any_data const&) (__functor=...)
at /usr/include/c++/7/bits/std_function.h:316
#8 0x00007ffff689b0f8 in std::function<void ()>::operator()() const (this=0x5555558271b0) at /usr/include/c++/7/bits/std_function.h:706
#9 0x00007ffff6965988 in bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >, std::function<void (unsigned int)>) (this=0x555555826d80, commands=0x555555806610,
notifyCallback=...) at /home/hejia/Projects/interactive-simulation/ids_visualizer/src/bsf/Source/Foundation/bsfCore/CoreThread/BsCommandQueue.cpp:124
---Type
Any idea would be appreciated!
This exact same version of the binary (without any recompilation) works in the IDE?
Normally I would suggest this has something to do with a different working path, but I doubt it's so in this case as the code crashes in OpenGL which shouldn't care about the path. Perhaps a different version of some library gets loaded? Does CLion modify LD_LIBRARY_PATH environment variable or some other library search path?
I'm currently on Ubuntu 18.10, also working with CLion and compiling with GCC. I'm able to run the example projects both from the IDE and from the terminal. Make sure to check the issue happens with latest master and with the example projects.