Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Apr 2018 00:30:10 -0400
From:      Farhan Khan <khanzf@gmail.com>
To:        freebsd-wireless@freebsd.org
Subject:   rtwn(4) crash dump and kgdb output
Message-ID:  <CAFd4kYBS4a4-Jj79t9Ee3ufbDzFwtHk1SRkCE%2B6WL25RtCqM%2BA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi all,

I discussed this in the IRC channel but I was not certain what the actual
issue may be.


When I load the firmware, unload the driver, and reload it, in part of the
process I clear a register bit, then set it. When I set it again, it causes
the kernel to panic. I am not certain what is causing this. The following
is my kgdb output. I see the error message "Fatal trap 9: general
protection fault while in kernel mode", but I do not see where or why.
Anyone have any suggestions on how I could continue to identify the issue?

Thanks,

------------
# sudo kgdb /usr/lib/debug//boot/kernel/kernel.debug /var/crash/vmcore.last
GNU gdb (GDB) 8.1 [GDB v8.1 for FreeBSD]
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd12.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug...done.

Unread portion of the kernel message buffer:
kernel trap 9 with interrupts disabled


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff80ae16f0
stack pointer            = 0x28:0xfffffe00259ca850
frame pointer            = 0x28:0xfffffe00259ca8c0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 11 (idle: cpu0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1524097207
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
0xfffffe00259ca560
vpanic() at vpanic+0x18d/frame 0xfffffe00259ca5c0
panic() at panic+0x43/frame 0xfffffe00259ca620
trap_fatal() at trap_fatal+0x352/frame 0xfffffe00259ca670
trap() at trap+0x6d/frame 0xfffffe00259ca780
calltrap() at calltrap+0x8/frame 0xfffffe00259ca780
--- trap 0x9, rip = 0xffffffff80ae16f0, rsp = 0xfffffe00259ca850, rbp =
0xfffffe00259ca8c0 ---
callout_process() at callout_process+0x120/frame 0xfffffe00259ca8c0
handleevents() at handleevents+0x1a5/frame 0xfffffe00259ca900
timercb() at timercb+0x254/frame 0xfffffe00259ca950
lapic_handle_timer() at lapic_handle_timer+0xa7/frame 0xfffffe00259ca990
timerint_u() at timerint_u+0x96/frame 0xfffffe00259caaa0
cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe00259caac0
cpu_idle() at cpu_idle+0x8f/frame 0xfffffe00259caae0
sched_idletd() at sched_idletd+0x40a/frame 0xfffffe00259cabb0
fork_exit() at fork_exit+0x84/frame 0xfffffe00259cabf0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00259cabf0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
Uptime: 5m36s
Dumping 436 out of 3952 MB:..4%..12%..23%..34%..41%..52%..63%..74%..81%..92%

__curthread () at ./machine/pcpu.h:230
230    ./machine/pcpu.h: No such file or directory.
(kgdb) bt
#0  __curthread () at ./machine/pcpu.h:230
#1  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:347
#2  0xffffffff80ac9312 in kern_reboot (howto=260) at
/usr/src/sys/kern/kern_shutdown.c:416
#3  0xffffffff80ac98dd in vpanic (fmt=<optimized out>,
ap=0xfffffe00259ca600) at /usr/src/sys/kern/kern_shutdown.c:812
#4  0xffffffff80ac9923 in panic (fmt=<unavailable>) at
/usr/src/sys/kern/kern_shutdown.c:739
#5  0xffffffff80f7deb2 in trap_fatal (frame=0xfffffe00259ca790, eva=0) at
/usr/src/sys/amd64/amd64/trap.c:819
#6  0xffffffff80f7d48d in trap (frame=0xfffffe00259ca790) at
/usr/src/sys/amd64/amd64/trap.c:199
#7  <signal handler called>
#8  callout_process (now=1442651863143) at
/usr/src/sys/kern/kern_timeout.c:488
#9  0xffffffff810ad265 in handleevents (now=1442651863143, fake=0) at
/usr/src/sys/kern/kern_clocksource.c:213
#10 0xffffffff810ad964 in timercb (et=0xffffffff81d07208 <lapic_et>,
arg=<optimized out>) at /usr/src/sys/kern/kern_clocksource.c:353
#11 0xffffffff810eb9f7 in lapic_handle_timer (frame=0xfffffe00259ca9a0) at
/usr/src/sys/x86/x86/local_apic.c:1305
#12 0xffffffff80f5b6f0 in timerint_u () at
/usr/src/sys/amd64/amd64/apic_vector.S:132
#13 0x0000000000000000 in ?? ()
------------

--
Farhan Khan
PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFd4kYBS4a4-Jj79t9Ee3ufbDzFwtHk1SRkCE%2B6WL25RtCqM%2BA>