NetBSD Problem Report #50051

From dholland@netbsd.org  Thu Jul 16 08:25:54 2015
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id F3E72A57FD
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 16 Jul 2015 08:25:53 +0000 (UTC)
Message-Id: <20150716082549.21CFE14A210@mail.netbsd.org>
Date: Thu, 16 Jul 2015 08:25:49 +0000 (UTC)
From: dholland@netbsd.org
Reply-To: dholland@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: config(1) can no longer deselect filesystems properly
X-Send-Pr-Version: 3.95

>Number:         50051
>Category:       toolchain
>Synopsis:       config(1) can no longer deselect filesystems properly
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    toolchain-manager
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 16 08:30:00 +0000 2015
>Closed-Date:    
>Last-Modified:  Sun Jan 01 02:07:29 +0000 2017
>Originator:     David A. Holland
>Release:        NetBSD 7.99.20 (20150716)
>Organization:
>Environment:
System: NetBSD homeworld.netbsd.org 6.1_STABLE NetBSD 6.1_STABLE (NBMAIL) #0: Sun Dec 7 15:42:53 UTC 2014 spz@franklin.NetBSD.org:/home/netbsd/6/amd64/obj/sys/arch/amd64/compile/NBMAIL amd64
Architecture: x86_64
Machine: amd64
>Description:

Commenting out "file-system FFS" does not produce the same
configuration as writing "file-system FFS" then "no file-system FFS".

