crash - core dump files on Linux: how to get info on opened files? -
i have core dump file process has file descriptor leak (it opens files , sockets apparently forgets close of them). there way find out files , sockets process had opened before crashing? can't reproduce crash, analyzing core file seems way hint on bug.
if have core file , have compiled program debuging options (-g), can see core dumped:
$ gcc -g -o something.c $ ./something segmentation fault (core dumped) $ gdb core
you can use post-mortem debuging. few gdb commands: br prints stack, fr jumps given stack frame (see output of br).
now if want see files opened @ segmentation fault, handle sigsegv signal, , in handler, dump contents of /proc/pid/fd directory (i.e. system('ls -l /proc/pid/fs') or execv).
with these informations @ hand can find caused crash, files opened , if crash , file descriptor leak connected.
Comments
Post a Comment