NetBSD Problem Report #59727
From www@netbsd.org Sun Oct 26 09:39:51 2025
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)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id BACB91A9239
for <gnats-bugs@gnats.NetBSD.org>; Sun, 26 Oct 2025 09:39:51 +0000 (UTC)
Message-Id: <20251026093950.ABF971A923A@mollari.NetBSD.org>
Date: Sun, 26 Oct 2025 09:39:50 +0000 (UTC)
From: nia@pkgsrc.org
Reply-To: nia@pkgsrc.org
To: gnats-bugs@NetBSD.org
Subject: wsmux changes in April 2025 seem to have broken kqueue on wsmux
X-Send-Pr-Version: www-1.0
>Number: 59727
>Category: kern
>Synopsis: wsmux changes in April 2025 seem to have broken kqueue on wsmux
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: hans
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Oct 26 09:40:00 +0000 2025
>Closed-Date: Thu Nov 27 15:53:29 +0000 2025
>Last-Modified: Thu Nov 27 15:53:29 +0000 2025
>Originator: nia
>Release: -11, -current...
>Organization:
The NetBSD Foundation
>Environment:
NetBSD siphon 11.99.3 NetBSD 11.99.3 (SIPHON) #13: Thu Oct 23 23:06:13 CEST 2025 nia@siphon:/encrypt/obj/sys/arch/amd64/compile/SIPHON amd64
>Description:
System panicked: kernel diagnostic assertion "sc->sc_base.me_evp == NULL" failed: file "/encrypt/src/sys/dev/wscons/wsmux.c", line 592 wsmuxkqfilter: not open
Backtrace from time of crash is available.
crash> bt
vmx_insn_failinvalid() at 0
kern_reboot() at kern_reboot+0x5f
vpanic() at vpanic+0x193
kern_assert() at __x86_indirect_thunk_rax
wsmuxkqfilter() at wsmuxkqfilter+0x78
cdev_kqfilter() at cdev_kqfilter+0x7f
spec_kqfilter() at spec_kqfilter+0x71
VOP_KQFILTER() at VOP_KQFILTER+0x5c
kevent1() at kevent1+0xfe5
sys___kevent100() at sys___kevent100+0x35
syscall() at syscall+0x9d
--- syscall (number 501) ---
syscall+0x9d:
>How-To-Repeat:
install wm/velox, follow the instructions in MESSAGE to run it, observe
instant panic
>Fix:
revert wsmux changes from 2025 that replaced diagnostic checks with
asserts
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->hans
Responsible-Changed-By: nia@NetBSD.org
Responsible-Changed-When: Sun, 26 Oct 2025 12:58:50 +0000
Responsible-Changed-Why:
can you take a look? thanks :)
State-Changed-From-To: open->analyzed
State-Changed-By: nia@NetBSD.org
State-Changed-When: Sun, 26 Oct 2025 12:58:50 +0000
State-Changed-Why:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: hans@NetBSD.org
Subject: Re: kern/59727: wsmux changes broke kqueue
Date: Fri, 21 Nov 2025 20:43:45 +0100
Any update on this?
Nia, could you undo that hunk (like below) and run a ktrace of your
reproducer?
Martin
Index: wsmux.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsmux.c,v
retrieving revision 1.68
diff -u -p -r1.68 wsmux.c
--- wsmux.c 7 Apr 2025 11:18:44 -0000 1.68
+++ wsmux.c 21 Nov 2025 19:42:58 -0000
@@ -589,7 +589,12 @@ wsmuxkqfilter(dev_t dev, struct knote *k
return (1);
}
- KASSERTMSG(sc->sc_base.me_evp == NULL, "wsmuxkqfilter: not open\n");
+ if (sc->sc_base.me_evp == NULL) {
+#ifdef DIAGNOSTIC
+ printf("wsmuxkqfilter: not open\n");
+#endif
+ return (1);
+ }
return (wsevent_kqfilter(sc->sc_base.me_evp, kn));
}
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/59727 CVS commit: src/sys/dev/wscons
Date: Sat, 22 Nov 2025 15:39:24 +0000
Module Name: src
Committed By: riastradh
Date: Sat Nov 22 15:39:24 UTC 2025
Modified Files:
src/sys/dev/wscons: wsmux.c
Log Message:
wsmux(4): Fix sense of assertion in kqfilter.
This was recently changed in rev. 1.68 to tighten bogus run-time
conditionals into assertions -- with a small snag in this particular
hunk:
@@ -613,12 +589,7 @@ wsmuxkqfilter(dev_t dev, struct knote *kn)
return (1);
}
- if (sc->sc_base.me_evp == NULL) {
-#ifdef DIAGNOSTIC
- printf("wsmuxkqfilter: not open\n");
-#endif
- return (1);
- }
+ KASSERTMSG(sc->sc_base.me_evp == NULL, "wsmuxkqfilter: not open\n");
return (wsevent_kqfilter(sc->sc_base.me_evp, kn));
}
An astute reader will notice that there is something amiss in the
translation from `if (<cond>)' to `KASSERTMSG(<cond>, ...)'.
Candidate fix for:
PR kern/59727: wsmux changes in April 2025 seem to have broken kqueue
on wsmux
(Evidently we need some better testing for all this wscons(4)
business.)
To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/wscons/wsmux.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: analyzed->needs-pullups
State-Changed-By: nia@NetBSD.org
State-Changed-When: Sat, 22 Nov 2025 17:17:15 +0000
State-Changed-Why:
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/59727 CVS commit: [netbsd-11] src/sys/dev/wscons
Date: Mon, 24 Nov 2025 16:50:18 +0000
Module Name: src
Committed By: martin
Date: Mon Nov 24 16:50:18 UTC 2025
Modified Files:
src/sys/dev/wscons [netbsd-11]: wsmux.c
Log Message:
Pull up following revision(s) (requested by nia in ticket #101):
sys/dev/wscons/wsmux.c: revision 1.69
wsmux(4): Fix sense of assertion in kqfilter.
This was recently changed in rev. 1.68 to tighten bogus run-time
conditionals into assertions -- with a small snag in this particular
hunk:
@@ -613,12 +589,7 @@ wsmuxkqfilter(dev_t dev, struct knote *kn)
return (1);
}
- if (sc->sc_base.me_evp == NULL) {
-#ifdef DIAGNOSTIC
- printf("wsmuxkqfilter: not open\n");
-#endif
- return (1);
- }
+ KASSERTMSG(sc->sc_base.me_evp == NULL, "wsmuxkqfilter: not open\n");
return (wsevent_kqfilter(sc->sc_base.me_evp, kn));
}
An astute reader will notice that there is something amiss in the
translation from `if (<cond>)' to `KASSERTMSG(<cond>, ...)'.
Candidate fix for:
PR kern/59727: wsmux changes in April 2025 seem to have broken kqueue
on wsmux
(Evidently we need some better testing for all this wscons(4)
business.)
To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.2.1 src/sys/dev/wscons/wsmux.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: needs-pullups->closed
State-Changed-By: nia@NetBSD.org
State-Changed-When: Thu, 27 Nov 2025 15:53:29 +0000
State-Changed-Why:
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.