lkcd
[Top] [All Lists]

lkcd with modules

To: lkcd@xxxxxxxxxxx
Subject: lkcd with modules
From: Sushil <sushil@xxxxxxxxxxx>
Date: Mon, 18 Sep 2000 05:28:13 +0530 (IST)
Sender: owner-lkcd@xxxxxxxxxxx
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?

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

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.

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? 

I read the following mail from the Nov. 1999 lkcd mailing-list archive
and it seems somebody is working on using lkcd with modules.

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