amd64/112640: [usb] Kernel freezes when writing a file to an ex2fs filesystem on a usb disk

Klaas Teschauer klaas at
Sun May 13 19:30:07 UTC 2007

>Number:         112640
>Category:       amd64
>Synopsis:       [usb] Kernel freezes when writing a file to an ex2fs filesystem on a usb disk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-amd64
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 13 19:30:06 GMT 2007
>Originator:     Klaas Teschauer
>Release:        FreeBSD 6.2-STABLE amd64
System: FreeBSD line 6.2-STABLE FreeBSD 6.2-STABLE #2: Sun May 13 13:35:35 EDT 2007 root at line:/usr/obj/usr/src/sys/GENERIC amd64
(dmesg output is attached)
The system in question is running an AMD X2 Dual-core processor with
2GB DDR2 dual-channel ram. The problem is observed both with the
GENERIC and SMP kernel configurations.

The system freezes almost immediately when copying a
file to a usb disk slice that is formatted with Linux' ext2
filesystem. "Freeze" means that the system stops responding to any
keyboard or mouse input, the mouse pointer no longer moves.

After the necessary hard reboot the target file exists but is empty.
The resulting damage to the ext2fs filesystem is usually limited.

The problem has been persistent since Kernel release 6.1. /usr/src was
refreshed from stable on May 12th, 2007. The problem is independent
from the method of connecting the disk to the system (hotplug or at
boot time). The hardware works flawlessly under a different OS (Linux).

The file that is copied to the disk is 2097152000 bytes (~2GB)
large. It is unknown if the file size has an impact; the target disk
is my backup drive, so I am reluctant to experiment with it.
Similarly, it is unknown if the problem is related to the fact that
the disk is formatted with ext2.

/etc/make.conf parameters: CFLAGS+=-pipe -O2 -march=k8

Suspected cause of the problem: Deadlock within the kernel; potentially
due to a race condition.

Connect a usb disk to the system with an ext2fs filesystem
in the first slice. Mount the disk with something like 

	mount -f ext2fs /dev/da0s1 /mnt.

Copy a file to the disk using, e.g.

	cp source-file /mnt

None known

--- dmesg.log begins here ---
Copyright (c) 1992-2007 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 is a registered trademark of The FreeBSD Foundation.
FreeBSD 6.2-STABLE #2: Sun May 13 13:35:35 EDT 2007
    root at line:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (2010.31-MHz K8-class CPU)
  Origin = "AuthenticAMD"  Id = 0x40fb2  Stepping = 2
  AMD Features=0xea500800<SYSCALL,NX,MMX+,FFXSR,RDTSCP,LM,3DNow!+,3DNow!>
  AMD Features2=0x1f<LAHF,CMP,SVM,ExtAPIC,CR8>
  Cores per package: 2
