Bug 212718 - cp(1)/mv(1)/install(1) cause vm_fault/panic on VIA boards w/USB cards/sticks.
Summary: cp(1)/mv(1)/install(1) cause vm_fault/panic on VIA boards w/USB cards/sticks.
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-STABLE
Hardware: i386 Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-16 01:25 UTC by nibbana
Modified: 2016-10-15 06:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nibbana 2016-09-16 01:25:05 UTC
This problem occurs when copying/moving/installing between USB devices, or USB <-> ATA devices, but interestingly, the problem does not occur when cat(1)ing the same files between devices.  The problem has the "feeling/sense" of cp/mv/install using a transfer mechanism that is much more "stressful/intensive/demanding" on the USB subsystems than cat(1), and that the USB hardware simply cannot function at the stress levels demanded of it.  The problem occurs 100% of the time, not intermittently.  The temporary fix has been scripts emulating cp/mv/install using cat(1), but this is not a complete solution, since ./configure scripts and Makefiles trigger the same problem occasionally, and these triggers have not been tracked down - but are very likely due to the same mechanism.  The error is as follows:

Fatal Trap 12: page fault while in kernel mode.
fault virtual address = 0x24
fault code = supervisor read, page not present.
instruction pointer = 0x20:0xc0776377
stack pointer = 0x28:0xc3239c74
frame pointer = 0x28:0xc3239c74
code segement = base rx0, limit 0xfffff, type 0x1b = DPL0,
                pres 1, def32 1, gran 1
processor flags = interrupt enabled, resume, IOPL=0
current process = 12 (g_down)
trap number = 12
panic: page fault

FreeBSD 9.3-RELEASE #0: Tue Jul 28 04:28:10 AKDT 2015
    root@localhost:/usr/obj/u0/src/sys/MYKERN i386
gcc version 4.2.1 20070831 patched [FreeBSD]
CPU: VIA Nehemiah (666.57-MHz 686-class CPU)
  Origin = "CentaurHauls"  Id = 0x698  Family = 0x6  Model = 0x9  Stepping = 8
  Features=0x381b83f<FPU,VME,DE,PSE,TSC,MSR,SEP,MTRR,PGE,CMOV,PAT,MMX,FXSR,SSE>
  VIA Padlock Features=0xdd<RNG,AES>
