USB CD Eject Failures

2022-02-16 Thread Sean Bruno

Been playing around with sysutils/eject to automate some media backup stuff.

I note that "after a number of ejects" the USB 2 CD drive will cease 
responding.  I don't think its a race to failure, it acts like resource 
starvation/leak.  Seems fairly reproducible, if someone gets to it 
before I do, let me know.


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261961

I suspect that something has changed in the 12 years since 
sysutils/eject was last looked at and the CDIOCEJECT case in 
sys/cam/scsi_cd.c probably needs an eyeball.


The close tray command also seems nonfunctional, which probably means 
that a data structure has changed or something else that I haven't 
started at in quite some time.


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261936

sean



Re: Kernel panic for if_epair

2022-02-16 Thread Kristof Provost
On 16 Feb 2022, at 11:31, qroxana wrote:
> It's running 14.0-CURRENT armv7 main-n252983-d21e71efce39
>
> Kernel page fault with the following non-sleepable locks held:
> exclusive sleep mutex epairidx (epairidx) r = 0 (0xe2fe9160) locked @ 
> /usr/src/sys/net/if_epair.c:165
> stack backtrace:
> #0 0xc03558f8 at witness_debugger+0x7c
> #1 0xc0356b3c at witness_warn+0x3fc
> #2 0xc05eb3c8 at abort_handler+0x1d8
> #3 0xc05ca8e0 at exception_exit+0
> #4 0xc0475928 at udp_input+0x1c0
> #5 0xc0441884 at ip_input+0xa18
> #6 0xc041426c at netisr_dispatch_src+0x100
> #7 0xc040b9a0 at ether_demux+0x1c8
> #8 0xc040d22c at ether_nh_input+0x514
> #9 0xc041426c at netisr_dispatch_src+0x100
> #10 0xc040be94 at ether_input+0x8c
> #11 0xe2fd8130 at $a.8+0x128
> #12 0xc02a1ee0 at ithread_loop+0x268
> #13 0xc029e088 at fork_exit+0xa0
> #14 0xc05ca870 at swi_exit+0
> Fatal kernel mode data abort: 'Alignment Fault' on read
> trapframe: 0xe2a0baf0
> FSR=0001, FAR=e3f02a56, spsr=2013
> r0 =, r1 =0001, r2 =0001, r3 =0a0a
> r4 =, r5 =e3f02a6a, r6 =e3f02a56, r7 =0044
> r8 =0044, r9 =c0af955c, r10=0014, r11=e2a0bc10
> r12=, ssp=e2a0bb80, slr=c0441884, pc =c0475928
>
> panic: Fatal abort

That backtrace suggests an alignment fault in udp_input(), not an issue with 
if_epair.
There’s not even any mention of if_epair in that backtrace, but I suppose it’s 
remotely possible that it’s in epair_intr(), calling epair_sintr() in #11. That 
would explain why the epair lock is held, at least.

Note that the epair code has been substantially reworked recently so if you 
retry with a recent (post 24f0bfbad57b9c3cb9b543a60b2ba00e4812c286) build you 
won’t see the epair lock mentioned (assuming you can reproduce the panic), but 
again, it doesn’t look to be involved here anyway.

Kristof



Kernel panic for if_epair

2022-02-16 Thread qroxana
It's running 14.0-CURRENT armv7 main-n252983-d21e71efce39

Kernel page fault with the following non-sleepable locks held:
exclusive sleep mutex epairidx (epairidx) r = 0 (0xe2fe9160) locked @ 
/usr/src/sys/net/if_epair.c:165
stack backtrace:
#0 0xc03558f8 at witness_debugger+0x7c
#1 0xc0356b3c at witness_warn+0x3fc
#2 0xc05eb3c8 at abort_handler+0x1d8
#3 0xc05ca8e0 at exception_exit+0
#4 0xc0475928 at udp_input+0x1c0
#5 0xc0441884 at ip_input+0xa18
#6 0xc041426c at netisr_dispatch_src+0x100
#7 0xc040b9a0 at ether_demux+0x1c8
#8 0xc040d22c at ether_nh_input+0x514
#9 0xc041426c at netisr_dispatch_src+0x100
#10 0xc040be94 at ether_input+0x8c
#11 0xe2fd8130 at $a.8+0x128
#12 0xc02a1ee0 at ithread_loop+0x268
#13 0xc029e088 at fork_exit+0xa0
#14 0xc05ca870 at swi_exit+0
Fatal kernel mode data abort: 'Alignment Fault' on read
trapframe: 0xe2a0baf0
FSR=0001, FAR=e3f02a56, spsr=2013
r0 =, r1 =0001, r2 =0001, r3 =0a0a
r4 =, r5 =e3f02a6a, r6 =e3f02a56, r7 =0044
r8 =0044, r9 =c0af955c, r10=0014, r11=e2a0bc10
r12=, ssp=e2a0bb80, slr=c0441884, pc =c0475928

panic: Fatal abort
cpuid = 0
time = 1645004889
KDB: stack backtrace:
db_trace_self() at db_trace_self
 pc = 0xc05c7f34  lr = 0xc007ac48 (db_trace_self_wrapper+0x30)
 sp = 0xe2a0b8c8  fp = 0xe2a0b9e0