real memory  = 2147418112 (2047 MB)
avail memory = 2061783040 (1966 MB)
ioapic0: Changing APIC ID to 2
ioapic0 <Version 1.1> irqs 0-23 on motherboard
kbd1 at kbdmux0
ath_hal: (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
acpi0: <Nvidia AWRDACPI> on motherboard
acpi_bus_number: can't get _ADR
acpi_bus_number: can't get _ADR
acpi0: Power Button (fixed)
acpi_bus_number: can't get _ADR
acpi_bus_number: can't get _ADR
acpi0: reservation of 290, 5 (4) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pci0: <memory> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
pci0: <serial bus, SMBus> at device 1.1 (no driver attached)
ohci0: <OHCI (generic) USB controller> mem 0xea102000-0xea102fff irq 21 at device 2.0 on pci0
usb0: OHCI version 1.0, legacy support
usb0: SMM does not respond, resetting
usb0: <OHCI (generic) USB controller> on ohci0
usb0: USB revision 1.0
uhub0: nVidia OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 10 ports with 10 removable, self powered
ehci0: <NVIDIA nForce4 USB 2.0 controller> mem 0xfeb00000-0xfeb000ff irq 22 at device 2.1 on pci0
usb1: EHCI version 1.0
usb1: companion controller, 4 ports each: usb0
usb1: <NVIDIA nForce4 USB 2.0 controller> on ehci0
usb1: USB revision 2.0
uhub1: nVidia EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub1: 10 ports with 10 removable, self powered
umass0: Cypress Semiconductor USB2.0 Storage Device, rev 2.00/0.01, addr 2
umass0: Get Max Lun not supported (STALLED)
pcm0: <nVidia nForce4> port 0xb800-0xb8ff,0xbc00-0xbcff mem 0xea105000-0xea105fff irq 23 at device 4.0 on pci0
pcm0: <Avance Logic ALC850 AC97 Codec>
atapci0: <nVidia nForce CK804 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xf000-0xf00f at device 6.0 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
atapci1: <nVidia nForce CK804 SATA300 controller> port 0x9f0-0x9f7,0xbf0-0xbf3,0x970-0x977,0xb70-0xb73,0xd000-0xd00f mem 0xea100000-0xea100fff irq 21 at device 7.0 on pci0
ata2: <ATA channel 0> on atapci1
ata3: <ATA channel 1> on atapci1
atapci2: <nVidia nForce CK804 SATA300 controller> port 0x9e0-0x9e7,0xbe0-0xbe3,0x960-0x967,0xb60-0xb63,0xe400-0xe40f mem 0xea101000-0xea101fff irq 22 at device 8.0 on pci0
ata4: <ATA channel 0> on atapci2
ata5: <ATA channel 1> on atapci2
pcib1: <ACPI PCI-PCI bridge> at device 9.0 on pci0
pci1: <ACPI PCI bus> on pcib1
fwohci0: <Texas Instruments TSB43AB23> mem 0xea004000-0xea0047ff,0xea000000-0xea003fff irq 18 at device 10.0 on pci1
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:16:e6:00:00:b6:17:df
fwohci0: Phy 1394a available S400, 3 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
fwe0: <Ethernet over FireWire> on firewire0
if_fwe0: Fake Ethernet address: 02:16:e6:b6:17:df
fwe0: Ethernet address: 02:16:e6:b6:17:df
fwe0: if_start running deferred for Giant
sbp0: <SBP-2/SCSI over FireWire> on firewire0
fwohci0: Initiate bus reset
fwohci0: BUS reset
fwohci0: node_id=0xc800ffc0, gen=1, CYCLEMASTER mode
firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
firewire0: bus manager 0 (me)
nve0: <NVIDIA nForce MCP9 Networking Adapter> port 0xe800-0xe807 mem 0xea103000-0xea103fff irq 23 at device 10.0 on pci0
nve0: Ethernet address 00:16:e6:5b:74:4e
miibus0: <MII bus> on nve0
e1000phy0: <Marvell 88E1116 Gigabit PHY> on miibus0
e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto
nve0: Ethernet address: 00:16:e6:5b:74:4e
pcib2: <ACPI PCI-PCI bridge> at device 11.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> at device 12.0 on pci0
pci3: <ACPI PCI bus> on pcib3
pcib4: <ACPI PCI-PCI bridge> at device 13.0 on pci0
pci4: <ACPI PCI bus> on pcib4
pcib5: <ACPI PCI-PCI bridge> at device 14.0 on pci0
pci5: <ACPI PCI bus> on pcib5
pci5: <display, VGA> at device 0.0 (no driver attached)
pci5: <display> at device 0.1 (no driver attached)
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FAST]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
ppc0: <Standard parallel printer port> port 0x378-0x37f irq 7 on acpi0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
orm0: <ISA Option ROMs> at iomem 0xc0000-0xccfff,0xd0000-0xd3fff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ums0: Logitech USB-PS/2 Optical Mouse, rev 2.00/27.10, addr 2, iclass 3/1
ums0: 8 buttons and Z dir.
Timecounter "TSC" frequency 2010312258 Hz quality 800
Timecounters tick every 1.000 msec
acd0: DVDR <PIONEER DVD-RW DVR-111D/1.23> at ata0-master UDMA66
ad4: 238474MB <WDC WD2500KS-00MJB0 02.01C03> at ata2-master SATA300
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <HDS72252 5VLAT80 \\0000\\0000> Fixed Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: 238475MB (488397168 512 byte sectors: 255H 63S/T 30401C)
Trying to mount root from ufs:/dev/ad4s2a
WARNING: / was not properly dismounted
--- dmesg.log ends here ---

--- kldstat.out begins here ---
Id Refs Address            Size     Name
 1    6 0xffffffff80100000 9868b0   kernel
 2    1 0xffffffff80a87000 6980     snd_ich.ko
 3    2 0xffffffff80a8e000 34000    sound.ko
 4    1 0xffffffffb4948000 b7e7     ext2fs.ko
 5    1 0xffffffffb4966000 1059     daemon_saver.ko
--- kldstat.out ends here ---


More information about the freebsd-amd64 mailing list