Scott Sewall
2004-Dec-15 12:40 UTC
4.10 kernel panic: Fatal trap 12: page fault while in kernel mode
I'm running FreeBSD 4.10-RELEASE-p3 that occasionally panics. The panic occurs seems to happen when I'm running rsync of large directories possibly in combination with reading or writing to a compact flash attached to USB. I've attached the panic message, dmesg output, and gdb output. If there's any additional informtion I can provide to try and resolve the problem, please ask. I'm willing to put some effort into fixing the problem. Any and all help is greatly appreciated. -- Scott> Fatal trap 12: page fault while in kernel mode > mp_lock = 01000002; cpuid = 1; lapic.id = 01000000 > fault virtual address = 0x70 > fault code = supervisor read, page not present > instruction pointer = 0x8:0xc0172b0c > stack pointer = 0x10:0xffc11cf0 > frame pointer = 0x10:0xffc11d14 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, def32 1, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = Idle > interrupt mask = net tty bio cam <- SMP: XXX > trap number = 12 > panic: page fault > mp_lock = 01000002; cpuid = 1; lapic.id = 01000000 > boot() called on cpu#1> Copyright (c) 1992-2004 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD 4.10-RELEASE-p3 #1: Thu Nov 11 20:54:12 PST 2004 > scott@lilo.redlinenetworks.com:/usr/src/sys/compile/LILO > Timecounter "i8254" frequency 1193182 Hz > CPU: Intel Pentium III (930.39-MHz 686-class CPU) > Origin = "GenuineIntel" Id = 0x686 Stepping = 6 > > Features=0x387fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,PN,MMX,FXSR,SSE> > real memory = 4227858432 (4128768K bytes) > config> di bt0 > No such device: bt0 > Invalid command or syntax. Type `?' for help. > config> di aic0 > No such device: aic0 > Invalid command or syntax. Type `?' for help. > config> di aha0 > No such device: aha0 > Invalid command or syntax. Type `?' for help. > config> di adv0 > No such device: adv0 > Invalid command or syntax. Type `?' for help. > config> q > avail memory = 4119408640 (4022860K bytes) > Programming 16 pins in IOAPIC #0 > IOAPIC #0 intpin 2 -> irq 0 > Programming 16 pins in IOAPIC #1 > FreeBSD/SMP: Multiprocessor motherboard: 2 CPUs > cpu0 (BSP): apic id: 0, version: 0x00040011, at 0xfee00000 > cpu1 (AP): apic id: 1, version: 0x00040011, at 0xfee00000 > io0 (APIC): apic id: 4, version: 0x000f0011, at 0xfec00000 > io1 (APIC): apic id: 5, version: 0x000f0011, at 0xfec01000 > Preloaded elf kernel "kernel" at 0xc03af000. > Preloaded userconfig_script "/boot/kernel.conf" at 0xc03af09c. > Pentium Pro MTRR support enabled > md0: Malloc disk > Using $PIR table, 10 entries at 0xc00f51d0 > npx0: <math processor> on motherboard > npx0: INT 16 interface > pcib0: <ServerWorks NB6635 3.0LE host to PCI bridge> on motherboard > IOAPIC #1 intpin 6 -> irq 2 > IOAPIC #1 intpin 4 -> irq 9 > IOAPIC #1 intpin 5 -> irq 10 > IOAPIC #0 intpin 10 -> irq 11 > pci0: <PCI bus> on pcib0 > pci0: <ATI Mach64-GR graphics accelerator> at 1.0 irq 2 > fxp0: <Intel 82559 Pro/100 Ethernet> port 0xd400-0xd43f mem > 0xfe900000-0xfe9fffff,0xfeafe000-0xfeafefff irq 9 at device 4.0 on pci0 > fxp0: Ethernet address 00:e0:81:02:11:cc > inphy0: <i82555 10/100 media interface> on miibus0 > inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto > fxp1: <Intel 82559 Pro/100 Ethernet> port 0xd000-0xd03f mem > 0xfe700000-0xfe7fffff,0xfeafd000-0xfeafdfff irq 10 at device 5.0 on pci0 > fxp1: Ethernet address 00:e0:81:02:11:cd > inphy1: <i82555 10/100 media interface> on miibus1 > inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto > isab0: <ServerWorks IB6566 PCI to ISA bridge> at device 15.0 on pci0 > isa0: <ISA bus> on isab0 > atapci0: <ServerWorks ROSB4 ATA33 controller> port 0xffa0-0xffaf at > device 15.1 on pci0 > ata0: at 0x1f0 irq 14 on atapci0 > ata1: at 0x170 irq 15 on atapci0 > ohci0: <OHCI (generic) USB controller> mem 0xfeafc000-0xfeafcfff irq > 11 at device 15.2 on pci0 > usb0: OHCI version 1.0, legacy support > usb0: <OHCI (generic) USB controller> on ohci0 > usb0: USB revision 1.0 > uhub0: (0x1166) OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 > uhub0: 4 ports with 4 removable, self powered > umass0: vendor 0x55aa USB 2.0 7-2-2, rev 2.00/2.00, addr 2 > pcib1: <ServerWorks NB6635 3.0LE host to PCI bridge> on motherboard > pci1: <PCI bus> on pcib1 > orm0: <Option ROMs> at iomem > 0xc0000-0xc7fff,0xc8000-0xc8fff,0xc9000-0xc9fff on isa0 > pmtimer0 on isa0 > fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0 > fdc0: FIFO enabled, 8 bytes threshold > fd0: <1440-KB 3.5" drive> on fdc0 drive 0 > atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0 > atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0 > kbd0 at atkbd0 > psm0: <PS/2 Mouse> irq 12 on atkbdc0 > psm0: model IntelliMouse, device ID 3 > vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 > sc0: <System console> at flags 0x100 on isa0 > sc0: VGA <16 virtual consoles, flags=0x300> > sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0 > sio0: type 16550A > sio1 at port 0x2f8-0x2ff irq 3 on isa0 > sio1: type 16550A > ppc0: parallel port not found. > APIC_IO: Testing 8254 interrupt delivery > APIC_IO: Broken MP table detected: 8254 is not connected to IOAPIC #0 > intpin 2 > APIC_IO: routing 8254 via 8259 and IOAPIC #0 intpin 0 > SMP: AP CPU #1 Launched! > ad0: 238475MB <HDS722525VLAT80> [484521/16/63] at ata0-master UDMA33 > ad1: 238475MB <WDC WD2500JB-00GVA0> [484521/16/63] at ata0-slave UDMA33 > acd0: DVD-R <SONY DVD RW DW-U18A> at ata1-master UDMA33 > Mounting root from ufs:/dev/ad0s1a > cd0 at ata1 bus 0 target 0 lun 0 > cd0: <SONY DVD RW DW-U18A UYS1> Removable CD-ROM SCSI-0 device > cd0: 33.000MB/s transfers > cd0: Attempt to query device size failed: NOT READY, Medium not present > da0 at umass-sim0 bus 0 target 0 lun 0 > da0: <OEI-USB2 CompactFlash 2.00> Removable Direct Access SCSI-0 device > da0: 650KB/s transfers > da0: 488MB (1000944 512 byte sectors: 64H 32S/T 488C)> (kgdb) where > #0 0xc016fbfa in dumpsys () > #1 0xc016f9cb in boot () > #2 0xc016fe24 in poweroff_wait () > #3 0xc02a2958 in trap_fatal () > #4 0xc02a25e9 in trap_pfault () > #5 0xc02a2187 in trap () > #6 0xc023bd55 in acquire_lock () > #7 0xc023efe6 in initiate_write_filepage () > #8 0xc023eeb3 in softdep_disk_io_initiation () > #9 0xc01a9d7f in spec_strategy () > #10 0xc01a9815 in spec_vnoperate () > #11 0xc024b5f9 in ufs_vnoperatespec () > #12 0xc024ae89 in ufs_strategy () > #13 0xc024b5c9 in ufs_vnoperate () > #14 0xc0196117 in bwrite () > #15 0xc019bb22 in vop_stdbwrite () > #16 0xc019b949 in vop_defaultop () > #17 0xc024b5c9 in ufs_vnoperate () > #18 0xc0196476 in bawrite () > #19 0xc024486a in ffs_fsync () > #20 0xc024322e in ffs_sync () > #21 0xc01a108f in sync () > #22 0xc016f766 in boot () > #23 0xc016fe24 in poweroff_wait () > #24 0xc02a2958 in trap_fatal () > #25 0xc02a25e9 in trap_pfault () > #26 0xc02a2187 in trap () > #27 0xc0172b0c in tsleep () > #28 0xc024e0e7 in swap_pager_putpages () > #29 0xc024c987 in default_pager_putpages () > #30 0xc02581c7 in vm_pageout_flush () > #31 0xc0257c31 in contigmalloc1 () > #32 0xc0257edb in contigmalloc () > #33 0xc028ce03 in bus_dmamem_alloc () > #34 0xc02647c2 in usb_block_allocmem () > #35 0xc02648b7 in usb_allocmem () > #36 0xc025fed7 in ohci_allocm () > #37 0xc02631df in usbd_transfer () > #38 0xc026a751 in umass_setup_transfer () > #39 0xc026aa60 in umass_bbb_state () > #40 0xc026393f in usb_transfer_complete () > #41 0xc0260413 in ohci_softintr () > #42 0xc0262f57 in usb_schedsoftintr () > #43 0xc0260125 in ohci_intr1 () > #44 0xc025ffc2 in ohci_intr () > #45 0xc029615f in cpu_idle () > (kgdb)
Kris Kennaway
2004-Dec-15 12:49 UTC
4.10 kernel panic: Fatal trap 12: page fault while in kernel mode
On Wed, Dec 15, 2004 at 12:42:25PM -0800, Scott Sewall wrote:> > I'm running FreeBSD 4.10-RELEASE-p3 that occasionally panics. The panic > occurs seems to happen when I'm running rsync of large directories > possibly in combination with reading or writing to a compact flash > attached to USB. > > I've attached the panic message, dmesg output, and gdb output. > > If there's any additional informtion I can provide to try and resolve > the problem, please ask. I'm willing to put some effort into fixing the > problem. > > Any and all help is greatly appreciated.Yeah, looks like the USB code is implicated. You might like to try 5.3 or RELENG_5, I think there was some work done there to clean it up a bit. Kris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20041215/0f89a5fb/attachment.bin
Peter Jeremy
2005-Jan-08 16:58 UTC
4.10 kernel panic: Fatal trap 12: page fault while in kernel mode
On Wed, Dec 15, 2004 at 12:42:25PM -0800, Scott Sewall wrote:> I'm running FreeBSD 4.10-RELEASE-p3 that occasionally panics. The panic > occurs seems to happen when I'm running rsync of large directories > possibly in combination with reading or writing to a compact flash > attached to USB.Having just looked into an identical panic, the problem is an interface bug between bus_dmamem_alloc() and contigmalloc(). It's nothing to do with USB and (AFAIK) exists in 4.x, 5.x and 6.x. The relevant part of my backtrace looks like: #15 0xc028aaef in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16, tf_edi = 0, tf_esi = -980715140, tf_ebp = -1070676940, tf_isp = -1070676996, tf_ebx = 0, tf_edx = 6867008, tf_ecx = -1056660992, tf_eax = 7261248, tf_trapno = 12, tf_err = 0, tf_eip = -1072225192, tf_cs = 8, tf_eflags = 66118, tf_esp = -1065633592, tf_ss = 0}) at /home/src/sys/i386/i386/trap.c:466 #16 0xc0172458 in tsleep (ident=0xc58b797c, priority=4, wmesg=0xc02bfd27 "swwrt", timo=0) at /home/src/sys/kern/kern_synch.c:436 #17 0xc021e60f in swap_pager_putpages (object=0xd03c6e04, m=0xc02ec50c, count=1, sync=1, rtvals=0xc02ec4b0) at /home/src/sys/vm/swap_pager.c:1431 #18 0xc021ceaf in default_pager_putpages (object=0xd03c6e04, m=0xc02ec50c, c=1, sync=0, rtvals=0xc02ec4b0) at /home/src/sys/vm/default_pager.c:133 #19 0xc0228ca4 in vm_pageout_flush (mc=0xc02ec50c, count=1, flags=0) at /home/src/sys/vm/vm_pager.h:147 #20 0xc02285c9 in contigmalloc1 (size=36864, type=0xc02f4340, flags=1, low=0, high=4294967295, alignment=1, boundary=0, map=0xc03372ac) at /home/src/sys/vm/vm_page.c:1855 #21 0xc022887f in contigmalloc (size=36864, type=0xc02f4340, flags=1, low=0, high=4294967295, alignment=1, boundary=0) at /home/src/sys/vm/vm_page.c:1980 #22 0xc027bd3b in bus_dmamem_alloc (dmat=0xc176b4c0, vaddr=0xc1231a48, flags=1, mapp=0xc1231a44) at /home/src/sys/i386/i386/busdma_machdep.c:351 #23 0xc0231be2 in usb_block_allocmem (tag=0x0, size=36864, align=1, dmap=0xc17d8d3c) at /home/src/sys/dev/usb/usb_mem.c:186 ... #35 0xc022d4ea in uhci_intr (arg=0xc104f000) at /home/src/sys/dev/usb/uhci.c:1175 #36 0xc02841f2 in cpu_idle () at /home/src/sys/i386/i386/machdep.c:1000 Basically, the USB code is trying to allocate ~36KB RAM within an interrupt handler. usb_block_allocmem() invokes bus_dmamem_alloc() with BUS_DMA_NOWAIT (advising that sleep()ing is not allowed). Since more than one page of memory is requested, bus_dmamem_alloc() uses contigmalloc() to allocate the requested memory. The BUS_DMA_NOWAIT flag is mapped to M_NOWAIT but contigmalloc() does not support M_NOWAIT. Unfortunately, I don't know enough about the VM code to be able to suggest a fix. -- Peter Jeremy