In particular, in the latter case 'ufs' is still selected by config
and some (but not all) of sys/ufs/ufs/*.c is built; this then causes
link failure. (The link failure is itself a bug, but this config issue
is substantially more important.)

The problem seems to be that 'no file-system' is no longer a complete
inverse operation. With sufficient -d flags (the -d flag is
undocumented, which is also a bug), observe:

   nbconfig -d -d -d -d GENERIC
     :
   GENERIC:150: debug: fs selected `FFS'
   GENERIC:150: debug: attr selected `uvm'
   GENERIC:150: debug: attr selected `machdep'
   GENERIC:150: debug: attr selected `kern'
   GENERIC:150: debug: attr selected `vfs'
   GENERIC:150: debug: attr selected `ufs'
   GENERIC:150: debug: attr selected `uvm'
   GENERIC:150: debug: attr selected `machdep'
   GENERIC:150: debug: attr selected `kern'
   GENERIC:150: debug: attr selected `vfs'
   GENERIC:150: debug: attr selected `ffs'
   GENERIC:151: debug: deselecting fs `FFS'
   GENERIC:151: debug: opt `FFS' deselected
   GENERIC:151: debug: opt `ffs' deselected
     :

Note that these are not inverses and in particular ufs is left behind.
(All those other things are left behind too but they're going to be
getting included anyway so they aren't noticeable...)

It is not clear when this bug was introduced; last fall's config
changes seem the most likely culprit. The lfs/ufs split, finished in
June 2013, is an absolute upper bound because at the time I was very
careful about being able to build kernels that had no ufs*.o files in
them, or even any ufs_* symbols.

If the problem doesn't affect -7, it almost certainly implicates last
fall's config changes. However, I'm still checking this as I don't
have a -7 tools built right now.

>How-To-Repeat:

To see this in its full glory, comment out FFS, MFS, and EXT2FS from
the amd64 GENERIC, run config, and do 'grep ufs Makefile' in the build
dir.

Then repeat with MFS and EXT2FS still commented out and instead of
commenting out FFS, add 'no file-system FFS' right after the
'file-system FFS' line. Run config, repeat the grep, watch four files
from sys/ufs/ufs appear. (Then build the resulting config and watch it
fail on ufs_truncate.)

>Fix:

Not sure.

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/50051: config(1) can no longer deselect filesystems
 properly
Date: Thu, 16 Jul 2015 08:35:23 +0000

 On Thu, Jul 16, 2015 at 08:30:00AM +0000, dholland@netbsd.org wrote:
  > If the problem doesn't affect -7, it almost certainly implicates last
  > fall's config changes. However, I'm still checking this as I don't
  > have a -7 tools built right now.

 It does not affect -7. And, on -7, config -d -d -d -d GENERIC with 
 no file-system FFS prints just this without mentioning the things ffs
 depends on:

    GENERIC:138: debug: fs selected `FFS'
    GENERIC:138: debug: attr selected `ffs'
    GENERIC:139: debug: deselecting fs `FFS'
    GENERIC:139: debug: opt `FFS' deselected
    GENERIC:139: debug: opt `ffs' deselected

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/50051: config(1) can no longer deselect filesystems
 properly
Date: Thu, 16 Jul 2015 08:43:50 +0000

 On Thu, Jul 16, 2015 at 08:30:00AM +0000, dholland@netbsd.org wrote:
  > (the -d flag is undocumented, which is also a bug)

 For the record, I just fixed this part.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Masao Uebayashi <uebayasi@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/50051: config(1) can no longer deselect filesystems properly
Date: Sun, 22 Nov 2015 21:49:17 +0900

 This seems to have been fixed by one of pgoyette@'s changes.

 On Thu, Jul 16, 2015 at 5:30 PM,  <dholland@netbsd.org> wrote:
 >>Number:         50051
 >>Category:       toolchain
 >>Synopsis:       config(1) can no longer deselect filesystems properly
 >>Confidential:   no
 >>Severity:       critical
 >>Priority:       high
 >>Responsible:    toolchain-manager
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   net
 >>Arrival-Date:   Thu Jul 16 08:30:00 +0000 2015
 >>Originator:     David A. Holland
 >>Release:        NetBSD 7.99.20 (20150716)
 >>Organization:
 >>Environment:
 > System: NetBSD homeworld.netbsd.org 6.1_STABLE NetBSD 6.1_STABLE (NBMAIL) #0: Sun Dec 7 15:42:53 UTC 2014 spz@franklin.NetBSD.org:/home/netbsd/6/amd64/obj/sys/arch/amd64/compile/NBMAIL amd64
 > Architecture: x86_64
 > Machine: amd64
 >>Description:
 >
 > Commenting out "file-system FFS" does not produce the same
 > configuration as writing "file-system FFS" then "no file-system FFS".
 >
 > In particular, in the latter case 'ufs' is still selected by config
 > and some (but not all) of sys/ufs/ufs/*.c is built; this then causes
 > link failure. (The link failure is itself a bug, but this config issue
 > is substantially more important.)
 >
 > The problem seems to be that 'no file-system' is no longer a complete
 > inverse operation. With sufficient -d flags (the -d flag is
 > undocumented, which is also a bug), observe:
 >
 >    nbconfig -d -d -d -d GENERIC
 >      :
 >    GENERIC:150: debug: fs selected `FFS'
 >    GENERIC:150: debug: attr selected `uvm'
 >    GENERIC:150: debug: attr selected `machdep'
 >    GENERIC:150: debug: attr selected `kern'
 >    GENERIC:150: debug: attr selected `vfs'
 >    GENERIC:150: debug: attr selected `ufs'
 >    GENERIC:150: debug: attr selected `uvm'
 >    GENERIC:150: debug: attr selected `machdep'
 >    GENERIC:150: debug: attr selected `kern'
 >    GENERIC:150: debug: attr selected `vfs'
 >    GENERIC:150: debug: attr selected `ffs'
 >    GENERIC:151: debug: deselecting fs `FFS'
 >    GENERIC:151: debug: opt `FFS' deselected
 >    GENERIC:151: debug: opt `ffs' deselected
 >      :
 >
 > Note that these are not inverses and in particular ufs is left behind.
 > (All those other things are left behind too but they're going to be
 > getting included anyway so they aren't noticeable...)
 >
 > It is not clear when this bug was introduced; last fall's config
 > changes seem the most likely culprit. The lfs/ufs split, finished in
 > June 2013, is an absolute upper bound because at the time I was very
 > careful about being able to build kernels that had no ufs*.o files in
 > them, or even any ufs_* symbols.
 >
 > If the problem doesn't affect -7, it almost certainly implicates last
 > fall's config changes. However, I'm still checking this as I don't
 > have a -7 tools built right now.
 >
 >>How-To-Repeat:
 >
 > To see this in its full glory, comment out FFS, MFS, and EXT2FS from
 > the amd64 GENERIC, run config, and do 'grep ufs Makefile' in the build
 > dir.
 >
 > Then repeat with MFS and EXT2FS still commented out and instead of
 > commenting out FFS, add 'no file-system FFS' right after the
 > 'file-system FFS' line. Run config, repeat the grep, watch four files
 > from sys/ufs/ufs appear. (Then build the resulting config and watch it
 > fail on ufs_truncate.)
 >
 >>Fix:
 >
 > Not sure.
 >

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 01 Jan 2017 02:07:29 +0000
State-Changed-Why:
uebayasi@ said it was apparently fixed, I should check sometime when my
build machine isn't acting up.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.