LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Kernel panic on making changes to congestion control code (https://www.linuxquestions.org/questions/programming-9/kernel-panic-on-making-changes-to-congestion-control-code-600292/)

mapleneckblues 11-16-2007 11:43 PM

Kernel panic on making changes to congestion control code
 
Hi,

Im not sure if this is the right forum for this thread
Sorry if it isn't.

Im trying to make some changes to slow start.
For this i need to have 4 new variables per connection.

I added these members in the tcp_sock structure in tcp.h
Im doing initializations in tcp_ipv4.c and tcp.c and then using
these variables in the slow_start function in tcp_cong.c

This is my first time doing any sort of kernel programming/hacking.

Now when i compile the kernel, it compiles fine. However when i try to boot my system, i get a kernel panic in tcp_v4_destroy_sock and tcp_v6_destroy sock. I am not sure if its because i added new members to the tcp_sock structure since i dont have issues if i remove all my other code changes except for the member declarations in tcp.h for tcp_sock.

I am not sure what the issue is or how to go about debugging it.

Im working on the 2.6.22 kernel.

Any help would be much appreciated.

Thanks !
-A.

Mara 11-18-2007 12:54 PM

It is possible to get such an effect this way. There's casting between struct sock and struct tcp_sock. Probably you should see the problem by just looking at the two structures. If not, use tcp_v4_destroy_sock. It's not a very complicated function (tcp_ipv4.c) and you can add your debug inside. It will probbaly crash the first time it's run, so the amount of debug is not important - add as much as you want. Print the situation before and after all functions run in tcp_v4_destroy_sock and you should see what's wrong really fast.

mapleneckblues 11-28-2007 12:33 AM

Sorry for the late response and Thanks a lot Mara.

Well actually, I dont really know what caused the issue. Compiling each modified file individually somehow eliminated the problem. Whats even stranger is that now if I modify any file and compile it or even do a make clean and recompile the kernel, i dont seem to face any issues.

However, I did figure out that the tcp_sock structure provides for some private space for each pluggable module. I ended up using that even though my modifications were to the common to all slow start code which is built in. :-).


All times are GMT -5. The time now is 12:46 PM.