Bug 20765

Summary: Crash in bdgtakeifaces when performing kldunload if_tap.ko
Product: Base System Reporter: joe <joe>
Component: kernAssignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   

Description joe 2000-08-22 00:20:05 UTC
	My machine crashes when I:

	# kldunload if_tap.ko

	In normal practice this gets tickled when I try and suspend
	the machine.

Fix: 

No fix.

	gdb -k:

genius# gdb -k kernel.debug /var/crash/vmcore.3
GNU gdb 4.18
Copyright 1998 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-unknown-freebsd"...
IdlePTD 3530752
initial pcb at 2cc880
panicstr: from debugger
panic messages:
---
Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x34
fault code              = supervisor read, page not present
instruction pointer     = 0x8:0xc01ac9a7
stack pointer           = 0x10:0xcc825e98
frame pointer           = 0x10:0xcc825eb4
code segment            = base rx0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 3169 (kldunload)
interrupt mask          = net 
panic: from debugger
panic: from debugger
Uptime: 2h44m31s
/dev/vmmon: Module vmmon: unloaded

dumping to dev #ad/0x30001, offset 630912
dump ata0: resetting devices .. done
191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 
---
#0  boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:303
303                     dumppcb.pcb_cr3 = rcr3();
(kgdb) bt
#0  boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:303
#1  0xc016f0f9 in panic (fmt=0xc02577d4 "from debugger")
    at /usr/src/sys/kern/kern_shutdown.c:553
#2  0xc0131121 in db_panic (addr=-1071986265, have_addr=0, count=-1, 
    modif=0xcc825d04 "") at /usr/src/sys/ddb/db_command.c:433
#3  0xc01310c1 in db_command (last_cmdp=0xc0287ef0, cmd_table=0xc0287d50, 
    aux_cmd_tablep=0xc02c691c) at /usr/src/sys/ddb/db_command.c:333
#4  0xc0131186 in db_command_loop () at /usr/src/sys/ddb/db_command.c:455
#5  0xc0133343 in db_trap (type=12, code=0) at /usr/src/sys/ddb/db_trap.c:71
#6  0xc0233e62 in kdb_trap (type=12, code=0, regs=0xcc825e58)
    at /usr/src/sys/i386/i386/db_interface.c:158
#7  0xc023feac in trap_fatal (frame=0xcc825e58, eva=52)
    at /usr/src/sys/i386/i386/trap.c:946
#8  0xc023fb85 in trap_pfault (frame=0xcc825e58, usermode=0, eva=52)
    at /usr/src/sys/i386/i386/trap.c:844
#9  0xc023f6fb in trap (frame={tf_fs = 16, tf_es = -863895536, 
      tf_ds = -1072234480, tf_edi = 0, tf_esi = -1054286120, 
      tf_ebp = -863871308, tf_isp = -863871356, tf_ebx = -1055557504, 
      tf_edx = 0, tf_ecx = 0, tf_eax = 9, tf_trapno = 12, tf_err = 0, 
      tf_eip = -1071986265, tf_cs = 8, tf_eflags = 66199, 
      tf_esp = -1054073344, tf_ss = -1054073344})
    at /usr/src/sys/i386/i386/trap.c:443
#10 0xc01ac9a7 in bdgtakeifaces () at /usr/src/sys/net/bridge.c:474
#11 0xc01af02d in ether_ifdetach (ifp=0xc12c1e00, bpf=1)
    at /usr/src/sys/net/if_ethersubr.c:693
#12 0xc12bc47d in ?? ()
#13 0xc016b4d9 in module_unload (mod=0xc12a6680)
    at /usr/src/sys/kern/kern_module.c:195
#14 0xc0168392 in linker_file_unload (file=0xc12a8900)
    at /usr/src/sys/kern/kern_linker.c:449
#15 0xc0168a65 in kldunload (p=0xcc762380, uap=0xcc825f80)
    at /usr/src/sys/kern/kern_linker.c:747
#16 0xc0240185 in syscall2 (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, 
      tf_edi = 7, tf_esi = -1077936842, tf_ebp = -1077937148, 
      tf_isp = -863871020, tf_ebx = 0, tf_edx = 0, tf_ecx = 134560192, 
      tf_eax = 305, tf_trapno = 12, tf_err = 2, tf_eip = 134514116, 
      tf_cs = 31, tf_eflags = 663, tf_esp = -1077938248, tf_ss = 47})
    at /usr/src/sys/i386/i386/trap.c:1150
#17 0xc02347a5 in Xint0x80_syscall ()
#18 0x8048139 in ?? ()
(kgdb) l /usr/src/sys/net/bridge.c:474
469         *bridge_cfg = '\0';
470     
471         printf("BRIDGE 990810, have %d interfaces\n", if_index);
472         for (i = 0 , ifp = ifnet.tqh_first ; i < if_index ;
473                     i++, ifp = ifp->if_link.tqe_next)
474             if (ifp->if_type == IFT_ETHER) { /* ethernet ? */
475                 bp = &ifp2sc[ifp->if_index] ;
476                 ac = (struct arpcom *)ifp;
477                 sprintf(bridge_cfg + strlen(bridge_cfg),
478                     "%s%d:1,", ifp->if_name, ifp->if_unit);
How-To-Repeat: 
	See above.
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2000-08-22 14:59:41 UTC
Responsible Changed
From-To: freebsd-bugs->nsayer

Over to if_tap maintainer.
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-24 09:48:22 UTC
Responsible Changed
From-To: nsayer->imp

Over to the xe maintainer.
Comment 3 nsayer freebsd_committer freebsd_triage 2000-11-15 15:55:33 UTC
State Changed
From-To: open->closed

So far as I know, this was fixed a while ago, but I didn't know about the PR, 
I guess.