Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Oct 2003 17:18:48 +0100
From:      Miguel Mendez <flynn@energyhq.es.eu.org>
To:        freebsd-current@freebsd.org
Subject:   Instant panic when trying to unload nvidia.ko
Message-ID:  <20031028171848.22479f2e.flynn@energyhq.es.eu.org>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hi,

I'm running -CURRENT from yesterday. In a futile attempt to make some
use of my rusty RivaTNT card, I installed the nvidia kernel port, but it
seems to be doing some weird stuff with memory. This appeared in the
messages log:

...
Oct 28 16:04:33 scienide kernel: malloc() of "32" with the following
non-sleepable locks held:
Oct 28 16:04:33 scienide kernel: exclusive sleep mutex dev.mtx_api r = 0
(0xc39d478c) locked @
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86-1.0-4365/src/nvidi
a_subr.c:753
Oct 28 16:04:33 scienide kernel: malloc() of "32" with the following
non-sleepable locks held:
Oct 28 16:04:33 scienide kernel: exclusive sleep mutex dev.mtx_api r = 0
(0xc39d478c) locked @
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86-1.0-4365/src/nvidi
a_subr.c:753
Oct 28 16:04:33 scienide kernel: malloc() of "4096" with the following
non-sleepable locks held:
Oct 28 16:04:33 scienide kernel: exclusive sleep mutex dev.mtx_api r = 0
(0xc39d478c) locked @
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86-1.0-4365/src/nvidi
a_subr.c:753
...

And now, the fun part. After booting, if I try to unload the module I
get the attached panic. I know the nvidia kernel is proprietary code and
yada yada, but the problem seems to be in the open source part of the
code, so I have some hope I can get to fix it with a little help :-)


Cheers,
-- 
	Miguel Mendez <flynn@energyhq.es.eu.org>
	http://www.energyhq.es.eu.org

[-- Attachment #2 --]
Script started on Tue Oct 28 17:16:08 2003
GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-undermydesk-freebsd"...
panic: malloc(9)/free(9) confusion.
Probably freeing with wrong type, but maybe not here.
panic messages:
---
panic: malloc(9)/free(9) confusion.
Probably freeing with wrong type, but maybe not here.
cpuid = 0; lapic.id = 00000000
panic: from debugger
cpuid = 0; lapic.id = 00000000
boot() called on cpu#0
Uptime: 53s
Dumping 383 MB
 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256 272 288 304 320 336 352 368
---
Reading symbols from /boot/kernel/nvidia.ko...done.
Loaded symbols for /boot/kernel/nvidia.ko
Reading symbols from /usr/obj/usr/src/sys/SCIENIDE/modules/usr/src/sys/modules/linux/linux.ko.debug...done.
Loaded symbols for /usr/obj/usr/src/sys/SCIENIDE/modules/usr/src/sys/modules/linux/linux.ko.debug
Reading symbols from /usr/obj/usr/src/sys/SCIENIDE/modules/usr/src/sys/modules/acpi/acpi.ko.debug...done.
Loaded symbols for /usr/obj/usr/src/sys/SCIENIDE/modules/usr/src/sys/modules/acpi/acpi.ko.debug
Reading symbols from /boot/kernel/geom_ccd.ko...done.
Loaded symbols for /boot/kernel/geom_ccd.ko
#0  doadump () at /usr/src/sys/kern/kern_shutdown.c:240
240		dumping++;
(kgdb) br t
#0  doadump () at /usr/src/sys/kern/kern_shutdown.c:240
#1  0xc0525380 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:372
#2  0xc0525786 in panic () at /usr/src/sys/kern/kern_shutdown.c:550
#3  0xc0451c52 in db_panic () at /usr/src/sys/ddb/db_command.c:450
#4  0xc0451bb2 in db_command (last_cmdp=0xc072f3a0, cmd_table=0x0, aux_cmd_tablep=0xc06e53a0, 
    aux_cmd_tablep_end=0xc06e53a4) at /usr/src/sys/ddb/db_command.c:346
#5  0xc0451cf5 in db_command_loop () at /usr/src/sys/ddb/db_command.c:472
#6  0xc0454cf5 in db_trap (type=3, code=0) at /usr/src/sys/ddb/db_trap.c:73
#7  0xc066d60c in kdb_trap (type=3, code=0, regs=0xd868daf4) at /usr/src/sys/i386/i386/db_interface.c:171
#8  0xc068674a in trap (frame=
      {tf_fs = -1066663912, tf_es = 16, tf_ds = -1066663920, tf_edi = -1066635639, tf_esi = 1, tf_ebp = -664216768, tf_isp = -664216800, tf_ebx = 0, tf_edx = 0, tf_ecx = 32, tf_eax = 18, tf_trapno = 3, tf_err = 0, tf_eip = -1067001579, tf_cs = 8, tf_eflags = 642, tf_esp = -1066541105, tf_ss = -1066629626})
    at /usr/src/sys/i386/i386/trap.c:579
#9  0xc066f008 in calltrap () at {standard input}:103
#10 0xc052571f in panic (fmt=0xc06c6e89 "malloc(9)/free(9) confusion.\n%s")
    at /usr/src/sys/kern/kern_shutdown.c:534
#11 0xc0519dd0 in free (addr=0xc19bb980, type=0xc09b5260) at /usr/src/sys/kern/kern_malloc.c:338
#12 0xc0984eb9 in os_free_mem () from /boot/kernel/nvidia.ko
#13 0xc0864822 in __nvsym00022 () from /boot/kernel/nvidia.ko
#14 0xc08657d7 in __nvsym00638 () from /boot/kernel/nvidia.ko
#15 0xc08659ee in __nvsym00678 () from /boot/kernel/nvidia.ko
#16 0xc08660b1 in __nvsym00723 () from /boot/kernel/nvidia.ko
#17 0xc08678bb in rm_shutdown_rm () from /boot/kernel/nvidia.ko
#18 0xc098677d in nvidia_modevent () from /boot/kernel/nvidia.ko
#19 0xc053f8e0 in driver_module_handler (mod=0xc19bee80, what=1, arg=0xc09b53f8)
    at /usr/src/sys/kern/subr_bus.c:2397
#20 0xc051af4e in module_unload (mod=0x0) at /usr/src/sys/kern/kern_module.c:221
#21 0xc0515901 in linker_file_unload (file=0xc09b53f8) at /usr/src/sys/kern/kern_linker.c:502
#22 0xc051624b in kldunload (td=0xc19dee00, uap=0x0) at /usr/src/sys/kern/kern_linker.c:813
#23 0xc0687110 in syscall (frame=
      {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = -1077936862, tf_esi = -1077937080, tf_ebp = -1077937124, tf_isp = -664216204, tf_ebx = 0, tf_edx = 134577752, tf_ecx = 0, tf_eax = 305, tf_trapno = 12, tf_err = 2, tf_eip = 134514295, tf_cs = 31, tf_eflags = 582, tf_esp = -1077938244, tf_ss = 47})
    at /usr/src/sys/i386/i386/trap.c:1009
#24 0xc066f05d in Xint0x80_syscall () at {standard input}:145
---Can't read userspace from dump, or kernel process---

(kgdb) q

Script done on Tue Oct 28 17:16:15 2003
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031028171848.22479f2e.flynn>