Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -current amd64 diagnostic panic while loading compat_linux32 module twice



On Fri, Feb 20, 2009 at 09:54:41PM +0000, Andrew Doran wrote:
> On Fri, Feb 20, 2009 at 10:28:36PM +0100, Nicolas Joly wrote:
> 
> > I just encountered a reproductible diagnotic kernel panic while trying
> > to load the compat_linux32 module twice on my -current amd64
> > workstation.
> 
> Obviously this should not work, but you are not getting far enough for it
> to not work properly :-)
> 
> > root@lanfeust [~]# modstat | grep linux
> > root@lanfeust [~]# modload compat_linux
> > root@lanfeust [~]# modload compat_linux32
> > root@lanfeust [~]# modstat | grep linux
> > compat_linux    misc    filesys 1       1147014 
> > compat,compat_ossaudio,exec_elf64
> > compat_linux32  misc    filesys 0       1059750 
> > compat_linux,exec_elf32,compat_netbsd32
> > root@lanfeust [~]# modload compat_linux32
> > [...PANIC...]
> > 
> > panic: kernel diagnostic assertion "ch->ch_running > 0" failed: file 
> > "/local/src/NetBSD/src/sys
> > /kern/subr_callback.c", line 96
> > fatal breakpoint trap in supervisor mode
> > trap type 1 code 0 rip ffffffff80237f05 cs 8 rflags 246 cr2  7f7ffd805020 
> > cpl 0 rsp ffff800049f
> > bf630
> > Stopped in pid 549.1 (modload) at       netbsd:breakpoint+0x5:  leave
> > db{1}> bt
> > breakpoint() at netbsd:breakpoint+0x5
> > panic() at netbsd:panic+0x249
> > __kernassert() at netbsd:__kernassert+0x2d
> > callback_run_roundrobin() at netbsd:callback_run_roundrobin+0x13d
> > uvm_map_prepare() at netbsd:uvm_map_prepare+0x178
> > uvm_map() at netbsd:uvm_map+0xd3
> > uvm_km_alloc() at netbsd:uvm_km_alloc+0xb1
> 
> http://nxr.netbsd.org/source/xref/sys/arch/amd64/amd64/machdep.c#362
> 
> Can you try changing uvm_map_setup to uvm_map_setup_kernel and see if that
> helps? If not print the vm_map structure with "show map module_map_store".

Not sure about that change, it doesn't compile. uvm_map_setup() use a
struct vm_map, but uvm_map_setup_kernel() use struct vm_map_kernel
which looks like a different beast ...

db{1}> show map module_map_store
MAP 0xffffffff80c823e0: [0xffffffff810eb000->0xffffffff81400000]
        #ent=1, sz=2211840, ref=1, version=3, flags=0x100
        pmap=0xffffffff80c84820(resident=4149, wired=1641)

> Curious: it looks like module_map is 20MB on amd64 and you are exhausting it
> for some reason. What do objdump -h and size print on the modules you have
> loaded? 

Because all modules are compiled with debugging enabled (just like the
userland), but without debugging symbols removed ?

MKDEBUG=        yes
.if !defined(KERNEL_BUILD)
COPTS+=         -g
STRIPFLAG=      -S -d
.endif

njoly@lanfeust [5.99.7/modules]> ls -l compat_linux*/*.kmod
-r--r--r--  1 root  wheel  2091964 Feb 20 21:56 compat_linux/compat_linux.kmod
-r--r--r--  1 root  wheel  1927797 Feb 20 21:56 
compat_linux32/compat_linux32.kmod
njoly@lanfeust [5.99.7/modules]> size compat_linux*/*.kmod
   text    data     bss     dec     hex filename
  75997    9208       0   85205   14cd5 compat_linux/compat_linux.kmod
  48842    9168       0   58010    e29a compat_linux32/compat_linux32.kmod

objdump -h output attached.

> Do you have a lot of modules loaded?

Only two, compat_linux and compat_linux32, all others are in kernel
for now.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
compat_linux/compat_linux.kmod:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000cb48  0000000000000000  0000000000000000  00000040  2**4
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .eh_frame     00001fc8  0000000000000000  0000000000000000  0000cb88  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  2 .rodata       000026ac  0000000000000000  0000000000000000  0000eb60  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  3 .rodata.str1.8 00000a27  0000000000000000  0000000000000000  00011210  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rodata.str1.1 00000cf2  0000000000000000  0000000000000000  00011c37  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 link_set_modules 00000008  0000000000000000  0000000000000000  00012930  
2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  6 .data         000023f8  0000000000000000  0000000000000000  00012940  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  7 .debug_abbrev 00004d7d  0000000000000000  0000000000000000  00014d38  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_info   00094b34  0000000000000000  0000000000000000  00019ab5  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
  9 .debug_line   000088a2  0000000000000000  0000000000000000  000ae5e9  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
 10 .ident        0000088f  0000000000000000  0000000000000000  000b6e8b  2**0
                  CONTENTS, READONLY
 11 .debug_frame  00001fc8  0000000000000000  0000000000000000  000b7720  2**3
                  CONTENTS, RELOC, READONLY, DEBUGGING
 12 .debug_loc    00011fba  0000000000000000  0000000000000000  000b96e8  2**0
                  CONTENTS, READONLY, DEBUGGING
 13 .debug_pubnames 000016ff  0000000000000000  0000000000000000  000cb6a2  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
 14 .debug_aranges 00000480  0000000000000000  0000000000000000  000ccda1  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
 15 .debug_str    0004a2f5  0000000000000000  0000000000000000  000cd221  2**0
                  CONTENTS, READONLY, DEBUGGING
 16 .debug_ranges 00000bb0  0000000000000000  0000000000000000  00117516  2**0
                  CONTENTS, READONLY, DEBUGGING

compat_linux32/compat_linux32.kmod:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000807b  0000000000000000  0000000000000000  00000040  2**4
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .rodata.str1.1 00000e62  0000000000000000  0000000000000000  000080bb  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .eh_frame     00001708  0000000000000000  0000000000000000  00008f20  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  3 .rodata       00000e9a  0000000000000000  0000000000000000  0000a640  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  4 .rodata.str1.8 00000a43  0000000000000000  0000000000000000  0000b4e0  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 link_set_modules 00000008  0000000000000000  0000000000000000  0000bf28  
2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  6 .data         000023d0  0000000000000000  0000000000000000  0000bf40  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  7 .debug_abbrev 00005055  0000000000000000  0000000000000000  0000e310  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_info   0008f9e0  0000000000000000  0000000000000000  00013365  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
  9 .debug_line   00008d18  0000000000000000  0000000000000000  000a2d45  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
 10 .ident        00000870  0000000000000000  0000000000000000  000aba5d  2**0
                  CONTENTS, READONLY
 11 .debug_frame  00001708  0000000000000000  0000000000000000  000ac2d0  2**3
                  CONTENTS, RELOC, READONLY, DEBUGGING
 12 .debug_loc    0000b29c  0000000000000000  0000000000000000  000ad9d8  2**0
                  CONTENTS, READONLY, DEBUGGING
 13 .debug_pubnames 000011ea  0000000000000000  0000000000000000  000b8c74  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
 14 .debug_aranges 00000540  0000000000000000  0000000000000000  000b9e5e  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
 15 .debug_str    000476b8  0000000000000000  0000000000000000  000ba39e  2**0
                  CONTENTS, READONLY, DEBUGGING
 16 .debug_ranges 00001190  0000000000000000  0000000000000000  00101a56  2**0
                  CONTENTS, READONLY, DEBUGGING


Home | Main Index | Thread Index | Old Index