NetBSD Problem Report #57149
From www@netbsd.org Fri Dec 30 06:30:20 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id A318F1A923A
for <gnats-bugs@gnats.NetBSD.org>; Fri, 30 Dec 2022 06:30:20 +0000 (UTC)
Message-Id: <20221230063018.F2EE61A923B@mollari.NetBSD.org>
Date: Fri, 30 Dec 2022 06:30:18 +0000 (UTC)
From: nervoso@k1.com.br
Reply-To: nervoso@k1.com.br
To: gnats-bugs@NetBSD.org
Subject: panic with core dump when disconnect usb keyboard
X-Send-Pr-Version: www-1.0
>Number: 57149
>Category: kern
>Synopsis: panic with core dump when disconnect usb keyboard
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Dec 30 06:35:00 +0000 2022
>Last-Modified: Thu Jan 12 12:10:01 +0000 2023
>Originator: sergio lenzi
>Release: 10.0_BETA
>Organization:
k1 sistemas
>Environment:
NetBSD V10.netbsd 10.0_BETA NetBSD 10.0_BETA (GENERIC) #0: Thu Dec 29 18:48:40 -03 2022 NetBSD@V10.netbsd:/home/NetBSD/BUILD/10/amd64/OBJ/sys/arch/amd64/compile/GENERIC amd64
>Description:
very stable system, but panics when disconnect usb keyboard, tested in several computers kernel core and kernel available at http://www.k1.com.br/NetBSD/10/amd64/crash
full message:
crash -M netbsd.0.core -N netbsd.0
Crash version 10.0_BETA, image version 10.0_BETA.
crash: _kvm_kvatop(0)
Kernel compiled without options LOCKDEBUG.
System panicked: kernel diagnostic assertion "c->c_magic == CALLOUT_MAGIC" failed: file "/home/NetBSD/BUILD/10/usr/src/sys/kern/kern_timeout.c", line 547
Backtrace from time of crash is available.
crash> bt
vmx_insn_failinvalid() at 0
kern_reboot() at sys_reboot
vpanic() at vpanic+0x188
kern_assert() at __x86_indirect_thunk_rax
callout_halt() at callout_halt+0x160
ukbd_detach() at ukbd_detach+0x52
config_detach() at config_detach+0x1bc
config_detach_children() at config_detach_children+0x57
uhidev_detach() at uhidev_detach+0x28
config_detach() at config_detach+0x1bc
usb_disconnect_port() at usb_disconnect_port+0xc3
uhub_explore() at uhub_explore+0x378
usb_discover() at usb_discover+0x4f
usb_event_thread() at usb_event_thread+0x7a
crash>
>How-To-Repeat:
boot the system, with a USB keyboard, than unplug de device... the system dumps core on swap device
>Fix:
>Audit-Trail:
From: nervoso <nervoso@k1.com.br>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/57149
Date: Mon, 09 Jan 2023 11:55:12 -0300
--=-N+rVyZphbaliuerAK3Pm
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
this problem occurs only when using "gamer" usb keyboards that have
more than 50 variable keys
on cheap chinese or not programable keybords, that have few keys, it
does not occurs
Also, when a "gamer" type usb is connect it includes several ukbd at
once:
[ 2.694665] uhidev0: SEMICO (0x1a2c) USB gaming keyboard KX410TKL
(0x44c8), rev 1.10/1.10, addr 2, iclass 3/1
[ 2.704665] ukbd0 at uhidev0: 8 Variable keys, 6 Array codes <<<
seems OK
[ 2.704665] uhidev1: SEMICO (0x1a2c) USB gaming keyboard KX410TKL
(0x44c8), rev 1.10/1.10, addr 2, iclass 3/1
[ 2.724665] ukbd1: autoconfiguration error: attach failed, key code
size != 8
the cpu runs fine but if the keyboard disconnect ... the system panics
on ukbd detach,
Crash version 10.0_BETA, image version 10.0_BETA.
crash: _kvm_kvatop(0)
Kernel compiled without options LOCKDEBUG.
System panicked: kernel diagnostic assertion "c->c_magic ==
CALLOUT_MAGIC" failed: file
"/home/NetBSD/BUILD/10/usr/src/sys/kern/kern_timeout.c", line 547
Backtrace from time of crash is available.
crash> bt
__kernel_end() at 0
kern_reboot() at sys_reboot
vpanic() at vpanic+0x18d
kern_assert() at __x86_indirect_thunk_rax
callout_halt() at callout_halt+0x114
ukbd_detach() at ukbd_detach+0x52
config_detach() at config_detach+0x1bc
config_detach_children() at config_detach_children+0x57
uhidev_detach() at uhidev_detach+0x28
config_detach() at config_detach+0x1bc
usb_disconnect_port() at usb_disconnect_port+0xc3
uhub_explore() at uhub_explore+0x2b7
usb_discover() at usb_discover+0x54
usb_event_thread() at usb_event_thread+0x7a
============================================
as one can see the ukbd struct data is corrupt probably when read
descripton from the keyboard
Hope it can help
--=-N+rVyZphbaliuerAK3Pm
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<html><head></head><body><div>this problem occurs only when using "gamer" u=
sb keyboards that have more than 50 variable keys</div><div>on cheap =
chinese or not programable keybords, that have few keys, it does not occurs=
</div><div><br></div><div>Also, when a "gamer" type usb is connect it inclu=
des several ukbd at once:</div><div><br></div><div>[ 2.694665] uhidev0: SEM=
ICO (0x1a2c) USB gaming keyboard KX410TKL (0x44c8), rev 1.10/1.10, addr 2, =
iclass 3/1</div><div>[ 2.704665] ukbd0 at uhidev0: 8 Variable keys, 6 A=
rray codes <<< seems OK</div><div>[ 2.704665] uhidev1: =
SEMICO (0x1a2c) USB gaming keyboard KX410TKL (0x44c8), rev 1.10/1.10, addr =
2, iclass 3/1</div><div>[ 2.724665] ukbd1: autoconfiguration error: att=
ach failed, key code size !=3D 8</div><div><br></div><div>the cpu runs fine=
but if the keyboard disconnect ... the system panics on ukbd detach,</div>=
<div><br></div><div>Crash version 10.0_BETA, image version 10.0_BETA.</div>=
<div>crash: _kvm_kvatop(0)</div><div>Kernel compiled without options LOCKDE=
BUG.</div><div>System panicked: kernel diagnostic assertion "c->c_magic =
=3D=3D CALLOUT_MAGIC" failed: file "/home/NetBSD/BUILD/10/usr/src/sys/kern/=
kern_timeout.c", line 547 </div><div>Backtrace from time of crash is availa=
ble.</div><div>crash> bt</div><div>__kernel_end() at 0</div><div>kern_re=
boot() at sys_reboot</div><div>vpanic() at vpanic+0x18d</div><div>kern_asse=
rt() at __x86_indirect_thunk_rax</div><div>callout_halt() at callout_halt+0=
x114</div><div>ukbd_detach() at ukbd_detach+0x52</div><div>config_detach() =
at config_detach+0x1bc</div><div>config_detach_children() at config_detach_=
children+0x57</div><div>uhidev_detach() at uhidev_detach+0x28</div><div>con=
fig_detach() at config_detach+0x1bc</div><div>usb_disconnect_port() at usb_=
disconnect_port+0xc3</div><div>uhub_explore() at uhub_explore+0x2b7</div><d=
iv>usb_discover() at usb_discover+0x54</div><div>usb_event_thread() at usb_=
event_thread+0x7a</div><div><br></div><div>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</div><div>as one can see the ukbd struct data i=
s corrupt probably when read descripton from the keyboard</div><div><br></d=
iv><div>Hope it can help</div><div><br></div><div class=3D"-x-evo-signature=
-wrapper"><span class=3D"-x-evo-signature" id=3D"none"></span></div></body>=
</html>
--=-N+rVyZphbaliuerAK3Pm--
From: sergio lenzi <lenzi.sergio@gmail.com>
To: NETBSD BUGS <gnats-bugs@netbsd.org>
Cc:
Subject: Re: kern/57149
Date: Mon, 9 Jan 2023 13:23:55 -0300
--00000000000052226105f1d732a5
Content-Type: text/plain; charset="UTF-8"
his problem occurs only when using "gamer" usb keyboards that have more
than 50 variable keys
on cheap chinese or not programable keyboards, that have few keys, it does
not occurs
Also, when a "gamer" type usb is connect it includes several ukbd at once:
[ 2.694665] uhidev0: SEMICO (0x1a2c) USB gaming keyboard KX410TKL (0x44c8),
rev 1.10/1.10, addr 2, iclass 3/1
[ 2.704665] ukbd0 at uhidev0: 8 Variable keys, 6 Array codes <<< seems OK
[ 2.704665] uhidev1: SEMICO (0x1a2c) USB gaming keyboard KX410TKL (0x44c8),
rev 1.10/1.10, addr 2, iclass 3/1
[ 2.724665] ukbd1: autoconfiguration error: attach failed, key code size !=
8
the cpu runs fine but if the keyboard disconnect ... the system panics on
ukbd detach,
Crash version 10.0_BETA, image version 10.0_BETA.
crash: _kvm_kvatop(0)
Kernel compiled without options LOCKDEBUG.
System panicked: kernel diagnostic assertion "c->c_magic == CALLOUT_MAGIC"
failed: file "/home/NetBSD/BUILD/10/usr/src/sys/kern/kern_timeout.c", line
547
Backtrace from time of crash is available.
crash> bt
__kernel_end() at 0
kern_reboot() at sys_reboot
vpanic() at vpanic+0x18d
kern_assert() at __x86_indirect_thunk_rax
callout_halt() at callout_halt+0x114
ukbd_detach() at ukbd_detach+0x52
config_detach() at config_detach+0x1bc
config_detach_children() at config_detach_children+0x57
uhidev_detach() at uhidev_detach+0x28
config_detach() at config_detach+0x1bc
usb_disconnect_port() at usb_disconnect_port+0xc3
uhub_explore() at uhub_explore+0x2b7
usb_discover() at usb_discover+0x54
usb_event_thread() at usb_event_thread+0x7a
============================================
as one can see the ukbd struct data is corrupt probably when read
descripton from the keyboard
Hope it can help
--00000000000052226105f1d732a5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-=
size:14.6704px;font-style:normal;font-variant-caps:normal;font-weight:400;l=
etter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;w=
hite-space:normal;word-spacing:0px;text-decoration:none">his problem occurs=
only when using "gamer" usb keyboards that have =C2=A0more than =
50 variable keys</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;=
font-size:14.6704px;font-style:normal;font-variant-caps:normal;font-weight:=
400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:n=
one;white-space:normal;word-spacing:0px;text-decoration:none">on cheap chin=
ese or not programable keyboards, that have few keys, it does not occurs</d=
iv><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px=
;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:=
normal;text-align:start;text-indent:0px;text-transform:none;white-space:nor=
mal;word-spacing:0px;text-decoration:none"><br></div><div style=3D"color:rg=
b(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:normal;font-v=
ariant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;t=
ext-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text=
-decoration:none">Also, when a "gamer" type usb is connect it inc=
ludes several ukbd at once:</div><div style=3D"color:rgb(0,0,0);font-family=
:Cantarell;font-size:14.6704px;font-style:normal;font-variant-caps:normal;f=
ont-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-=
transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><b=
r></div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6=
704px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spa=
cing:normal;text-align:start;text-indent:0px;text-transform:none;white-spac=
e:normal;word-spacing:0px;text-decoration:none">[ 2.694665] uhidev0: SEMICO=
(0x1a2c) USB gaming keyboard KX410TKL (0x44c8), rev 1.10/1.10, addr 2, icl=
ass 3/1</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size=
:14.6704px;font-style:normal;font-variant-caps:normal;font-weight:400;lette=
r-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white=
-space:normal;word-spacing:0px;text-decoration:none">[ 2.704665] ukbd0 at u=
hidev0: 8 Variable keys, 6 Array codes =C2=A0 <<< seems OK</div><d=
iv style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font=
-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:norma=
l;text-align:start;text-indent:0px;text-transform:none;white-space:normal;w=
ord-spacing:0px;text-decoration:none">[ 2.704665] uhidev1: SEMICO (0x1a2c) =
USB gaming keyboard KX410TKL (0x44c8), rev 1.10/1.10, addr 2, iclass 3/1</d=
iv><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px=
;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:=
normal;text-align:start;text-indent:0px;text-transform:none;white-space:nor=
mal;word-spacing:0px;text-decoration:none">[ 2.724665] ukbd1: autoconfigura=
tion error: attach failed, key code size !=3D 8</div><div style=3D"color:rg=
b(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:normal;font-v=
ariant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;t=
ext-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text=
-decoration:none"><br></div><div style=3D"color:rgb(0,0,0);font-family:Cant=
arell;font-size:14.6704px;font-style:normal;font-variant-caps:normal;font-w=
eight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-trans=
form:none;white-space:normal;word-spacing:0px;text-decoration:none">the cpu=
runs fine but if the keyboard disconnect ... the system panics on ukbd det=
ach,</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14=
.6704px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-s=
pacing:normal;text-align:start;text-indent:0px;text-transform:none;white-sp=
ace:normal;word-spacing:0px;text-decoration:none"><br></div><div style=3D"c=
olor:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:normal=
;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:=
start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px;text-decoration:none">Crash version 10.0_BETA, image version 10.0_BETA.<=
/div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704=
px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacin=
g:normal;text-align:start;text-indent:0px;text-transform:none;white-space:n=
ormal;word-spacing:0px;text-decoration:none">crash: _kvm_kvatop(0)</div><di=
v style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-=
style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal=
;text-align:start;text-indent:0px;text-transform:none;white-space:normal;wo=
rd-spacing:0px;text-decoration:none">Kernel compiled without options LOCKDE=
BUG.</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14=
.6704px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-s=
pacing:normal;text-align:start;text-indent:0px;text-transform:none;white-sp=
ace:normal;word-spacing:0px;text-decoration:none">System panicked: kernel d=
iagnostic assertion "c->c_magic =3D=3D CALLOUT_MAGIC" failed: =
file "/home/NetBSD/BUILD/10/usr/src/sys/kern/kern_timeout.c", lin=
e 547<span class=3D"gmail-Apple-converted-space">=C2=A0</span></div><div st=
yle=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-styl=
e:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;tex=
t-align:start;text-indent:0px;text-transform:none;white-space:normal;word-s=
pacing:0px;text-decoration:none">Backtrace from time of crash is available.=
</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.670=
4px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spaci=
ng:normal;text-align:start;text-indent:0px;text-transform:none;white-space:=
normal;word-spacing:0px;text-decoration:none">crash> bt</div><div style=
=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:n=
ormal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-a=
lign:start;text-indent:0px;text-transform:none;white-space:normal;word-spac=
ing:0px;text-decoration:none">__kernel_end() at 0</div><div style=3D"color:=
rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:normal;font=
-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start=
;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;te=
xt-decoration:none">kern_reboot() at sys_reboot</div><div style=3D"color:rg=
b(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:normal;font-v=
ariant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;t=
ext-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text=
-decoration:none">vpanic() at vpanic+0x18d</div><div style=3D"color:rgb(0,0=
,0);font-family:Cantarell;font-size:14.6704px;font-style:normal;font-varian=
t-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-i=
ndent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-deco=
ration:none">kern_assert() at __x86_indirect_thunk_rax</div><div style=3D"c=
olor:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:normal=
;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:=
start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px;text-decoration:none">callout_halt() at callout_halt+0x114</div><div sty=
le=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style=
:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text=
-align:start;text-indent:0px;text-transform:none;white-space:normal;word-sp=
acing:0px;text-decoration:none">ukbd_detach() at ukbd_detach+0x52</div><div=
style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-s=
tyle:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;=
text-align:start;text-indent:0px;text-transform:none;white-space:normal;wor=
d-spacing:0px;text-decoration:none">config_detach() at config_detach+0x1bc<=
/div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704=
px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacin=
g:normal;text-align:start;text-indent:0px;text-transform:none;white-space:n=
ormal;word-spacing:0px;text-decoration:none">config_detach_children() at co=
nfig_detach_children+0x57</div><div style=3D"color:rgb(0,0,0);font-family:C=
antarell;font-size:14.6704px;font-style:normal;font-variant-caps:normal;fon=
t-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-tr=
ansform:none;white-space:normal;word-spacing:0px;text-decoration:none">uhid=
ev_detach() at uhidev_detach+0x28</div><div style=3D"color:rgb(0,0,0);font-=
family:Cantarell;font-size:14.6704px;font-style:normal;font-variant-caps:no=
rmal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px=
;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:no=
ne">config_detach() at config_detach+0x1bc</div><div style=3D"color:rgb(0,0=
,0);font-family:Cantarell;font-size:14.6704px;font-style:normal;font-varian=
t-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-i=
ndent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-deco=
ration:none">usb_disconnect_port() at usb_disconnect_port+0xc3</div><div st=
yle=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-styl=
e:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;tex=
t-align:start;text-indent:0px;text-transform:none;white-space:normal;word-s=
pacing:0px;text-decoration:none">uhub_explore() at uhub_explore+0x2b7</div>=
<div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;fo=
nt-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:nor=
mal;text-align:start;text-indent:0px;text-transform:none;white-space:normal=
;word-spacing:0px;text-decoration:none">usb_discover() at usb_discover+0x54=
</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.670=
4px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spaci=
ng:normal;text-align:start;text-indent:0px;text-transform:none;white-space:=
normal;word-spacing:0px;text-decoration:none">usb_event_thread() at usb_eve=
nt_thread+0x7a</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;fo=
nt-size:14.6704px;font-style:normal;font-variant-caps:normal;font-weight:40=
0;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:non=
e;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><div =
style=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-st=
yle:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;t=
ext-align:start;text-indent:0px;text-transform:none;white-space:normal;word=
-spacing:0px;text-decoration:none">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D</div><div style=3D"color:rgb(0,0,0);font-family:Cantarel=
l;font-size:14.6704px;font-style:normal;font-variant-caps:normal;font-weigh=
t:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform=
:none;white-space:normal;word-spacing:0px;text-decoration:none">as one can =
see the ukbd struct data is corrupt probably when read descripton from the =
keyboard</div><div style=3D"color:rgb(0,0,0);font-family:Cantarell;font-siz=
e:14.6704px;font-style:normal;font-variant-caps:normal;font-weight:400;lett=
er-spacing:normal;text-align:start;text-indent:0px;text-transform:none;whit=
e-space:normal;word-spacing:0px;text-decoration:none"><br></div><div style=
=3D"color:rgb(0,0,0);font-family:Cantarell;font-size:14.6704px;font-style:n=
ormal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-a=
lign:start;text-indent:0px;text-transform:none;white-space:normal;word-spac=
ing:0px;text-decoration:none">Hope it can help</div><br class=3D"gmail-Appl=
e-interchange-newline"><br></div>
--00000000000052226105f1d732a5--
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org, nervoso@k1.com.br
Subject: re: kern/57149
Date: Tue, 10 Jan 2023 06:14:58 +1100
the ukbd detach bug looks obvious to me. can you try this patch?
.mrg.
Index: dev/usb/ukbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ukbd.c,v
retrieving revision 1.161
diff -p -u -r1.161 ukbd.c
--- dev/usb/ukbd.c 6 Apr 2022 21:51:29 -0000 1.161
+++ dev/usb/ukbd.c 9 Jan 2023 19:13:29 -0000
@@ -295,6 +295,7 @@ struct ukbd_softc {
uint16_t sc_pollchars[MAXKEYS];
u_char sc_dying;
+ u_char sc_attached;
};
#ifdef UKBD_DEBUG
@@ -520,6 +521,8 @@ ukbd_attach(device_t parent, device_t se
sc->sc_wskbddev = config_found(self, &a, wskbddevprint, CFARGS_NONE);
+ sc->sc_attached = true;
+
return;
}
@@ -584,6 +587,9 @@ ukbd_detach(device_t self, int flags)
pmf_device_deregister(self);
+ if (!sc->sc_attached)
+ return rv;
+
if (sc->sc_console_keyboard) {
/*
* Disconnect our consops and set ukbd_is_console
From: nervoso <nervoso@k1.com.br>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/57149
Date: Mon, 09 Jan 2023 17:20:12 -0300
--=-r52MxZnONFny5Lub9XDW
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Em seg, 2023-01-09 às 19:20 +0000, matthew green escreveu:
> The following reply was made to PR kern/57149; it has been noted by GNATS.
>
> From: matthew green <mrg@eterna.com.au>
> To: gnats-bugs@netbsd.org
> Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
> netbsd-bugs@netbsd.org, nervoso@k1.com.br
> Subject: re: kern/57149
> Date: Tue, 10 Jan 2023 06:14:58 +1100
>
> the ukbd detach bug looks obvious to me. can you try this patch?
>
>
> .mrg.
>
>
> Index: dev/usb/ukbd.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/usb/ukbd.c,v
> retrieving revision 1.161
> diff -p -u -r1.161 ukbd.c
> --- dev/usb/ukbd.c 6 Apr 2022 21:51:29 -0000 1.161
> +++ dev/usb/ukbd.c 9 Jan 2023 19:13:29 -0000
> @@ -295,6 +295,7 @@ struct ukbd_softc {
> uint16_t sc_pollchars[MAXKEYS];
>
> u_char sc_dying;
> + u_char sc_attached;
> };
>
> #ifdef UKBD_DEBUG
> @@ -520,6 +521,8 @@ ukbd_attach(device_t parent, device_t se
>
> sc->sc_wskbddev = config_found(self, &a, wskbddevprint, CFARGS_NONE);
>
> + sc->sc_attached = true;
> +
> return;
> }
>
> @@ -584,6 +587,9 @@ ukbd_detach(device_t self, int flags)
>
> pmf_device_deregister(self);
>
> + if (!sc->sc_attached)
> + return rv;
> +
> if (sc->sc_console_keyboard) {
> /*
> * Disconnect our consops and set ukbd_is_console
>
YESS it worked...
Thank you...
--=-r52MxZnONFny5Lub9XDW
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<html><head></head><body><div>Em seg, 2023-01-09 =C3=A0s 19:20 +0000, matth=
ew green escreveu:</div><blockquote type=3D"cite" style=3D"margin:0 0 0 .8e=
x; border-left:2px #729fcf solid;padding-left:1ex"><pre>The following reply=
was made to PR kern/57149; it has been noted by GNATS.</pre><pre><br></pre=
><pre>From: matthew green <<a href=3D"mailto:mrg@eterna.com.au">mrg@eter=
na.com.au</a>></pre><pre>To: <a href=3D"mailto:gnats-bugs@netbsd.org">gn=
ats-bugs@netbsd.org</a></pre><pre>Cc: <a href=3D"mailto:kern-bug-people@net=
bsd.org">kern-bug-people@netbsd.org</a>, <a href=3D"mailto:gnats-admin@netb=
sd.org">gnats-admin@netbsd.org</a>,</pre><pre> <a href=3D"mailto:netbsd-=
bugs@netbsd.org">netbsd-bugs@netbsd.org</a>, <a href=3D"mailto:nervoso@k1.c=
om.br">nervoso@k1.com.br</a></pre><pre>Subject: re: kern/57149</pre><pre>Da=
te: Tue, 10 Jan 2023 06:14:58 +1100</pre><pre><br></pre><pre> the ukbd deta=
ch bug looks obvious to me. can you try this patch?</pre><pre> </pre><pre>=
</pre><pre> .mrg.</pre><pre> </pre><pre> </pre><pre> Index: dev/usb/ukbd.c=
</pre><pre> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</pre><pre> =
RCS file: /cvsroot/src/sys/dev/usb/ukbd.c,v</pre><pre> retrieving revision =
1.161</pre><pre> diff -p -u -r1.161 ukbd.c</pre><pre> --- dev/usb/ukbd.c 6 =
Apr 2022 21:51:29 -0000 1.161</pre><pre> +++ dev/usb/ukbd.c 9 Jan 2023 19:1=
3:29 -0000</pre><pre> @@ -295,6 +295,7 @@ struct ukbd_softc {</pre><pre> =
uint16_t sc_pollchars[MAXKEYS];</pre><pre> </pre><pre> u_char sc_dying;<=
/pre><pre> + u_char sc_attached;</pre><pre> };</pre><pre> </pre><pre> #i=
fdef UKBD_DEBUG</pre><pre> @@ -520,6 +521,8 @@ ukbd_attach(device_t parent,=
device_t se</pre><pre> </pre><pre> sc->sc_wskbddev =3D config_found(=
self, &a, wskbddevprint, CFARGS_NONE);</pre><pre> </pre><pre> + sc->=
;sc_attached =3D true;</pre><pre> +</pre><pre> return;</pre><pre> }</pre=
><pre> </pre><pre> @@ -584,6 +587,9 @@ ukbd_detach(device_t self, int flag=
s)</pre><pre> </pre><pre> pmf_device_deregister(self);</pre><pre> </pre=
><pre> + if (!sc->sc_attached)</pre><pre> + return rv;</pre><pre> +</pr=
e><pre> if (sc->sc_console_keyboard) {</pre><pre> /*</pre><pre> =
* Disconnect our consops and set ukbd_is_console</pre><pre> </pre></blockq=
uote><div>YESS it worked... </div><div><br></div><div>Th=
ank you...</div><div class=3D"-x-evo-signature-wrapper"><span class=3D"-x-e=
vo-signature" id=3D"none"></span></div></body></html>
--=-r52MxZnONFny5Lub9XDW--
From: "matthew green" <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/57149 CVS commit: src/sys/dev/usb
Date: Tue, 10 Jan 2023 18:20:11 +0000
Module Name: src
Committed By: mrg
Date: Tue Jan 10 18:20:10 UTC 2023
Modified Files:
src/sys/dev/usb: ukbd.c
Log Message:
ukbd(4): remember how much of attach worked so detach works.
if ukbd_attach() fails it means it has only really done the pmf
setup, nothing else, so avoid trying to remove callouts, child
devices, or console setup, usb task and uhidev operations.
fixes the crash (but not the underlying ukbd doesn't work issue)
seen in PR#57149.
To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/ukbd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/57149 CVS commit: [netbsd-10] src/sys/dev/usb
Date: Thu, 12 Jan 2023 12:09:18 +0000
Module Name: src
Committed By: martin
Date: Thu Jan 12 12:09:18 UTC 2023
Modified Files:
src/sys/dev/usb [netbsd-10]: ukbd.c
Log Message:
Pull up following revision(s) (requested by mrg in ticket #43):
sys/dev/usb/ukbd.c: revision 1.162
ukbd(4): remember how much of attach worked so detach works.
if ukbd_attach() fails it means it has only really done the pmf
setup, nothing else, so avoid trying to remove callouts, child
devices, or console setup, usb task and uhidev operations.
fixes the crash (but not the underlying ukbd doesn't work issue)
seen in PR#57149.
To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.161.4.1 src/sys/dev/usb/ukbd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.