Thursday, October 7, 2010

Debugging ns-2

Enable gdb debugging
./configure --enable-debug
make clean
make
 
Note: After you have done that, the Makefile is initialized again and loose all your changes to Makefile if your did some.


When ns-2 crashes, here are some possible places to check for any causes of errors:
  1. Scheduler: Event UID not valid!. This is probably associated with timers. If a timer has been called to start again before it expires...
  2. Segmentation fault. A pointer goes to a wrong place. A pointer is out of bound. Or null pointer value.
  3. No obvious cause of fault. Program stopped in a place that no obvious coding errors can be found. Try "make clean + make". Sometimes, if *.h file is changed, the cross-included header files needs to be re-compiled into the final program.
Refer to another article: http://wmlab.csie.ncu.edu.tw/~youngway/MTdata/archives/000104.html

No comments: