lkcd
[Top] [All Lists]

Re: lkcd with modules

To: Sushil <sushil@xxxxxxxxxxx>
Subject: Re: lkcd with modules
From: "Matt D. Robinson" <yakker@xxxxxxxxxxxxxx>
Date: Tue, 19 Sep 2000 11:06:33 -0700
Cc: lkcd@xxxxxxxxxxx
Organization: Alacritech, Inc.
References: <Pine.LNX.4.21.0009180520210.1087-100000@fs4.vxindia.veritas.com>
Sender: owner-lkcd@xxxxxxxxxxx
Sushil wrote:
> Hi,
> 
>      I am using lkcd with 2.4.0-test7 kernel using the latest lkcd
> patch for 2.4.0-test7.
> 
>      Is it possible to use lkcd for debugging modules? Specifically,
> is it possible to -
> 
> 1. get trace of a process which was executing a function from
>         a dynamically loaded module at the time of crash?

Currently there's no mechanism for dumping out stack traces into
modules.  This is something that still has to be done.  We realize
it is a big hole in lcrash at this point, but other priorities,
such as working with IA64, have taken precedence.

> 2. get the disassembly of a function from a dynamically loaded
>         module whose pages are in the lkcd dump?

Same issue.  Disassembly works if it knows where to read the
instructions from.

> assuming that the virtual addresses of module symbols are available
> (using insmod -m) and are integrated with System.map and are
> supplied to lcrash.
> 
> Using lcrash I am not able to do the above two things and
> to me it seems impossible because lcrash converts
> the virtual addresses to physical addresses by subtracting
> the PAGE_OFFSET (= 0xc0000000) from the virtual address
> 
> (kl_virtop function in lib/libklib/arch/i386/kl_mem.c).
> 
> kl_virtop(kaddr_t vaddr, void *m)
> {
> 
>         . . .
> 
>         } else if (vaddr >= KL_PAGE_OFFSET) {
>                 paddr = (vaddr - KL_PAGE_OFFSET);
> 
>         . . .
> 
> }
> 
> This works fine with statically compiled kernel symbols but
> does not work with modules because module symbols are assigned
> virtual addresses much above the (PAGE_OFFSET + total_ram)
> mark (using __vmalloc) and therefore virtual_address - PAGE_OFFSET
> will not give the correct physical addresses for the virtual
> addresses corresponding to module symbols.

Right.

> For example:
>     In my case a module was assigned virtual addresses starting
> from 0xc8829060. I have 128 MB of ram.
> But (0xc8829060 - 0xc0000000) gives a starting physical address
> of 142774368 for the module which is around 136 MB which is greater
> than the total ram (128 MB). When lcrash tries to read this address
> in the saved crash dump or in the online /dev/mem, it gets error because
> that offset does not exist in the ram.
> 
> Is there a way to use lkcd with modules?

Again, not currently.  It's something that we know we have to do,
but we're trying to finalize how to get our stuff into the kernel
(the right way this time) and then we can attack that problem.
Keith Owens has already spoken to us about helping to get this
to work (even if it is just a pointer to some code he's written).

--Matt

<Prev in Thread] Current Thread [Next in Thread>