NetBSD Problem Report #59150

From martin@duskware.de  Thu Mar  6 15:56:24 2025
Return-Path: <martin@duskware.de>
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 3579F1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  6 Mar 2025 15:56:24 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: entering ddb on VAX does not work as advertized
X-Send-Pr-Version: 3.95

>Number:         59150
>Category:       port-vax
>Synopsis:       entering ddb on VAX does not work as advertized
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-vax-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 06 16:00:00 +0000 2025
>Closed-Date:    Fri Mar 07 10:45:48 +0000 2025
>Last-Modified:  Fri Mar 07 10:45:48 +0000 2025
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.10
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD dead-to-the-world.duskware.de 10.99.10 NetBSD 10.99.10 (DEAD) #21: Mon Feb 26 18:40:50 CET 2024 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/vax/compile/DEAD vax
Architecture: vax
Machine: vax

(also happens with -current, but I need ddb to examine why my -current kernel
fails to run /etc/rc)

>Description:

The ddb(4) man page says:

ENTERING THE DEBUGGER
[..]
     ddb may also be activated from the console.  In general, sending a break
     on a serial console will activate ddb.  There are also key sequences for
     each port that will activate ddb from the keyboard:

           vax       <Esc> followed by <Shift>-D on serial console.

This would mean we have something like

	options		cnmagic="\x1bD"

in effect on VAX by default, but that does not seem to be the case and I
can't find any traces in the code that would make it so.

Adding that option manually to a kernel allows for entering ddb as described.

>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Anders Magnusson <ragge@tethuvudet.se>
To: gnats-bugs@netbsd.org, port-vax-maintainer@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: port-vax/59150: entering ddb on VAX does not work as advertized
Date: Thu, 6 Mar 2025 17:13:41 +0100

 Checking for <esc>-D is in (for example) gencnrint() where it calls 
 kdbrint(), since it must be on receive interrupt level.
 Any checking for debugger on lower levels may not work.

 This code is old.

 -- Ragge

From: Martin Husemann <martin@duskware.de>
To: Anders Magnusson <ragge@tethuvudet.se>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-vax/59150: entering ddb on VAX does not work as advertized
Date: Thu, 6 Mar 2025 17:25:41 +0100

 On Thu, Mar 06, 2025 at 05:13:41PM +0100, Anders Magnusson wrote:
 > Checking for <esc>-D is in (for example) gencnrint() where it calls
 > kdbrint(), since it must be on receive interrupt level.
 > Any checking for debugger on lower levels may not work.

 OK, I didn't check for hardcoded variants (just looked for cnmagic uses).
 It didn't work for me untill I added the cnmagic option.
 I tested on the serial console of a VaxStation 4000/96 (dz, 4 lines, console
 on line 3).

 Martin

From: Anders Magnusson <ragge@tethuvudet.se>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-vax/59150: entering ddb on VAX does not work as advertized
Date: Thu, 6 Mar 2025 19:24:02 +0100

 This is a multi-part message in MIME format.
 --------------Q4BWo6YVtpNMSmSSN6DmU0uQ
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit

 Den 2025-03-06 kl. 17:25, skrev Martin Husemann:
 > On Thu, Mar 06, 2025 at 05:13:41PM +0100, Anders Magnusson wrote:
 >> Checking for <esc>-D is in (for example) gencnrint() where it calls
 >> kdbrint(), since it must be on receive interrupt level.
 >> Any checking for debugger on lower levels may not work.
 > OK, I didn't check for hardcoded variants (just looked for cnmagic uses).
 > It didn't work for me untill I added the cnmagic option.
 > I tested on the serial console of a VaxStation 4000/96 (dz, 4 lines, console
 > on line 3).
 Some archaelogical digging shows that I added the DDB code to the 
 generic console almost 30 years ago :-)
 This was far before cnmagic existed probably.
 Obviously kernel debug code for the dz was never added to the dz console 
 when it was written.

 -- Ragge
 --------------Q4BWo6YVtpNMSmSSN6DmU0uQ
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: 8bit

 <!DOCTYPE html>
 <html>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   </head>
   <body>
     Den 2025-03-06 kl. 17:25, skrev Martin Husemann:<br>
     <blockquote type="cite"
       cite="mid:20250306162541.GE7575@mail.duskware.de">
       <pre class="moz-quote-pre" wrap="">On Thu, Mar 06, 2025 at 05:13:41PM +0100, Anders Magnusson wrote:
 </pre>
       <blockquote type="cite">
         <pre class="moz-quote-pre" wrap="">Checking for &lt;esc&gt;-D is in (for example) gencnrint() where it calls
 kdbrint(), since it must be on receive interrupt level.
 Any checking for debugger on lower levels may not work.
 </pre>
       </blockquote>
       <pre class="moz-quote-pre" wrap="">
 OK, I didn't check for hardcoded variants (just looked for cnmagic uses).
 It didn't work for me untill I added the cnmagic option.
 I tested on the serial console of a VaxStation 4000/96 (dz, 4 lines, console
 on line 3).
 </pre>
     </blockquote>
     Some archaelogical digging shows that I added the DDB code to the
     generic console almost 30 years ago :-)<br>
     This was far before <span style="white-space: pre-wrap">cnmagic existed probably.
 </span> <br>
     Obviously kernel debug code for the dz was never added to the dz
     console when it was written.  <br>
     <br>
     -- Ragge<br>
   </body>
 </html>

 --------------Q4BWo6YVtpNMSmSSN6DmU0uQ--

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-vax/59150: entering ddb on VAX does not work as advertized
Date: Thu, 6 Mar 2025 20:33:01 +0100

 I may have tested the wrong kernel and I definitely did grep for the wrong
 thing. Since a few days it should have worked on the dz console:

         if (consline != -1)
                 cn_set_magic("\033D"); /* set VAX DDB escape sequence */   

 I will re-test tomorrow.

 Martin

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Fri, 07 Mar 2025 10:45:48 +0000
State-Changed-Why:
Works fine, must have tested with an older kernel


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.