NetBSD Problem Report #56323

From gson@gson.org  Thu Jul 22 11:27:27 2021
Return-Path: <gson@gson.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 56D131A921F
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 22 Jul 2021 11:27:27 +0000 (UTC)
Message-Id: <20210722112716.116C2254073@guava.gson.org>
Date: Thu, 22 Jul 2021 14:27:16 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: fvwrite assertion failures during install
X-Send-Pr-Version: 3.95

>Number:         56323
>Category:       lib
>Synopsis:       fvwrite assertion failures during install
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 22 11:30:00 +0000 2021
>Last-Modified:  Sat Sep 04 16:35:01 +0000 2021
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, soruce date >= 2021.07.16.12.34.10
>Organization:
>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:

When installing NetBSD-current/i386 using sysinst, multiple error
messages like this one are printed to the terminal during the set
extraction phase:

  assertion "fp->_w >= 0" failed: file "/tmp/build/2021.07.22.04.46.29-i386-laptop/src/lib/libc/stdio/fvwrite.c", line 60, function "flush_adj"

The installation succeeds nonetheless.

The problem started around the time of this commit:

  2021.07.16.12.34.10 christos src/lib/libc/stdio/fvwrite.c 1.28

>How-To-Repeat:

>Fix:

>Audit-Trail:
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc: Andreas Gustafsson <gson@gson.org>
Subject: Re: lib/56323: fvwrite assertion failures during install
Date: Thu, 22 Jul 2021 22:01:22 +0000 (UTC)

 On Thu, 22 Jul 2021, Andreas Gustafsson wrote:

 > When installing NetBSD-current/i386 using sysinst, multiple error
 > messages like this one are printed to the terminal during the set
 > extraction phase:
 >
 >  assertion "fp->_w >= 0" failed: file "/tmp/build/2021.07.22.04.46.29-i386-laptop/src/lib/libc/stdio/fvwrite.c", line 60, function "flush_adj"
 >
 > The installation succeeds nonetheless.
 >
 > The problem started around the time of this commit:
 >
 >  2021.07.16.12.34.10 christos src/lib/libc/stdio/fvwrite.c 1.28
 >

 That's one of my assertions. Andreas, can you tell more about the
 test setup where this is being triggered? On a real machine (Intel
 Core i3 with 4GB RAM) one of the tests I ran before asking Christos
 to make that commit is this one (and I didn't see this assertion):

 ---
 #!/bin/sh

 set -eu -o pipefail
 for f
 do      mkdir X
          echo "$(basename "$f") (1)"
          progress -zf $f tar -C X -xf -
          echo "$(basename "$f") (2)"
          progress -f $f tar -C X -xzf -
          sudo rm -rf X
 done
 ---

 In any case, until this is sorted out, I've requested Christos to
 revert the fwrite changes back to the NetBSD originals. Even in
 -HEAD there is no reason to subject users to not-fully-completed
 changes.

 -RVP

From: Andreas Gustafsson <gson@gson.org>
To: RVP <rvp@SDF.ORG>
Cc: gnats-bugs@netbsd.org
Subject: Re: lib/56323: fvwrite assertion failures during install
Date: Fri, 23 Jul 2021 11:40:16 +0300

 RVP wrote:
 > That's one of my assertions. Andreas, can you tell more about the
 > test setup where this is being triggered? On a real machine (Intel
 > Core i3 with 4GB RAM) one of the tests I ran before asking Christos
 > to make that commit is this one (and I didn't see this assertion):

 I can reproduce the problem on:
  - a physical Dell Latitude D400 laptop (512 MB RAM) running NetBSD-current/i386
  - a physical HP ProLiant DL360 G7 (48 GB RAM) running NetBSD-current/i386
  - the same HP ProLiant DL360 running NetBSD-current/amd64
  - qemu/NVMM running NetBSD-current/i386
  - qemu running NetBSD-current/sparc

 I can't reproduce it on:
  - qemu/NVMM running NetBSD-current/amd64

 A relatively easy way to reproduce it (not requiring hardware purchases)
 is to install misc/py-anita and emulators/qemu from pkgsrc and run the command

   anita install http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/i386/ 2>&1 | tee console.log

 Then look for the string "fvwrite" in console.log.
 -- 
 Andreas Gustafsson, gson@gson.org

From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@NetBSD.org
Cc: RVP <rvp@SDF.ORG>, christos@NetBSD.org
Subject: Re: lib/56323: fvwrite assertion failures during install
Date: Sat, 4 Sep 2021 19:33:23 +0300

 For the record, the assertion failures disappared with these commits:

   2021.07.22.17.08.15 christos src/lib/libc/stdio/fvwrite.c 1.30
   2021.07.22.17.09.01 christos src/lib/libc/stdio/fflush.c 1.24

   revert changes to fflush.c (1.18) and fvwrite.c (1.25) until we investigate
   collateral damage. Breaks h_intr.c test. Requested by RVP.

 The commit message lacks a reference to a PR, but I'm guessing it is
 referring to the problem reported in the present PR, so I will leave
 the PR open until investigation has taken place.
 -- 
 Andreas Gustafsson, gson@gson.org

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.