How to debug networking codes?

Rahman, Md S. sazzad at
Wed Aug 22 15:13:30 UTC 2007


I have been porting SCTP(Stream Control Transmission Protocol) in RTEMS from FreeBSD. This is a transport layer protocol and resides with TCP/UDP networking codes in kernel. I am mostly done with this port  and a number of SCTP socket API's like socket, listen, bind, accept, connect etc. works fine.

However, I am now encountering some exception problems while establishing SCTP connection between RTEMS SCTP endpoint with FreeBSD SCTP endpoint via internet. The console shows:

Exception 6 caught at PC 191864 by Thread 167831697
Processor execution context at time of the fault was:
ESI=0 EDI=0 EBP=195838 ESP=195804
Error code pushed by processor itself (if not 0) = 0
Faulty Thread will be deleted

I tried to debug this problem by adding printf in codes but was not able to detect the exact statement which causes this exception. Then I have built RTEMS_GDB_Stub_1.4 ( for remote debugging and built my RTEMS SCTP application with librtems-gdb-stub.a library. At this point, running the RTEMS application crashes with:

GDB Agent: Exception (SIGILL) caught; Task 0xA010001 Killed (Suspended) -use GDB
Exception Vector #0x6; Registers:

To investigate further with breakpoints, I have configured gdb6.6 patched with RTEMS_GDB_Stub_1.4  in the host machine FC5. This works fine and any break point in RTEMS application in init.c could be reachable by the host gdb. However, when I try to reach a breakpoint in SCTP code which resides in cpukit/libnetworking/netinet, host gdb loses connection with the target machine and target application dies.

In this point, I am not sure how should I proceed to solve this problem.
I would appreciate any suggestion in this regard.

Best Regards,
Md Sazzadur Rahman
Graduate Student,
School of Computer Science,
University of Oklahoma,
Norman, Oklahoma, USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list