LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-03-2012, 05:04 AM   #1
fatenever
LQ Newbie
 
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
kernel panic caused by unaligned address 2.6.36.4


Hi,all,

I have a problem with linux kernel 2.6.36.4.

When I use SSL to transmit data, a kernel panic is occured.

So, I add some log to find what is happened. I find out, skb is not aligned.

The log code is added in function tcp_transmit_skb, listed as follows:
/* Build TCP header and checksum it. */
th = tcp_hdr(skb);
th->source = inet->inet_sport;
th->dest = inet->inet_dport;
if ((((u_int32_t)(&(th->seq))) & 0x3) || (((u_int32_t)(&(tcb->seq))) & 0x3))
{
printk(KERN_ERR"\n th->source %u, th->dest %u, th %p tcb %p", ntohs(th->source), ntohs(th->dest), th, tcb);
printk(KERN_ERR"\n skb->len %u, skb->data_len %u, skb->hdr_len %u", skb->len, skb->data_len, skb->hdr_len);
}
th->seq = htonl(tcb->seq);
th->ack_seq = htonl(tp->rcv_nxt);


The log is listed as follows:

2012 Jul 29 14:44:04 localhost th->source 38249, th->dest 40001, th d9254912 tcb c7313d40
2012 Jul 29 14:44:04 localhost
2012 Jul 29 14:44:04 localhost skb->len 69, skb->data_len 0, skb->hdr_len 306
2012 Jul 29 14:44:04 localhost Kernel took bad trap 15 at PC 0xfd1c69b8
2012 Jul 29 14:44:04 localhost
2012 Jul 29 14:44:04 localhost Pid: 0, comm: swapper, CPU: 1
2012 Jul 29 14:44:04 localhost r0 : 0xd9254916 r1 : 0xc88182a0 r2 : 0xcd19fc54 r3 : 0xcd19fc44
2012 Jul 29 14:44:04 localhost r4 : 0xcd19fbc8 r5 : 0xcd19fc5c r6 : 0xcd19fbdc r7 : 0xcd19fc58
2012 Jul 29 14:44:04 localhost r8 : 0xcd19fc6c r9 : 0xcd19fbe8 r10: 0xd925491a r11: 0x000c0400
2012 Jul 29 14:44:04 localhost r12: 0x00011700 r13: 0x00000008 r14: 0xaccce6db r15: 0xdbe6ccac
2012 Jul 29 14:44:04 localhost r16: 0xc7313d54 r17: 0xf7020044 r18: 0xf7020040 r19: 0xc0ee0040
2012 Jul 29 14:44:04 localhost r20: 0xcd19fbd4 r21: 0xcd19fc48 r22: 0xcd19fbb4 r23: 0xcd19fc3c
2012 Jul 29 14:44:04 localhost r24: 0xcd19fc60 r25: 0xc7313d60 r26: 0xcd19fbcc r27: 0xc0ee0000
2012 Jul 29 14:44:04 localhost r28: 0xcd19fc38 r29: 0xcd19fcb8 r30: 0xc8817fc0 r31: 0xc7313d28
2012 Jul 29 14:44:04 localhost r32: 0xd9254912 r33: 0xc7313d40 r34: 0x00000020 r35: 0xd9254914
2012 Jul 29 14:44:04 localhost r36: 0xc7313da8 r37: 0xc7313d90 r38: 0xc88183e4 r39: 0xc881806c
2012 Jul 29 14:44:04 localhost r40: 0xc8818068 r41: 0xc881808c r42: 0x00000025 r43: 0x00000019
2012 Jul 29 14:44:04 localhost r44: 0xc7313cb8 r45: 0x00000000 r46: 0xdbe6ccd1 r47: 0xdbe6ccac
2012 Jul 29 14:44:04 localhost r48: 0xdbe6ccd2 r49: 0xc88182b0 r50: 0xc7313cb0 r51: 0xc88182e8
2012 Jul 29 14:44:05 localhost r52: 0xc7313cd4 tp : 0x36140000 sp : 0xcd19fcb8 lr : 0xfd1c6998
2012 Jul 29 14:44:05 localhost pc : 0xfd1c69b8 ex1: 1 faultnum: 15
2012 Jul 29 14:44:05 localhost
2012 Jul 29 14:44:05 localhost Starting stack dump of tid 0, pid 0 (swapper) on cpu 1 at cycle 160124655871923
2012 Jul 29 14:44:05 localhost frame 0: 0xfd1c69b8 tcp_transmit_skb+0x338/0xfc8 (sp 0xcd19fcb8)
2012 Jul 29 14:44:05 localhost frame 1: 0xfd1daa80 tcp_retransmit_skb+0x558/0xd20 (sp 0xcd19fcf8)
2012 Jul 29 14:44:05 localhost frame 2: 0xfd205160 tcp_retransmit_timer+0x6a8/0xa28 (sp 0xcd19fd80)
2012 Jul 29 14:44:05 localhost frame 3: 0xfd3afac0 tcp_write_timer.cold+0x1e8/0x1f8 (sp 0xcd19fd98)
2012 Jul 29 14:44:05 localhost frame 4: 0xfd4c3ea8 run_timer_softirq.cold+0x8/0x80 (sp 0xcd19fda8)
2012 Jul 29 14:44:05 localhost frame 5: 0xfd02bfe0 __do_softirq+0x1e0/0x330 (sp 0xcd19fe08)
2012 Jul 29 14:44:05 localhost frame 6: 0xfd031708 do_softirq+0xc8/0x160 (sp 0xcd19fe50)
2012 Jul 29 14:44:05 localhost frame 7: 0xfd02d458 irq_exit+0x98/0x130 (sp 0xcd19fe60)
2012 Jul 29 14:44:05 localhost frame 8: 0xfd031cc0 do_timer_interrupt+0xc0/0xf8 (sp 0xcd19fe68)
2012 Jul 29 14:44:05 localhost frame 9: 0xfd33dce8 handle_interrupt+0x2d8/0x2e0 (sp 0xcd19fe80)
2012 Jul 29 14:44:05 localhost <interrupt 25 while in kernel mode>
2012 Jul 29 14:44:05 localhost frame 10: 0xfd4d60f8 _cpu_idle_nap+0x0/0x10 (sp 0xcd19ffd0)
2012 Jul 29 14:44:05 localhost frame 11: 0xfd063060 cpu_idle+0x1a0/0x3b8 (sp 0xcd19ffd0)
2012 Jul 29 14:44:05 localhost Stack dump complete
2012 Jul 29 14:44:05 localhost Kernel panic - not syncing: Aiee, killing interrupt handler!
2012 Jul 29 14:44:05 localhost
2012 Jul 29 14:44:05 localhost Starting stack dump of tid 0, pid 0 (swapper) on cpu 1 at cycle 160124862415349
2012 Jul 29 14:44:05 localhost frame 0: 0xfd4f13c0 dump_stack+0x0/0x20 (sp 0xcd19fa00)
2012 Jul 29 14:44:05 localhost frame 1: 0xfd30efc8 panic+0x118/0x358 (sp 0xcd19fa00)
2012 Jul 29 14:44:05 localhost frame 2: 0xfd2d5d98 do_exit.cold+0x168/0x410 (sp 0xcd19fa50)
2012 Jul 29 14:44:05 localhost frame 3: 0xfd252e48 do_trap+0x300/0x6c0 (sp 0xcd19faa0)
2012 Jul 29 14:44:05 localhost frame 4: 0xfd33dce8 handle_interrupt+0x2d8/0x2e0 (sp 0xcd19fb40)
2012 Jul 29 14:44:05 localhost <interrupt 15 while in kernel mode>
2012 Jul 29 14:44:05 localhost frame 5: 0xfd1c69b8 tcp_transmit_skb+0x338/0xfc8 (sp 0xcd19fcb8)
2012 Jul 29 14:44:05 localhost frame 6: 0xfd1daa80 tcp_retransmit_skb+0x558/0xd20 (sp 0xcd19fcf8)
2012 Jul 29 14:44:05 localhost frame 7: 0xfd205160 tcp_retransmit_timer+0x6a8/0xa28 (sp 0xcd19fd80)
2012 Jul 29 14:44:05 localhost frame 8: 0xfd3afac0 tcp_write_timer.cold+0x1e8/0x1f8 (sp 0xcd19fd98)
2012 Jul 29 14:44:05 localhost frame 9: 0xfd4c3ea8 run_timer_softirq.cold+0x8/0x80 (sp 0xcd19fda8)
2012 Jul 29 14:44:05 localhost frame 10: 0xfd02bfe0 __do_softirq+0x1e0/0x330 (sp 0xcd19fe08)
2012 Jul 29 14:44:05 localhost frame 11: 0xfd031708 do_softirq+0xc8/0x160 (sp 0xcd19fe50)
2012 Jul 29 14:44:05 localhost frame 12: 0xfd02d458 irq_exit+0x98/0x130 (sp 0xcd19fe60)
2012 Jul 29 14:44:05 localhost frame 13: 0xfd031cc0 do_timer_interrupt+0xc0/0xf8 (sp 0xcd19fe68)
2012 Jul 29 14:44:05 localhost frame 14: 0xfd33dce8 handle_interrupt+0x2d8/0x2e0 (sp 0xcd19fe80)
2012 Jul 29 14:44:05 localhost <interrupt 25 while in kernel mode>
2012 Jul 29 14:44:05 localhost frame 15: 0xfd4d60f8 _cpu_idle_nap+0x0/0x10 (sp 0xcd19ffd0)

From the log, you can see the tcp header pointer named 'th' is
0xd9254912. It is unaligned.

Is there anybody encountered similar problem?

My application is not running in kernel mode.

It uses TUN/TAP to transmit data with another device. And, it uses SSL to transmit upon the tcp.

I don't know how to solve this problem. Who can tell me what I can do for it?

Thanks!
 
Old 08-04-2012, 09:32 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
I suggest that a problem of this sort is "something that should never occur." Therefore, start by doing a clean recompile of your kernel including all modules. Assume, in other words, that "the underlying root cause of whatever-it-is is some kind of bogosity." Not any sort of "real" kernel issue that you actually have to chase down.
 
  


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
Upgrading from 2.6.30.5 to 2.6.37 caused kernel panic galapogos Linux - Kernel 5 02-27-2011 10:12 AM
how to access unaligned address of memory? nesta Programming 2 05-12-2007 11:22 AM
Server frozen, caused by kernel panic? thetawaverider Linux - General 4 02-26-2007 06:26 PM
Partition added in Windows caused kernel panic Rohan_mk1 Linux - Hardware 11 09-04-2006 10:36 AM
Kernel Update Caused Panic, Howto Downgrade hategiants Linux - Software 6 04-22-2006 07:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:39 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