How to debug networking codes?

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


Hello,

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:
EAX 340012E7 EBX=384 ECX=FFFFFFFF EX=0
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 (http://www.slac.stanford.edu/~strauman/rtems/gdb/index.html) 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: <http://lists.rtems.org/pipermail/users/attachments/20070822/bc7710c4/attachment.html>


More information about the users mailing list