LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-16-2007, 11:43 PM   #1
mapleneckblues
LQ Newbie
 
Registered: Nov 2007
Posts: 3

Rep: Reputation: 0
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.

Last edited by mapleneckblues; 11-16-2007 at 11:48 PM.
 
Old 11-18-2007, 12:54 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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.
 
Old 11-28-2007, 12:33 AM   #3
mapleneckblues
LQ Newbie
 
Registered: Nov 2007
Posts: 3

Original Poster
Rep: Reputation: 0
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. :-).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tcp congestion control jwstric2 Linux - Networking 8 04-19-2005 11:28 AM
Programming - Linux TCP Congestion Control smokey1582 Programming 1 10-22-2004 04:07 PM
Programming - Linux TCP Congestion Control smokey1582 Linux - Software 1 10-21-2004 12:38 PM
Programming - Linux TCP Congestion Control smokey1582 Linux - Networking 0 10-21-2004 12:04 PM
Kernel panic making me panic! Linux_N0oby Linux - Software 19 05-29-2002 12:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration