-
Notifications
You must be signed in to change notification settings - Fork 15
Debugging a Segfault
Domenico Rotiroti edited this page Dec 1, 2013
·
2 revisions
If boxfs crash in a reproducible way, you can help me find and fix the bug enabling debugging symbols and reproducing the crash in a debugger. I'll show you how to do it.
Go to the sources directory and run
make clean
export CFLAGS=-g
make
When you mount a FUSE filesystem, the library do a fork and exit to terminate the main process, so SEGFAULTs in the initialization code are to be debugged differently from ones in other parts of the code (when the filesystem is mounted).
- Run
gdb boxfs, then at the gdb prompt type `run -f <my_conf_file>'. - Make it crash
- Type
whereto get a stack trace - Send me the output
- Run boxfs with your usual args (for instance,
boxfs -f <my_conf_file>) - When the filesystem is mounted, run
ps axw | grep boxfsand find the PID of the boxfs process - Run
gdb boxfs <PIDusing the PID found at (2) - At the gdb prompt type 'c' to resume boxfs
- Make it crash
- Type
whereto get a stack trace - Send me the output