WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Xen

xen-devel

[Top] [All Lists]

Re: [Xen-devel] help on debugging kernel module in Xen

To: ushuanglily@xxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] help on debugging kernel module in Xen
From: "Lily Huang" <ushuanglily@xxxxxxxxx>
Date: 2007年1月12日 18:04:51 -0500
Delivery-date: 2007年1月12日 15:04:35 -0800
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=MHV4Q25FimoAoM3EyJ1YluX19yisucFeMUTVyi4pKfa+hJE+cd7z+3nHB7NaGPD0dxM4qfODMAY5uqsdk+tEiuldwsuBs/PVpn20wkq0yKJLN+04nVL5kFQGWJovpNao1UgwL2CRZecflbOfqt+c35wepayWCjpEJZUhodSJpgs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070112214118.GF4982@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4d616cca0701121041n62b8ad05k7996ffe125c43043@xxxxxxxxxxxxxx> <20070112192049.GA4982@xxxxxxxxxxxxxxxxx> <4d616cca0701121225p1018056ar24541c3a27c57518@xxxxxxxxxxxxxx> <20070112205358.GC4982@xxxxxxxxxxxxxxxxx> <4d616cca0701121307p67b8235bxb16689093b791976@xxxxxxxxxxxxxx> <4d616cca0701121310u7d26b2e5wf874699ac9dedeca@xxxxxxxxxxxxxx> <20070112212645.GE4982@xxxxxxxxxxxxxxxxx> <4d616cca0701121332p5787be2erc1a003d4e6e4e55c@xxxxxxxxxxxxxx> <20070112214118.GF4982@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
That's a great point. I just disabled the "Detect Soft Lockup" option in the "kernel hacking" group. Now the soft lockup disappeared and I can debug kernel now.

Next, I tried to debug kernel module in domU. New problem occurs.

After I set "br xxx(function in a loaded kernel module" and then "cont", I worked in the domu to activate the breakpoint.

Unfortunately, I found domU immediately print error messages:

/**********************************************************/
Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: int3: 0000 [#1] <----------------------------------------------------- seems to be a problem

Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: SMP

Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: CPU: 0

Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: EIP is at nfs3_proc_readdir+0xd/0x100 [nfs]

Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: eax: daa0c740 ebx: 00001000 ecx: c1353aa0 edx: db25cd14

Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: esi: df02ced0 edi: daa0885c ebp: da9c7d34 esp: da9c7c4c

Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: ds: 007b es: 007b ss: 0069

Message from syslogd@normal at Fri Jan 12 17:54:41 2007 ...
normal kernel: Process ls (pid: 1670, threadinfo=da9c6000 task=c05d7070)
/**********************************************************/

Looks like "int 3" triggered kernel error. Why just for kernel module debugging?


BTW: I built the kernel moduel with "-g" option and use gdb command to load module symbols

/*************************************************/
add-symbol-file /path/to/module.ko 0xdf01f000 \
-s .altinstr_replacement 0xdf036629 \
-s .altinstructions 0xdf03add0 \
-s .bss 0xdf042a60 \
-s .data 0xdf041a20 \
-s .exit.text 0xdf0365f0 \
-s .gnu.linkonce.this_module 0xdf042840 \
-s .init.text 0xdf045000 \
-s .rodata 0xdf036680 \
-s .rodata.str1.1 0xdf039ef4 \
-s .rodata.str1.4 0xdf036cb8 \
-s .strtab 0xdf03e450 \
-s .symtab 0xdf03aec0
/*************************************************/

Thanks,
lily

On 1/12/07, Brendan Cully <brendan@xxxxxxxxx> wrote:
On Friday, 12 January 2007 at 16:32, Lily Huang wrote:
> Hi Brendan,
>
> You are right. After I lift the breakpoint a little bit (to sys_open), the
> breakpoint works.
>
> But now the domU kept complaining after I did "target remote 127.0.0.1:9999"
> and then "br sys_open":
>
> /************************************************?
> BUG: soft lockup detected on CPU#0!
>
> Pid: 0, comm: swapper
> EIP: 0061:[<c01013a7>] CPU: 0
> EIP is at 0xc01013a7
> EFLAGS: 00000346 Not tainted (2.6.16.33-xenU #12)
> EAX: 00000000 EBX: 00000001 ECX: 00000000 EDX: 00000000
> ESI: 00000001 EDI: c0354000 EBP: c0355f84 DS: 007b ES: 007b
> CR0: 8005003b CR2: b7f77000 CR3: 1d633000 CR4: 00000640
> [<c0105bb3>] show_trace+0x13/0x20
> [<c0103390>] show_regs+0x190/0x1e0
> [<c013cf48>] softlockup_tick+0x88/0xa0
> [<c0126d45>] do_timer+0x215/0x440
> [<c010858c>] timer_interrupt+0x1bc/0x6a0
> [<c013d09f>] handle_IRQ_event+0x3f/0xd0
> [<c013d1be>] __do_IRQ+0x8e/0xf0
> [<c0106efd>] do_IRQ+0x1d/0x30
> [<c025d2d1>] evtchn_do_upcall+0xa1/0xe0
> [<c0105309>] hypervisor_callback+0x3d/0x48
> [<c01039df>] xen_idle+0x2f/0x60
> [<c0103a82>] cpu_idle+0x72/0xc0
> [<c0102035>] rest_init+0x35/0x40
> [<c035656a>] start_kernel+0x2ea/0x3a0
> [<c010006f>] 0xc010006f
>
> /********************************************************/
>
> What's wrong? Looks like I am really doomed to run into so many weird
> problems. :(

soft lockup gets triggered when the kernel hasn't gotten a timer
interrupt in a while. This tends to happen frequently when the kernel
is being debugged. I think there's a kernel config option to turn this
off, or you can just live with the messages.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: Re: [Xen-devel] help on debugging kernel module in Xen , Brendan Cully
Next by Date: [Xen-devel] [PATCH 1 of 5] Advertise resumability feature in guest kernel , Brendan Cully
Previous by Thread: Re: [Xen-devel] help on debugging kernel module in Xen , Brendan Cully
Next by Thread: Re: [Xen-devel] help on debugging kernel module in Xen , Lily Huang
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /