I am trying to understand why my app crashes in ubuntu 18.04, not just how to work around it, to better understand what is going on.
I have built a C++ application which uses boost in ubuntu 22.04 (using CMake) and I have packed my application into deb using CPack. Installing and running the application in another ubuntu 22.04 works well.
Installation on 18.04 works well but once I am running the application, it crashes with Segmentation fault
before it even reaches main
.
Running using GDB also with the message:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
Stack trace (bt
) doesn't provide much info (that at least I can figure out):
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff7a5aa99 in ?? ()
#2 0x0000000000000000 in ?? ()
I have brought all the dependencies into $ORIGIN/lib
from the 22.04 and placed $ORIGIN/lib
in the executable RPATH. The dependencies include libc
, libc++
and boost *.so
.
Using ldd
on the executable everything looks fine and it seems all the dependencies are found using RPATH:
linux-vdso.so.1 (0x00007ffd37768000)
libboost_filesystem-mt-d-x64.so.1.79.0 => /opt/testapp/lib/libboost_filesystem-mt-d-x64.so.1.79.0 (0x00007f1e05673000)
libboost_program_options-mt-d-x64.so.1.79.0 => /opt/testapp/lib/libboost_program_options-mt-d-x64.so.1.79.0 (0x00007f1e055ff000)
libstdc++.so.6 => /opt/testapp/lib/libstdc++.so.6 (0x00007f1e0532a000)
libgcc_s.so.1 => /opt/testapp/lib/libgcc_s.so.1 (0x00007f1e055df000)
libc.so.6 => /opt/testapp/lib/libc.so.6 (0x00007f1e05102000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1e04d64000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1e05554000)
Does anyone have any idea why it crashes, or provide some hints on next steps?
Thanks!