NetBSD Problem Report #56453

From www@netbsd.org  Tue Oct 12 13:40:50 2021
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 4F9E11A921F
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 12 Oct 2021 13:40:50 +0000 (UTC)
Message-Id: <20211012134048.ED4E91A9239@mollari.NetBSD.org>
Date: Tue, 12 Oct 2021 13:40:48 +0000 (UTC)
From: wataash@wataash.com
Reply-To: wataash@wataash.com
To: gnats-bugs@NetBSD.org
Subject: config(1): Assertion fails in config -L
X-Send-Pr-Version: www-1.0

>Number:         56453
>Category:       misc
>Synopsis:       config(1): Assertion fails in config -L
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 12 13:45:00 +0000 2021
>Last-Modified:  Tue Oct 12 17:15:01 +0000 2021
>Originator:     Wataru Ashihara
>Release:        -current (2021-09-18 03:05:20 +0000)
>Organization:
>Environment:
NetBSD localhost 9.99.88 NetBSD 9.99.88 (GENERIC) #9: Sun Sep 19 15:42:53 JST 2021  wsh@wsh64:/home/wsh/qc/netbsd/zco.amd64/sys/arch/amd64/compile/GENERIC amd64
>Description:
    $ cd sys/arch/amd64/conf/
    $ config -L GENERIC
    include "/disk1/home/wsh/netbsd/sys/arch/amd64/conf/GENERIC"
    ...
    options WSCONS_SUPPORT_PCVTFONTS

    assertion "dl2 == dl" failed: file "/usr/src/usr.bin/config/lint.c", line 87, function "do_emit_option"
    options WSEMUL_DEFAULTfish: 'config -L GENERIC' terminated by signal SIGABRT (Abort)

>How-To-Repeat:

>Fix:
diff --git a/usr.bin/config/lint.c b/usr.bin/config/lint.c
index 0066acd8b11..1608b3c4bb2 100644
--- a/usr.bin/config/lint.c
+++ b/usr.bin/config/lint.c
@@ -80,11 +80,11 @@ do_emit_option(const char *name, struct defoptlist *dl, void *v)
 	printf("%s\t%s", ot->ot_name, dl->dl_name);
 	if (ot->ot_type == OT_PARAM) {
 		struct defoptlist *dl2 = dlhash_lookup(defoptlint, dl->dl_name);
-		if (dl2 != NULL)
+		if (dl2 != NULL) {
+			assert(dl2 == dl);
 			value = dl2->dl_lintvalue;
-		else
+		} else
 			value = dl->dl_value;
-		assert(dl2 == dl);
 		printf("=\"%s\"", value ? value : "1");
 	}
 	printf("\n");

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56453 CVS commit: src/usr.bin/config
Date: Tue, 12 Oct 2021 13:14:10 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Tue Oct 12 17:14:10 UTC 2021

 Modified Files:
 	src/usr.bin/config: lint.c

 Log Message:
 PR/56453: Wataru Ashihara: config(1): Assertion fails in config -L
 Only compare pointers when one is found.


 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.16 src/usr.bin/config/lint.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.