Hello Kirill, On 22/11/24(Fri) 15:31, Kirill A. Korinsky wrote: > >Synopsis: deattach broken webcam leads to crash
What do you mean by broken? > >Category: uvideo > >Environment: > System : OpenBSD 7.6 > Details : OpenBSD 7.6-current (GENERIC.MP) #44: Fri Nov 22 15:03:48 > CET 2024 > > catap@matebook.local:/usr/src/sys/arch/amd64/compile/GENERIC.MP > > Architecture: OpenBSD.amd64 > Machine : amd64 > >Description: > > When I tried to get some video from Jabra PanaCast 20 via > ffplay I do have an output like this: > > ~ $ ffplay -f v4l2 -i /dev/video1 > ffplay version 4.4.5 Copyright (c) 2003-2024 the FFmpeg > developers > built with OpenBSD clang version 16.0.6 > configuration: --enable-shared --arch=amd64 --cc=cc > --enable-debug --disable-stripping --disable-indev=jack --disable-outdev=sdl2 > --enable-fontconfig --enable-frei0r --enable-gpl --enable-ladspa > --enable-libaom --enable-libass --enable-libdav1d --enable-libfreetype > --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libopus > --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis > --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxml2 > --enable-libxvid --enable-libzimg --enable-nonfree --enable-openssl > --enable-libvidstab --extra-cflags='-I/usr/local/include > -I/usr/X11R6/include' --extra-libs='-L/usr/local/lib -L/usr/X11R6/lib' > --extra-ldsoflags= --mandir=/usr/local/man --objcc=/usr/bin/false > --optflags='-O2 -pipe -g -Wno-redundant-decls' > libavutil 56. 70.100 / 56. 70.100 > libavcodec 58.134.100 / 58.134.100 > libavformat 58. 76.100 / 58. 76.100 > libavdevice 58. 13.100 / 58. 13.100 > libavfilter 7.110.100 / 7.110.100 > libswscale 5. 9.100 / 5. 9.100 > libswresample 3. 9.100 / 3. 9.100 > libpostproc 55. 9.100 / 55. 9.100 > [video4linux2,v4l2 @ 0xd6363dce800] ioctl(VIDIOC_DQBUF): > Invalid argument > [video4linux2,v4l2 @ 0xd6363dce800] Could not find codec > parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown), > 1920x1080): unspecified pixel format > Consider increasing the value for the 'analyzeduration' (0) and > 'probesize' (5000000) options > Input #0, video4linux2,v4l2, from '/dev/video1': > Duration: N/A, bitrate: N/A > Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), > 1920x1080, 30 fps, 30 tbr, 1000k tbn, 1000k tbc > nan M-V: nan fd= 0 aq= 0KB vq= 0KB sq= 0B > f=0/0 > > ~ $ > > and it is frozen. I can't kill the process that leads to: Where is it frozen? On which sleep channel is ffplay sleeping? Can you enter ddb and get a trace of the ffplay process? > ~ $ ps aux | grep ffplay > catap 54733 0.0 0.3 29256 46264 p1- RE/2 1:36PM > 0:00.52 (ffplay) > catap 22048 0.0 0.0 792 1304 p2 S+p 1:37PM > 0:00.01 grep ffplay > ~ $ > > and when I deattach the webcam from usb... system is crashed with > trace like this (text is OCRed and may contains typos): Please double check the OCR, this is barely usable... > uvm_fault(0xfffffdd8066d80868, 0x3f, 0, 2) -> e > kernel: page fault trap, code=2 > Stopped at usbd_close_pipe+0x91: movq %rcx,0x40(%rax) > TID PID UID PRFLAGS PFLAGS CPU COMMAND > 468391 49235 1000 0x1000002 0 1 xconsole > 356919 21579 0 0x100000 0x80 3 hotplug > 245307 28159 0 0x14000 0x200 2 reaper > > usbd_close_pipe(ffffa0002a7e900) at usbd_close_pipe+0x91 > video_close(ffffa00002b2500) at video_close+0x57 Is this uvideo_close()? > video_close(2c01,3,2000,ffffa000c3a22b8) at video_close+0x63 What is this function? video_close() is part of bktr(4) which isn't in your dmesg. > spec_close(ffffa8000c221198) at spec_close+0x187 > UOP_CLOSE(ffffd821944b08,3,ffffd83dffd2e0,ffffa000c3a22b8) at > UOP_CLOSE+0x59 > un_closefile(ffffd818c64de90,ffffa000c3a22b8) at > un_closefile+0xaf > fdrrop(ffffd818c64de90,ffffa000c3a22b8) at fdrrop+0xa5 > close(ffffd818c64de90,ffffa000c3a22b8) at close+0xaf > fdfree(ffffa000c3a22b8) at fdfree+0xa6 > exit1(ffffa000c3a22b8,0,0,3) at exit1+0x29b > single_thread_check_locked(ffffa000c3a22b8,0) at > single_thread_check_locked+0x197 > usernet(ffffa000c3a22b8) at usernet+0x1c5 > syscall(ffffa000c721510) at syscall+0x4f8 > Xsyscall() at Xsyscall+0x128 > end of kernel > end trace frame: 0x798dc83de1e0, count: 1 > >How-To-Repeat: > 1. attach unsupported webcam > 2. try to get video via ffplay or mplayer > 3. when it frozen, try to kill it > 4. now, deattach webcam. > >Fix: > No idea > > dmesg: > OpenBSD 7.6-current (GENERIC.MP) #44: Fri Nov 22 15:03:48 CET 2024 > catap@matebook.local:/usr/src/sys/arch/amd64/compile/GENERIC.MP > real mem = 16890646528 (16108MB) > avail mem = 16355303424 (15597MB) > random: good seed from bootblocks > mpath0 at root > scsibus0 at mpath0: 256 targets > mainbus0 at root > bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x8e2c2000 (32 entries) > bios0: vendor HUAWEI version "1.10" date 01/12/2023 > bios0: HUAWEI EUL-WX9 > efi0 at bios0: UEFI 2.7 > efi0: XXXXXX rev 0x10010 > acpi0 at bios0: ACPI 5.1 > acpi0: sleep states S0 S3 S4 S5 > acpi0: tables DSDT FACP UEFI SSDT SSDT SSDT SSDT SSDT TPM2 SSDT MSDM LPIT > WSMT SSDT DBGP DBG2 SSDT NHLT HPET APIC MCFG SSDT SSDT DMAR FPDT BGRT > acpi0: wakeup devices XHC_(S3) XDCI(S4) HDAS(S4) RP01(S4) PXSX(S4) RP02(S4) > PXSX(S4) RP03(S4) PXSX(S4) RP04(S4) PXSX(S4) RP05(S4) PXSX(S4) RP06(S4) > PXSX(S4) RP07(S4) [...] > acpitimer0 at acpi0: 3579545 Hz, 24 bits > acpihpet0 at acpi0: 23999999 Hz > acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat > cpu0 at mainbus0: apid 0 (boot processor) > cpu0: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 3292.33 MHz, 06-8e-0c, patch > 000000fc > cpu0: cpuid 1 > edx=bfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > > ecx=77fafbbf<SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND> > cpu0: cpuid 6 eax=27f7<SENSOR,ARAT> ecx=9<EFFFREQ> > cpu0: cpuid 7.0 > ebx=29c67af<FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT> > edx=bc000600<SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD> > cpu0: cpuid a vers=4, gp=4, gpwidth=48, ff=3, ffwidth=48 > cpu0: cpuid d.1 eax=f<XSAVEOPT,XSAVEC,XGETBV1,XSAVES> > cpu0: cpuid 80000001 edx=2c100800<NXE,PAGE1GB,RDTSCP,LONG> > ecx=121<LAHF,ABM,3DNOWP> > cpu0: cpuid 80000007 edx=100<ITSC> > cpu0: msr > 10a=a0a0c2b<IBRS_ALL,SKIP_L1DFL,MDS_NO,MISC_PKG_CT,ENERGY_FILT,FB_CLEAR,RRSBA,GDS_CTRL,RFDS_NO> > cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB > 64b/line 4-way L2 cache, 6MB 64b/line 12-way L3 cache > cpu0: smt 0, core 0, package 0 > mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges > cpu0: apic clock running at 24MHz > cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE > cpu1 at mainbus0: apid 2 (application processor) > cpu1: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 3292.33 MHz, 06-8e-0c, patch > 000000fc > cpu1: smt 0, core 1, package 0 > cpu2 at mainbus0: apid 4 (application processor) > cpu2: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 3209.87 MHz, 06-8e-0c, patch > 000000fc > cpu2: smt 0, core 2, package 0 > cpu3 at mainbus0: apid 6 (application processor) > cpu3: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 3020.93 MHz, 06-8e-0c, patch > 000000fc > cpu3: smt 0, core 3, package 0 > cpu4 at mainbus0: apid 1 (application processor) > cpu4: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 2827.98 MHz, 06-8e-0c, patch > 000000fc > cpu4: smt 1, core 0, package 0 > cpu5 at mainbus0: apid 3 (application processor) > cpu5: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 2673.61 MHz, 06-8e-0c, patch > 000000fc > cpu5: smt 1, core 1, package 0 > cpu6 at mainbus0: apid 5 (application processor) > cpu6: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 2557.29 MHz, 06-8e-0c, patch > 000000fc > cpu6: smt 1, core 2, package 0 > cpu7 at mainbus0: apid 7 (application processor) > cpu7: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 2457.84 MHz, 06-8e-0c, patch > 000000fc > cpu7: smt 1, core 3, package 0 > ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins > acpimcfg0 at acpi0 > acpimcfg0: addr 0xe0000000, bus 0-255 > acpiprt0 at acpi0: bus 0 (PCI0) > acpiprt1 at acpi0: bus -1 (RP01) > acpiprt2 at acpi0: bus -1 (RP02) > acpiprt3 at acpi0: bus -1 (RP03) > acpiprt4 at acpi0: bus -1 (RP04) > acpiprt5 at acpi0: bus -1 (RP05) > acpiprt6 at acpi0: bus -1 (RP06) > acpiprt7 at acpi0: bus -1 (RP07) > acpiprt8 at acpi0: bus -1 (RP08) > acpiprt9 at acpi0: bus 1 (RP09) > acpiprt10 at acpi0: bus -1 (RP10) > acpiprt11 at acpi0: bus -1 (RP11) > acpiprt12 at acpi0: bus -1 (RP12) > acpiprt13 at acpi0: bus -1 (RP13) > acpiprt14 at acpi0: bus -1 (RP14) > acpiprt15 at acpi0: bus -1 (RP15) > acpiprt16 at acpi0: bus -1 (RP16) > acpiprt17 at acpi0: bus -1 (RP17) > acpiprt18 at acpi0: bus -1 (RP18) > acpiprt19 at acpi0: bus -1 (RP19) > acpiprt20 at acpi0: bus -1 (RP20) > acpiprt21 at acpi0: bus -1 (RP21) > acpiprt22 at acpi0: bus -1 (RP22) > acpiprt23 at acpi0: bus -1 (RP23) > acpiprt24 at acpi0: bus -1 (RP24) > acpiec0 at acpi0 > acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001 > "WDT0001" at acpi0 not configured > acpials0 at acpi0: ALSD > acpicmos0 at acpi0 > pchgpio0 at acpi0 GPI0 addr 0xfd6e0000/0x10000 0xfd6d0000/0x10000 > 0xfd6a0000/0x10000 irq 14, 320 pins > "ELAN2604" at acpi0 not configured > "NTAG0001" at acpi0 not configured > "06CB" at acpi0 not configured > acpibtn0 at acpi0: PWRB > acpiac0 at acpi0: AC unit offline > acpibat0 at acpi0: BAT1 model "HB30B1W8ECW-31T" serial 1082 type LION oem > "Sunwoda-H" > acpibtn1 at acpi0: LID0 > "PNP0C14" at acpi0 not configured > "INT0E0C" at acpi0 not configured > intelpmc0 at acpi0: PEPD > state 0: 0x7f:1:2:0x00:0x0000000000000060 > counter: 0x7f:64:0:0x00:0x0000000000000632 > frequency: 0 > state 1: 0x7f:1:2:0x00:0x0000000000000060 > counter: 0x00:32:0:0x03:0x00000000fe00193c > frequency: 9580 > "BTF0001" at acpi0 not configured > "INT3400" at acpi0 not configured > "INT3403" at acpi0 not configured > "INT3403" at acpi0 not configured > "INT3403" at acpi0 not configured > "INT3403" at acpi0 not configured > "INT3403" at acpi0 not configured > tpm0 at acpi0 TPM_ 2.0 (CRB) addr 0xfed40000/0x5000, device 0x00000000 rev 0x0 > "PNP0C14" at acpi0 not configured > acpipwrres0 at acpi0: BTPR, resource for HS10 > acpipwrres1 at acpi0: USBC, resource for XDCI > acpipwrres2 at acpi0: V0PR > acpipwrres3 at acpi0: V1PR > acpipwrres4 at acpi0: V2PR > acpipwrres5 at acpi0: WRST > acpicpu0 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpicpu1 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpicpu2 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpicpu3 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpicpu4 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpicpu5 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpicpu6 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpicpu7 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), > C1(1000@1 mwait.1), PSS > acpitz0 at acpi0: critical temperature is 98 degC > acpivideo0 at acpi0: GFX0 > acpivout0 at acpivideo0: DD1F > cpu0: Enhanced SpeedStep 3292 MHz: speeds: 2101, 2100, 2000, 1900, 1700, > 1600, 1500, 1400, 1200, 1100, 1000, 800, 700, 600, 500, 400 MHz > pci0 at mainbus0 bus 0 > pchb0 at pci0 dev 0 function 0 "Intel Core 10G Host" rev 0x0c > inteldrm0 at pci0 dev 2 function 0 "Intel UHD Graphics" rev 0x02 > drm0 at inteldrm0 > inteldrm0: msi, COMETLAKE, gen 9 > "Intel Core 6G Thermal" rev 0x0c at pci0 dev 4 function 0 not configured > "Intel Core GMM" rev 0x00 at pci0 dev 8 function 0 not configured > pchtemp0 at pci0 dev 18 function 0 "Intel 400 Series Thermal" rev 0x00 > xhci0 at pci0 dev 20 function 0 "Intel 400 Series xHCI" rev 0x00: msi, xHCI > 1.10 > usb0 at xhci0: USB revision 3.0 > uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00 > addr 1 > "Intel 400 Series Shared SRAM" rev 0x00 at pci0 dev 20 function 2 not > configured > iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x00, msix > dwiic0 at pci0 dev 21 function 0 "Intel 400 Series I2C" rev 0x00: apic 2 int > 16 > iic0 at dwiic0 > ihidev0 at iic0 addr 0x15 gpio 170, vendor 0x4f3 product 0x3114, ELAN2604 > ihidev0: 92 report ids > imt0 at ihidev0: clickpad, 5 contacts > wsmouse0 at imt0 mux 0 > ims0 at ihidev0 reportid 1: 2 buttons > wsmouse1 at ims0 mux 0 > hid at ihidev0 reportid 5 not configured > hid at ihidev0 reportid 6 not configured > hid at ihidev0 reportid 7 not configured > hid at ihidev0 reportid 8 not configured > hid at ihidev0 reportid 11 not configured > hid at ihidev0 reportid 12 not configured > hid at ihidev0 reportid 13 not configured > ims1 at ihidev0 reportid 14: 0 buttons > wsmouse2 at ims1 mux 0 > hid at ihidev0 reportid 21 not configured > hid at ihidev0 reportid 22 not configured > hid at ihidev0 reportid 23 not configured > hid at ihidev0 reportid 26 not configured > hid at ihidev0 reportid 61 not configured > hid at ihidev0 reportid 64 not configured > hid at ihidev0 reportid 81 not configured > hid at ihidev0 reportid 92 not configured > "NTAG0001" at iic0 addr 0x57 not configured > dwiic1 at pci0 dev 21 function 1 "Intel 400 Series I2C" rev 0x00: apic 2 int > 17 > iic1 at dwiic1 > ihidev1 at iic1 addr 0x20 gpio 295, vendor 0x6cb product 0x1a1b, 06CB > ihidev1: 15 report ids > ims2 at ihidev1 reportid 1: 1 button, tip > wsmouse3 at ims2 mux 0 > hid at ihidev1 reportid 7 not configured > hid at ihidev1 reportid 8 not configured > hid at ihidev1 reportid 9 not configured > hid at ihidev1 reportid 10 not configured > hid at ihidev1 reportid 11 not configured > hid at ihidev1 reportid 12 not configured > hid at ihidev1 reportid 15 not configured > "Intel 400 Series MEI" rev 0x00 at pci0 dev 22 function 0 not configured > ppb0 at pci0 dev 29 function 0 "Intel 400 Series PCIE" rev 0xf0: msi > pci1 at ppb0 bus 1 > nvme0 at pci1 dev 0 function 0 vendor "Toshiba", unknown product 0x011a rev > 0x00: msix, NVMe 1.3 > nvme0: KXG60ZNV512G TOSHIBA, firmware AGXA4103, serial 50JA14RVK92L > scsibus1 at nvme0: 2 targets, initiator 0 > sd0 at scsibus1 targ 1 lun 0: <NVMe, KXG60ZNV512G TOS, AGXA> > sd0: 488386MB, 512 bytes/sector, 1000215216 sectors > "Intel 400 Series UART" rev 0x00 at pci0 dev 30 function 0 not configured > pcib0 at pci0 dev 31 function 0 "Intel 400 Series LPC" rev 0x00 > azalia0 at pci0 dev 31 function 3 "Intel 400 Series HD Audio" rev 0x00: msi > azalia0: codecs: Realtek ALC256, Intel/0x280b, using Realtek ALC256 > audio0 at azalia0 > ichiic0 at pci0 dev 31 function 4 "Intel 400 Series SMBus" rev 0x00: apic 2 > int 16 > iic2 at ichiic0 > "Intel 400 Series SPI" rev 0x00 at pci0 dev 31 function 5 not configured > isa0 at pcib0 > isadma0 at isa0 > pckbc0 at isa0 port 0x60/5 irq 1 irq 12 > pckbd0 at pckbc0 (kbd slot) > wskbd0 at pckbd0: console keyboard > pcppi0 at isa0 port 0x61 > spkr0 at pcppi0 > vmm0 at mainbus0: VMX/EPT > efifb at mainbus0 not configured > uhidev0 at uhub0 port 2 configuration 1 interface 0 "Yubico YubiKey > FIDO+CCID" rev 2.00/5.10 addr 2 > uhidev0: iclass 3/0 > fido0 at uhidev0: input=64, output=64, feature=0 > ugen0 at uhub0 port 2 configuration 1 "Yubico YubiKey FIDO+CCID" rev > 2.00/5.10 addr 2 > uvideo0 at uhub0 port 7 configuration 1 interface 0 "Azurewave USB camera" > rev 2.01/20.01 addr 3 > video0 at uvideo0 > vscsi0 at root > scsibus2 at vscsi0: 256 targets > softraid0 at root > scsibus3 at softraid0: 256 targets > sd1 at scsibus3 targ 1 lun 0: <OPENBSD, SR CRYPTO, 006> > sd1: 488126MB, 512 bytes/sector, 999682111 sectors > root on sd1a (6d5c66ecfe7a989c.a) swap on sd1b dump on sd1b > inteldrm0: 3000x2000, 32bpp > wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0 > wsdisplay0: screen 1-5 added (std, vt100 emulation) > iwx0: hw rev 0x350, fw 77.a20fb07d.0, address 98:8d:46:21:2b:6d > uhidev1 at uhub0 port 1 configuration 1 interface 0 "GN Jabra A/S Jabra > PanaCast 20" rev 3.20/1.10 addr 4 > uhidev1: iclass 3/0, 5 report ids > uhid0 at uhidev1 reportid 5: input=32, output=32, feature=0 > uvideo1 at uhub0 port 1 configuration 1 interface 1 "GN Jabra A/S Jabra > PanaCast 20" rev 3.20/1.10 addr 4 > video1 at uvideo1 > > usbdevs: > Controller /dev/usb0: > addr 01: 8086:0000 Intel, xHCI root hub > super speed, self powered, config 1, rev 1.00 > driver: uhub0 > addr 02: 1050:0406 Yubico, YubiKey FIDO+CCID > full speed, power 30 mA, config 1, rev 5.10 > driver: uhidev0 > driver: ugen0 > addr 03: 13d3:56f2 Azurewave, USB camera > high speed, power 500 mA, config 1, rev 20.01, iSerial 0x0001 > driver: uvideo0 > addr 04: 0b0e:3021 GN Jabra A/S, Jabra PanaCast 20 > high speed, power 500 mA, config 1, rev 1.10, iSerial A9002000C394-0 > driver: uhidev1 > driver: uvideo1 > > > -- > wbr, Kirill >