db_trace_self_wrapper() at db_trace_self_wrapper+0x30
 pc = 0xc007ac48  lr = 0xc02e259c (vpanic+0x170)
 sp = 0xe2a0b9e8  fp = 0xe2a0ba08
 r4 = 0x0100  r5 = 0x
 r6 = 0xc077f670  r7 = 0xc090d910
vpanic() at vpanic+0x170
 pc = 0xc02e259c  lr = 0xc02e234c (doadump)
 sp = 0xe2a0ba10  fp = 0xe2a0ba14
 r4 = 0xe2a0baf0  r5 = 0x0013
 r6 = 0xe3f02a56  r7 = 0x0001
 r8 = 0x0001  r9 = 0xe294e000
r10 = 0xe3f02a56
doadump() at doadump
 pc = 0xc02e234c  lr = 0xc05eba18 (abort_align)
 sp = 0xe2a0ba1c  fp = 0xe2a0ba48
 r4 = 0xe3f02a56  r5 = 0xe2a0ba14
 r6 = 0xc02e234c r10 = 0xe2a0ba1c
abort_align() at abort_align
 pc = 0xc05eba18  lr = 0xc05eb518 (abort_handler+0x328)
 sp = 0xe2a0ba50  fp = 0xe2a0bae8
 r4 = 0x0013  r5 = 0xe3f02a56
abort_handler() at abort_handler+0x328
 pc = 0xc05eb518  lr = 0xc05ca8e0 (exception_exit)
 sp = 0xe2a0baf0  fp = 0xe2a0bc10
 r4 = 0x  r5 = 0xe3f02a6a
 r6 = 0xe3f02a56  r7 = 0x0044
 r8 = 0x0044  r9 = 0xc0af955c
r10 = 0x0014
exception_exit() at exception_exit
 pc = 0xc05ca8e0  lr = 0xc0441884 (ip_input+0xa18)
 sp = 0xe2a0bb80  fp = 0xe2a0bc10
 r0 = 0x  r1 = 0x0001
 r2 = 0x0001  r3 = 0x0a0a
 r4 = 0x  r5 = 0xe3f02a6a
 r6 = 0xe3f02a56  r7 = 0x0044
 r8 = 0x0044  r9 = 0xc0af955c
r10 = 0x0014 r12 = 0x
udp_input() at udp_input+0x1c0
 pc = 0xc0475928  lr = 0xc0441884 (ip_input+0xa18)
 sp = 0xe2a0bc18  fp = 0xe2a0bc50
 r4 = 0x00022e75  r5 = 0x
 r6 = 0x0014  r7 = 0x00fb
 r8 = 0xc090d910  r9 = 0xc09457fc
r10 = 0xe3f02a56
ip_input() at ip_input+0xa18
 pc = 0xc0441884  lr = 0xc041426c (netisr_dispatch_src+0x100)
 sp = 0xe2a0bc58  fp = 0xe2a0bc80
 r4 = 0x0003a73b  r5 = 0xe3f02a00
 r6 = 0x  r7 = 0xc0b5b4b4
 r8 = 0xe4417ac0  r9 = 0x5e4a6f28
r10 = 0x0008
netisr_dispatch_src() at netisr_dispatch_src+0x100
 pc = 0xc041426c  lr = 0xc040b9a0 (ether_demux+0x1c8)
 sp = 0xe2a0bc88  fp = 0xe2a0bca0
 r4 = 0xe3244400  r5 = 0xe3f02a00
 r6 = 0x0800  r7 = 0xe3244400
 r8 = 0xe4417ac0  r9 = 0x5e4a6f28
r10 = 0x0008
ether_demux() at ether_demux+0x1c8
 pc = 0xc040b9a0  lr = 0xc040d22c (ether_nh_input+0x514)
 sp = 0xe2a0bca8  fp = 0xe2a0bd10
 r4 = 0xe3244400  r5 = 0xe3f02a00
 r6 = 0xe3f02a48  r7 = 0x
ether_nh_input() at ether_nh_input+0x514
 pc = 0xc040d22c  lr = 0xc041426c (netisr_dispatch_src+0x100)
 sp = 0xe2a0bd18  fp = 0xe2a0bd40
 r4 = 0x00050e88  r5 = 0xe3f02a00
 r6 = 0x  r7 = 0xc0b5b534
 r8 = 0x5e4a6f28  r9 = 0x0020
r10 = 0x
netisr_dispatch_src() at netisr_dispatch_src+0x100
 pc = 0xc041426c  lr = 0xc040be94 (ether_input+0x8c)
 sp = 0xe2a0bd48  fp = 0xe2a0bd80
 r4 = 0xe3244400  r5 = 0x
 r6 = 0xe3f02a00  r7 = 0x
 r8 = 0x5e4a6f28  r9 = 0x0020
r10 = 0x
ether_input() at ether_input+0x8c
 pc = 0xc040be94  lr = 0xe2fd8130 ($a.8+0x128)
 sp = 0xe2a0bd88  fp = 0xe2a0bdb8
 r4 = 0xc57f5c8c  r5 = 0x
 r6 = 0xe3244400  r7 = 0xc57f5c80
 r8 = 0xe2fe9170  r9 = 0xc0938328
r10 = 0xe2a0bd88
$a.8() at $a.8+0x128
 pc = 0xe2fd8130  lr = 0xc02a1ee0 (ithread_loop+0x268)
 sp =