real memory  = 536870912 (512 MB)
avail memory = 449589248 (428 MB)
cryptosoft0: <software crypto> on motherboard
padlock0: <AES-CBC> on motherboard
acpi0: <VT9174 AWRDACPI> on motherboard
acpi0: Power Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, 1bef0000 (3) failed
cpu0: <ACPI CPU> on acpi0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x73 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <VIA 862x (CLE266) host to PCI bridge> on hostb0
agp0: aperture size is 64M
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
vgapci0: <VGA-compatible display> mem 0xe4000000-0xe7ffffff,0xe8000000-0xe8ffffff irq 15 at device 0.0 on pci1
drm0: <VIA CLE266> on vgapci0
info: [drm] AGP at 0xe0000000 64MB
info: [drm] Initialized via 2.11.1 20070202
vgapci0: Boot video device
uhci0: <VIA 83C572 USB controller> port 0xd000-0xd01f irq 15 at device 16.0 on pci0
usbus0 on uhci0
uhci1: <VIA 83C572 USB controller> port 0xd400-0xd41f irq 5 at device 16.1 on pci0
usbus1 on uhci1
uhci2: <VIA 83C572 USB controller> port 0xd800-0xd81f irq 11 at device 16.2 on pci0
usbus2 on uhci2
ehci0: <VIA VT6202 USB 2.0 controller> mem 0xea000000-0xea0000ff irq 10 at device 16.3 on pci0
usbus3: EHCI version 1.0
usbus3 on ehci0
isab0: <PCI-ISA bridge> at device 17.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <VIA 8235 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xdc00-0xdc0f at device 17.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
pcm0: <VIA VT8235> port 0xe000-0xe0ff irq 11 at device 17.5 on pci0
pcm0: <ICEnsemble VT1616 AC97 Codec>
pcm0: <VIA DXS Enabled: DXS 4 / SGD 1 / REC 1>
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0
ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
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
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model Generic PS/2 mouse, device ID 0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
Timecounters tick every 1.000 msec
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 480Mbps High Speed USB v2.0
ugen0.1: <VIA> at usbus0
uhub0: <VIA UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <VIA> at usbus1
uhub1: <VIA UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen2.1: <VIA> at usbus2
uhub2: <VIA UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen3.1: <VIA> at usbus3
uhub3: <VIA EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
uhub0: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
uhub2: 2 ports with 2 removable, self powered
uhub3: 6 ports with 6 removable, self powered
ugen3.2: <vendor 0x05e3> at usbus3
uhub4: <vendor 0x05e3 USB2.0 Hub, class 9/0, rev 2.00/85.37, addr 2> on usbus3
uhub4: 4 ports with 4 removable, self powered
ugen3.3: <SanDisk> at usbus3
umass0: <SanDisk Cruzer Glide, class 0/0, rev 2.00/1.27, addr 3> on usbus3
ugen3.4: <SanDisk> at usbus3
umass1: <SanDisk Cruzer Glide, class 0/0, rev 2.00/1.27, addr 4> on usbus3
ugen3.5: <SanDisk> at usbus3
umass2: <SanDisk Cruzer Glide, class 0/0, rev 2.00/1.27, addr 5> on usbus3
ugen3.6: <Generic> at usbus3
umass3: <Generic Flash Card ReaderWriter, class 0/0, rev 2.00/1.00, addr 6> on usbus3
ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <WDC WD400AB-22CDB0 22.04A22> ATA-5 device
ada0: Serial Number WD-WMA9T1222658
ada0: 100.000MB/s transfers (UDMA5, PIO 8192bytes)
ada0: 38166MB (78165360 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad0
Timecounter "TSC" frequency 666565048 Hz quality 800
da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
da0: <SanDisk Cruzer Glide 1.27> Removable Direct Access SCSI-6 device 
da0: Serial Number 20042401010F1771AF62
da0: 40.000MB/s transfers
da0: 122112MB (250085376 512 byte sectors: 255H 63S/T 15567C)
da0: quirks=0x2<NO_6_BYTE>
da2 at umass-sim2 bus 2 scbus4 target 0 lun 0
da2: <SanDisk Cruzer Glide 1.27> Removable Direct Access SCSI-6 device 
da2: Serial Number 20051942530F1771BE1E
da2: 40.000MB/s transfers
da2: 122112MB (250085376 512 byte sectors: 255H 63S/T 15567C)
da2: quirks=0x2<NO_6_BYTE>
da1 at umass-sim1 bus 1 scbus3 target 0 lun 0
da1: <SanDisk Cruzer Glide 1.27> Removable Direct Access SCSI-6 device 
da1: Serial Number 20044527120F1771BE38
da1: 40.000MB/s transfers
da1: 122112MB (250085376 512 byte sectors: 255H 63S/T 15567C)
da1: quirks=0x2<NO_6_BYTE>
da3 at umass-sim3 bus 3 scbus5 target 0 lun 0
da3: <Multiple Card  Reader 1.00> Removable Direct Access SCSI-0 device 
da3: Serial Number 058F63666438
da3: 40.000MB/s transfers
da3: 30436MB (62333952 512 byte sectors: 255H 63S/T 3880C)
da3: quirks=0x2<NO_6_BYTE>
Trying to mount root from ufs:/dev/ada0p2 [rw]...
WARNING: /mnt was not properly dismounted
GEOM_ELI: Device ada0p3.eli created.
GEOM_ELI: Encryption: 3DES-CBC 192
GEOM_ELI:     Crypto: software
GEOM_ELI: Device ada0p4.eli created.
GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI:     Crypto: software
GEOM_ELI: Device da3.eli created.
GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI:     Crypto: software
tun0: link state changed to UP
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2016-09-16 03:37:38 UTC
hps, does this seem like a usb problem to you?  If not please reassign it back to bugs@.
Comment 2 Hans Petter Selasky freebsd_committer 2016-09-16 07:42:58 UTC
A backtrace would be nice. Have you tried 9-stable. It does not look like an USB issue. There hasn't been NULL pointer's there for some time now.

--HPS
Comment 3 nibbana 2016-09-19 03:38:03 UTC
This is probably a Via USB driver issue, and was mistakenly reported as "bin" because the problem is only noticed when using "bin" utilities.
Comment 4 nibbana 2016-09-19 03:41:23 UTC
A backtrace?  I don't understand.  The system panics - but if there is additional info that would be helpful even in such a case, I would be happy to provide it, but I am not an expert - and I would need a little direction - lay-coder level ...
Comment 5 nibbana 2016-09-19 03:44:57 UTC
I am getting the base system of 11.0-RC3 now, and I can try to use the "bin" utilities from it, but I may not be able to swap kernels for some time (weeks/few months).
Comment 6 nibbana 2016-10-15 05:45:18 UTC
bug #212718

11.0-RELEASE
------------
This problem continues in 11.0-RELEASE, and generally with larger files in
the MB range, less or not at all with files in the KB range.  Also, there
is another panic that occurs after a reboot from the cp/mv problem, which
appears to be a loss of filesystem integrity (ATA).  For example, after a
cp(1) panic while copying from USB to ATA, after reboot, every executable
in /usr/local/bin would cause a panic when run.  They required deletion,
and re-compiling/installing to function again without a panic.

11.0-RELEASE panic (from cp/mv/install):

Fatal Trap 12: page fault while in kernel mode.
cpuid = 0; apic id = 00
fault virtual address = 0xd3636000
fault code = supervisor write, page not present
instruction pointer = 0x20:0xc132c277
stack pointer = 0x28:0xd90e270c
frame pointer = 0x28:0xd90e2758
code segment = base rx0, limit 0xfffff, type 0x1b
 = DPL 0, pres 1, def32 1, gran 1
processor flags = interrupt enable, resume, IOPC = 0
current process = 72433 (cp)
trap number = 12
panic: page fault
#0 - #17 ... kdb_backtrace+0x4f, vpanic+0x115, panic+0x1b, trap_fatal+0x30a,
trap_pfault+0x10e, trap+0x68f, calltrap+0x6, vnode_pager_generic_getpages+
0x1395, vnode_pager_local_getpages+0x42, VOP_GETPAGES_APV+0x6f,
vnode_pager_getpages+0xba, vn_pager_get_pages+0x39,
vn_fault_hold+0xaa0, vn_fault_quick_hold_pages+0x127
vn_io_fault1+0x2b3, vn_io_fault+0x1ff, dofilewrite+0x9b
kern+writev+0x93

panic (filesystem integrity related - guessing ... sometimes part of cp/mv
operations relating to USB devices, sometimes part of running an executable
that was recently installed after rebooting from the previous panic):

panic: unknown caching mode -268374161
cpuid= 0
KDB:stack backtrace

#0 - #9 ... kdb_backtrace+0x4f, vpanic+0x115, panic+0x1b, pmap_qenter+0x155,
g_io_check+0x304, g_io_schedule_down+0x206, g_down_procbody+0x7d, fork_exit
+0x71, fork_trampoline+0x8
Comment 7 nibbana 2016-10-15 05:47:45 UTC
There is often a huge file loss after rebooting after these panics.
Rarely directories, if at all - but often dozens of the most recently
created files.
Comment 8 nibbana 2016-10-15 06:14:29 UTC
I should say that none of these problems occur on NetBSD 7.0.1,
using exactly the same hardware (but older/smaller ATA drive).