What happens when a kernel file is created from a Linux distribution other than the one we use in Dev? Is stack tracing generally meaningful?
If the executable is dynamically linked, like yours, the stack created by GDB (most likely) will not make sense.
Reason: GDB knows that your executable file crashes 0x00454ff1
by calling something in libc.so.6
at 0x00454ff1
, but it does not know what code was at that address. Thus, it scans your copy of libc.so.6
and finds that it is in select
, therefore prints it.
But the chances that 0x00454ff1
also selected in your client copy of libc.so.6
are pretty small. Most likely, the client had a different procedure at this address, possibly abort
.
You can use disas select
and observe that 0x00454ff1
is either in the middle of the instruction, or that the previous instruction is not CALL
. If any of this is true, your stack trace does not make sense.
However, you can help yourself: you just need to get a copy of all the libraries listed in (gdb) info shared
from the client system. Ask the customer to change them, for example, to
cd / tar cvzf to-you.tar.gz lib/libc.so.6 lib/ld-linux.so.2 ...
Then on your system:
mkdir /tmp/from-customer tar xzf to-you.tar.gz -C /tmp/from-customer gdb /path/to/binary (gdb) set solib-absolute-prefix /tmp/from-customer (gdb) core core # Note: very important to set solib-... before loading core (gdb) where # Get meaningful stack trace!
Then we advise the Customer to run the -g binary file to make it easier to debug.
A much better approach:
- build with
-g -o2 -o myexe.dbg
strip -g myexe.dbg -o myexe
- distribute
myexe
to clients - when the client receives
core
, use myexe.dbg
to debug it
You will have full symbolic information (file / line, local variables), without having to send a special binary file to the client and without revealing too many details about your sources.