Project

General

Profile

Actions

Bug #911

open

kldload/kernel linker can exceed malloc reserve and panic system

Added by corecode almost 17 years ago. Updated over 3 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
Kernel
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

hey,

I just booted with hw.physmem=64m and got a panic when trying to load a module:

panic: kld: malloc limit exceeded

(kgdb) bt
#0 dumpsys () at thread.h:83
#1 0xc018450c in boot (howto=256) at /usr/build/src/sys/kern/kern_shutdown.c:375
#2 0xc0184661 in panic (fmt=Variable "fmt" is not available.
) at /usr/build/src/sys/kern/kern_shutdown.c:800
#3 0xc0182129 in kmalloc (size=78, type=0xc02f5600, flags=2)
at /usr/build/src/sys/kern/kern_slaballoc.c:445
#4 0xc01678b4 in linker_make_file (pathname=0xc641b000 "./nvidia.ko", priv=0xc63ea028,
ops=0xc02f5bc8) at /usr/build/src/sys/kern/kern_linker.c:369
#5 0xc016a773 in link_elf_load_module (filename=0xc641b000 "./nvidia.ko", result=0xc83efc7c)
at /usr/build/src/sys/kern/link_elf.c:604
#6 0xc01684e0 in linker_load_file (filename=0xc641b000 "./nvidia.ko", result=0xc83efca8)
at /usr/build/src/sys/kern/kern_linker.c:272
#7 0xc016871c in sys_kldload (uap=0xc83efcf0) at /usr/build/src/sys/kern/kern_linker.c:724

the problem seems to be that M_LINKER already used 10% of all memory (allegedly). In this case kmalloc() simply panics if passing M_WAITOK without M_NULLOK. This is quite unfortunate. Shouldn't we try to stay alive and print a warning and block, hoping that the problem will resolve itself?

cheers
simon


Files

64MB_X64.jpg (8.83 KB) 64MB_X64.jpg tuxillo, 02/24/2014 02:25 PM
Actions

Also available in: Atom PDF