问题
I'm having trouble debugging a C++ program on AIX built with GNU tools. When the program runs outside the debugger:
-bash-4.3$ ./cryptestcwd v
Segmentation fault (core dumped)
When the program runs under GDB, the debugger prints the message During startup program terminated with signal SIGKILL, Killed. and exits:
An added wrinkle is, this only happens with an Autotools front-end. It does not happens with our regular GNUmakefile. We supply the same arguments to both Autotools and the GNUmakefile. We are aware Autotools adds additional options and even adds C files to the C++ project, but we have no control over it.
A related question is at During startup program terminated with signal SIGKILL, Killed, but it does not have useful answers. Two other related questions just state that SIGKILL cannot be caught. Also see Debugging program that catches SIGKILL under Linux and Handling signals with gdb.
How can I debug the problem further?
回答1:
The SIGKILL at startup most likely means that the AIX runtime loader couldn't find some library that the binary links against (a Linux runtime loader produces a more helpful error message when that happens).
You should verify that ldd cryptestcwd doesn't complain about anything.
You could also try to load the core that is produced when you run your program outside of GDB into GDB -- there may be additional clues there (use info shared, where, x/i $pc commands).
来源:https://stackoverflow.com/questions/47314385/message-during-startup-program-terminated-with-signal-sigkill-from-gdb