NetBSD Problem Report #55045

From gson@gson.org  Wed Mar  4 10:21:19 2020
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 041C41A9217
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  4 Mar 2020 10:21:18 +0000 (UTC)
Message-Id: <20200304102113.31E55253F37@guava.gson.org>
Date: Wed,  4 Mar 2020 12:21:13 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: Assertion failure in _strlcpy booting i386 install media
X-Send-Pr-Version: 3.95

>Number:         55045
>Category:       install
>Synopsis:       Assertion failure in _strlcpy booting i386 install media
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 04 10:25:00 +0000 2020
>Closed-Date:    Wed Mar 04 14:53:23 +0000 2020
>Last-Modified:  Wed Mar 04 14:53:23 +0000 2020
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date >= 2020.02.19.21.51.21
>Organization:

>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:

Booting the NetBSD-current/i386 install media, an assertion failure
is logged before the first sysinst output appears:

  Created tmpfs /dev (1720320 byte, 3328 inodes)
  erase ^?, werase ^W, kill ^U, intr ^C
  assertion "dst != NULL" failed: file "/tmp/bracket/build/2020.02.22.02.28.06-i386/src/lib/libc/../../common/lib/libc/string/strlcpy.c", line 60, function "_strlcpy"

Despite the message, sysinst starts and the installation succeeds.

The problem started with these commits:

  2020.02.19.21.42.53 martin src/usr.sbin/sysinst/Makefile.inc 1.32
  2020.02.19.21.42.54 martin src/share/man/man8/Attic/sysinst.8 1.7
  2020.02.19.21.42.54 martin src/share/man/man8/Makefile 1.110
  2020.02.19.21.42.54 martin src/usr.sbin/sysinst/sysinst.8 1.1
  2020.02.19.21.45.09 martin src/usr.sbin/sysinst/Makefile.inc 1.33
  2020.02.19.21.45.09 martin src/usr.sbin/sysinst/disklabel.c 1.37
  2020.02.19.21.49.48 martin src/usr.sbin/sysinst/Makefile.inc 1.34
  2020.02.19.21.51.21 martin src/usr.sbin/sysinst/defs.h 1.56
  2020.02.19.21.51.21 martin src/usr.sbin/sysinst/main.c 1.22
  2020.02.19.21.51.21 martin src/usr.sbin/sysinst/sysinst.8 1.2

The problem affects the TNF i386 testbed (floppy install in qemu) and
my own bare metal i386 testbed (network install on real hardware).
The amd64 port does not appear to be affected.

>How-To-Repeat:

Install NetBSD/i386 using a serial console and log the serial console
output.

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: install-manager->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Wed, 04 Mar 2020 10:28:13 +0000
Responsible-Changed-Why:
Take


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/55045: Assertion failure in _strlcpy booting i386
 install media
Date: Wed, 4 Mar 2020 11:41:01 +0100

 On Wed, Mar 04, 2020 at 10:25:00AM +0000, Andreas Gustafsson wrote:
 > Booting the NetBSD-current/i386 install media, an assertion failure
 > is logged before the first sysinst output appears:

 Which install media is that? I can not reproduce with the latest ISO.

 Martin

From: Andreas Gustafsson <gson@gson.org>
To: martin@netbsd.org
Cc: gnats-bugs@netbsd.org
Subject: Re: install/55045: Assertion failure in _strlcpy booting i386 install media
Date: Wed, 4 Mar 2020 13:04:51 +0200

 Martin Husemann wrote:
 >  Which install media is that? I can not reproduce with the latest ISO.

 Floppies (the anita default for i386) or a netbooted netbsd-INSTALL kernel.
 I have not tried an ISO, but I will.
 -- 
 Andreas Gustafsson, gson@gson.org

From: Martin Husemann <martin@duskware.de>
To: Andreas Gustafsson <gson@gson.org>
Cc: martin@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: install/55045: Assertion failure in _strlcpy booting i386
 install media
Date: Wed, 4 Mar 2020 12:11:19 +0100

 On Wed, Mar 04, 2020 at 01:04:51PM +0200, Andreas Gustafsson wrote:
 > Floppies (the anita default for i386) or a netbooted netbsd-INSTALL kernel.
 > I have not tried an ISO, but I will.

 No need to, found it...

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55045 CVS commit: src/usr.sbin/sysinst
Date: Wed, 4 Mar 2020 11:15:06 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Mar  4 11:15:06 UTC 2020

 Modified Files:
 	src/usr.sbin/sysinst: main.c

 Log Message:
 PR 55045: strlcpy(NULL, ..., 0) considered harmfull in some implementations.


 To generate a diff of this commit:
 cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/main.c

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

State-Changed-From-To: open->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Wed, 04 Mar 2020 14:53:23 +0000
State-Changed-Why:
Fixed, thanks!


>Unformatted:

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.