1. Set the limit of coredumps to really huge so that they are allways produced, in the terminal window, type:
ulimit -c 100000
2. add “-g” to the CFLAGS in the Makefile so that debugging is enabled. Run make clean and then make.
3.When a segmentation fault occurs, type: “gdb -c core“, then in gdb tell it that you want to load symbols from the ns executable with “file ns“,and then you can inspect the stack (“bt“), select a stack frame (“select 0“) and inspect the values of variables in that stack frame.
Ref. http://article.gmane.org/gmane.network.simulator.isi/2766/match=segmentation
Advertisement