NetBSD Problem Report #54703
From gson@gson.org Sun Nov 17 12:32:37 2019
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 CFFDA7A1B6
for <gnats-bugs@gnats.NetBSD.org>; Sun, 17 Nov 2019 12:32:37 +0000 (UTC)
Message-Id: <20191117123231.854CA253F37@guava.gson.org>
Date: Sun, 17 Nov 2019 14:32:31 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: GCC 8 breaks i386 floppy install
X-Send-Pr-Version: 3.95
>Number: 54703
>Category: toolchain
>Synopsis: GCC 8 breaks i386 floppy install
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: toolchain-manager
>State: analyzed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Nov 17 12:35:00 +0000 2019
>Closed-Date:
>Last-Modified: Thu Nov 21 07:36:03 +0000 2019
>Originator: Andreas Gustafsson
>Release: NetBSD-current, source date => 2019.11.16.10.22.20
>Organization:
>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:
Since the commit
2019.11.16.10.22.20 mrg src/share/mk/bsd.own.mk 1.1161
with the commit message "i386 -> GCC 8.", the TNF i386 testbed is
failing at the stage where it attempts to boot the INSTALL kernel in
qemu from virtual floppies. Where the last working version printed
the message
Please remove disk 1, insert disk 2, and press return...
versions built with GCC 8 instead print
Please remove disk 1, insert disk 0, and press return...
and things go downhill from there.
>How-To-Repeat:
Inspect the logs at
http://releng.netbsd.org/b5reports/i386/commits-2019.11.html#2019.11.16.10.22.20
or point "anita install" at a recent enough -current/i386 build.
>Fix:
>Release-Note:
>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: re: toolchain/54703: GCC 8 breaks i386 floppy install
Date: Mon, 18 Nov 2019 15:47:10 +1100
something is wrong with libsa ustarfs.c. i instrumented =
read512block() a little, and it shows that something has
corrupted ustf->uas_volsize after the first call:
NetBSD/x86 ustarfs Primary Bootstrap
read512block: vda 0 volsize 1466368 vda2vn 0
read512block: vda 512 volsize -8192 vda2vn 0
read512block: vda 1024 volsize -8192 vda2vn 0
read512block: vda 1536 volsize -8192 vda2vn 0
read512block: vda 2048 volsize -8192 vda2vn 0
read512block: vda 2560 volsize -8192 vda2vn 0
read512block: vda 3072 volsize -8192 vda2vn 0
read512block: vda 3584 volsize -8192 vda2vn 0
read512block: vda 4096 volsize -8192 vda2vn 0
read512block: vda 4608 volsize -8192 vda2vn 0
read512block: vda 5120 volsize -8192 vda2vn 0
read512block: vda 5632 volsize -8192 vda2vn 0
read512block: vda 6144 volsize -8192 vda2vn 0
read512block: vda 6656 volsize -8192 vda2vn 0
read512block: vda 7168 volsize -8192 vda2vn 0
read512block: vda 7680 volsize -8192 vda2vn 0
read512block: vda 8192 volsize -8192 vda2vn -1
read512block: vda 8704 volsize -8192 vda2vn -1
read512block: vda 9216 volsize -8192 vda2vn -1
read512block: vda 9728 volsize -8192 vda2vn -1
read512block: vda 10240 volsize -8192 vda2vn -1
Please remove disk 1, insert disk 0, and press return...QEMU 4.1.0 monitor=
- type 'help' for more information
(qemu) info block
.mrg.
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: re: toolchain/54703: GCC 8 breaks i386 floppy install
Date: Wed, 20 Nov 2019 18:56:37 +1100
i have tracked this down to a bad strncmp() in ustarfs.c:
---
/* if volume metadata is found, use it */
if(strncmp(ustf->uas_active.ust_name, metaname,
strlen(metaname)) == 0) {
ustarfs_sscanf(ustf->uas_active.ust_name
+ strlen(metaname), "%99o", &newvolblocks);
ustf->uas_volsize = newvolblocks * 512
- lda2pda(0);
---
this strncmp() gets 'ust_name' of 'boot', and 'metaname'
is the static string "USTAR.volsize.", yet this block is
executed, and the sscanf() writes 0 to newvolblocks, and
then uas_volsize becomes -8K (from lda2pda(0).)
From: "matthew green" <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/54703 CVS commit: src/sys/lib/libsa
Date: Thu, 21 Nov 2019 07:34:39 +0000
Module Name: src
Committed By: mrg
Date: Thu Nov 21 07:34:39 UTC 2019
Modified Files:
src/sys/lib/libsa: ustarfs.c
Log Message:
from the new comment:
* XXX Hack alert. GCC 8.3 mis-compiles this function and calls
* strncmp() with the wrong second pointer, as seen in PR#54703.
*
* Until the real cause is located, work around it by using -O1
* for this function.
this hack is restricted to i386.
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/lib/libsa/ustarfs.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->analyzed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Thu, 21 Nov 2019 07:36:03 +0000
State-Changed-Why:
found out what is not working correctly, workaround commited for now.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.