NetBSD Problem Report #54874

From tsutsui@ceres.dti.ne.jp  Sat Jan 18 21:03:14 2020
Return-Path: <tsutsui@ceres.dti.ne.jp>
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 97CE97A16D
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Jan 2020 21:03:14 +0000 (UTC)
Message-Id: <202001182103.00IL35Xa003237@ceres.dti.ne.jp>
Date: Sun, 19 Jan 2020 06:03:05 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: "modload exec_aout" fails due to missing dependencies
X-Send-Pr-Version: 3.95

>Number:         54874
>Category:       kern
>Synopsis:       "modload exec_aout" fails due to missing dependencies
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 18 21:05:00 +0000 2020
>Closed-Date:    Tue Jan 21 17:07:21 +0000 2020
>Last-Modified:  Tue Jan 21 17:07:21 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0_RC1
>Organization:
>Environment:
System: etBSD  9.0_RC1 NetBSD 9.0_RC1 (MODULAR) #2: Sun Jan 19 04:54:01 JST 2020  tsutsui@mirage:/s/netbsd-9/src/sys/arch/sun3/compile/MODULAR sun3
Architecture: m68k
Machine: sun3
>Description:
On NetBSD/sun3 9.0_RC1 (options EXEC_AOUT is disabled by default)
"modload exec_aout" fails:
---
 modload exec_aout
[ 1994.0000220] kobj_checksyms, 988: [exec_aout]: linker error: symbol `coredump_netbsd' not found
[ 1994.0200220] WARNING: module error: unable to affix module `exec_aout', error 8
modload: exec_aout: Exec format error
---

The missing coredump_netbsd() is in sys/kern/coredump_netbsd.c.

However it isn't configured unless options EXEC_AOUT (or EXEC_ECOFF etc.)
are defined, per sys/kern/files.kern:
---
file	kern/core_elf32.c		exec_elf32
file	kern/core_elf64.c		exec_elf64
file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff
---

sys/module/exec_aout/Makefile only pulls exec_aout.c so
coredump_netbsd() is not resolved.

>How-To-Repeat:
- build NetBSD/sun3 kernel with options MODULAR
  (or build kernel without EXEC_AOUT)
- modload exec_aout on single user

>Fix:
No idea.  Prepare proper dependencies in core_netbsd.c for module?

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Sat, 18 Jan 2020 21:07:53 +0000
Responsible-Changed-Why:
take it - it's my bug


From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/54874: "modload exec_aout" fails due to missing dependencies
Date: Sat, 18 Jan 2020 13:42:40 -0800 (PST)

 This would seem to be a pre-existing (prior to netbsd-9) bug, and not
 a recently-introduced regression.

 Can you try to build a MODULAR kernel from netbsd-8 branch to confirm?

 The coredump code had a major re-org in -current (after the netbsd-9
 branch was cut).  Unfortunately, the changes were fairly intrusive, and
 would introduce kernel ABI changes that should not be permitted on the
 branch.

 As an alternative, you could add ``modular'' to the list of attributes
 in files.kern which should include the required routine in all modular
 kernels.  Please try this and let me know if it works for you.  (We
 should be able to include this change in the netbsd-9 branch.)

 Index: files.kern
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/files.kern,v
 retrieving revision 1.34
 diff -u -p -r1.34 files.kern
 --- files.kern	4 Apr 2019 20:19:07 -0000	1.34
 +++ files.kern	18 Jan 2020 21:40:40 -0000
 @@ -16,7 +16,8 @@ file	kern/bufq_readprio.c		bufq_readprio
   file	kern/compat_stub.c		kern
   file	kern/core_elf32.c		exec_elf32
   file	kern/core_elf64.c		exec_elf64
 -file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff
 +file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff |
 +					modular
   file	kern/cnmagic.c			kern
   file	kern/exec_aout.c		exec_aout
   file	kern/exec_ecoff.c		exec_ecoff



 On Sat, 18 Jan 2020, Izumi Tsutsui wrote:

 >> Number:         54874
 >> Category:       kern
 >> Synopsis:       "modload exec_aout" fails due to missing dependencies
 >> Confidential:   no
 >> Severity:       non-critical
 >> Priority:       medium
 >> Responsible:    kern-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Sat Jan 18 21:05:00 +0000 2020
 >> Originator:     Izumi Tsutsui
 >> Release:        NetBSD 9.0_RC1
 >> Organization:
 >> Environment:
 > System: etBSD  9.0_RC1 NetBSD 9.0_RC1 (MODULAR) #2: Sun Jan 19 04:54:01 JST 2020  tsutsui@mirage:/s/netbsd-9/src/sys/arch/sun3/compile/MODULAR sun3
 > Architecture: m68k
 > Machine: sun3
 >> Description:
 > On NetBSD/sun3 9.0_RC1 (options EXEC_AOUT is disabled by default)
 > "modload exec_aout" fails:
 > ---
 > modload exec_aout
 > [ 1994.0000220] kobj_checksyms, 988: [exec_aout]: linker error: symbol `coredump_netbsd' not found
 > [ 1994.0200220] WARNING: module error: unable to affix module `exec_aout', error 8
 > modload: exec_aout: Exec format error
 > ---
 >
 > The missing coredump_netbsd() is in sys/kern/coredump_netbsd.c.
 >
 > However it isn't configured unless options EXEC_AOUT (or EXEC_ECOFF etc.)
 > are defined, per sys/kern/files.kern:
 > ---
 > file	kern/core_elf32.c		exec_elf32
 > file	kern/core_elf64.c		exec_elf64
 > file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff
 > ---
 >
 > sys/module/exec_aout/Makefile only pulls exec_aout.c so
 > coredump_netbsd() is not resolved.
 >
 >> How-To-Repeat:
 > - build NetBSD/sun3 kernel with options MODULAR
 >  (or build kernel without EXEC_AOUT)
 > - modload exec_aout on single user
 >
 >> Fix:
 > No idea.  Prepare proper dependencies in core_netbsd.c for module?
 >
 > ---
 > Izumi Tsutsui
 >
 >
 > !DSPAM:5e237340296238931812264!
 >
 >

 +--------------------+--------------------------+-----------------------+
 | Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:     |
 | (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul@whooppee.com     |
 | Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette@netbsd.org   |
 +--------------------+--------------------------+-----------------------+

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: pgoyette@netbsd.org, tsutsui@ceres.dti.ne.jp
Subject: Re: kern/54874: "modload exec_aout" fails due to missing dependencies
Date: Sun, 19 Jan 2020 11:17:31 +0900

 >  This would seem to be a pre-existing (prior to netbsd-9) bug, and not
 >  a recently-introduced regression.
 >  
 >  Can you try to build a MODULAR kernel from netbsd-8 branch to confirm?

 Yes, it also fails on 8.1:
 ---
 hydra# uname -a
 NetBSD hydra 8.1 NetBSD 8.1 (MODULAR) #3: Wed Jan 15 01:51:28 JST 2020  tsutsui@mirage:/s/src/sys/arch/sun3/compile/MODULAR sun3
 hydra# modload exec_aout
 kobj_checksyms, 974: [exec_aout]: linker error: symbol `coredump_netbsd' not found
 WARNING: module error: unable to affix module `exec_aout', error 8
 modload: exec_aout: Exec format error
 hydra#
 ---

 >  As an alternative, you could add ``modular'' to the list of attributes
 >  in files.kern which should include the required routine in all modular
 >  kernels.  Please try this and let me know if it works for you.  (We
 >  should be able to include this change in the netbsd-9 branch.)
  :
 >  -file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff
 >  +file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff |
 >  +					modular

 Yes, "modload exec_aout" works fine with this change on 9.0_RC1 tree.

 Thanks,

 ---
 Izumi Tsutsui

State-Changed-From-To: open->pending-pullups
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Sun, 19 Jan 2020 03:08:45 +0000
State-Changed-Why:
Requested patch via pullup-9 #633 and pullup-8 #1486


From: Paul Goyette <paul@whooppee.com>
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/54874: "modload exec_aout" fails due to missing dependencies
Date: Sat, 18 Jan 2020 19:09:13 -0800 (PST)

 Thanks for the quick testing and confirmation that the proposed patch
 works.

 I have requested the patch to be applied to the netbsd-9 branch via
 pullup-9 #633


 On Sun, 19 Jan 2020, Izumi Tsutsui wrote:

 >>  This would seem to be a pre-existing (prior to netbsd-9) bug, and not
 >>  a recently-introduced regression.
 >>
 >>  Can you try to build a MODULAR kernel from netbsd-8 branch to confirm?
 >
 > Yes, it also fails on 8.1:
 > ---
 > hydra# uname -a
 > NetBSD hydra 8.1 NetBSD 8.1 (MODULAR) #3: Wed Jan 15 01:51:28 JST 2020  tsutsui@mirage:/s/src/sys/arch/sun3/compile/MODULAR sun3
 > hydra# modload exec_aout
 > kobj_checksyms, 974: [exec_aout]: linker error: symbol `coredump_netbsd' not found
 > WARNING: module error: unable to affix module `exec_aout', error 8
 > modload: exec_aout: Exec format error
 > hydra#
 > ---
 >
 >>  As an alternative, you could add ``modular'' to the list of attributes
 >>  in files.kern which should include the required routine in all modular
 >>  kernels.  Please try this and let me know if it works for you.  (We
 >>  should be able to include this change in the netbsd-9 branch.)
 > :
 >>  -file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff
 >>  +file	kern/core_netbsd.c		exec_aout | exec_coff | exec_ecoff |
 >>  +					modular
 >
 > Yes, "modload exec_aout" works fine with this change on 9.0_RC1 tree.
 >
 > Thanks,
 >
 > ---
 > Izumi Tsutsui
 >
 > !DSPAM:5e23bc8515606535120611!
 >
 >

 +--------------------+--------------------------+-----------------------+
 | Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:     |
 | (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul@whooppee.com     |
 | Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette@netbsd.org   |
 +--------------------+--------------------------+-----------------------+

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54874 CVS commit: [netbsd-9] src/sys/kern
Date: Tue, 21 Jan 2020 15:33:33 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Jan 21 15:33:33 UTC 2020

 Modified Files:
 	src/sys/kern [netbsd-9]: files.kern

 Log Message:
 Apply patch, requested by pgoyette in ticket #633:

 PR kern/54874: fix load failure of the exec_aout kernel module.


 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/kern/files.kern

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54874 CVS commit: [netbsd-8] src/sys/kern
Date: Tue, 21 Jan 2020 16:59:57 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Jan 21 16:59:57 UTC 2020

 Modified Files:
 	src/sys/kern [netbsd-8]: files.kern

 Log Message:
 Apply patch, requested by pgoyette in ticket #1486:

 PR kern/54874: fix load failure of the exec_aout kernel module.


 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/kern/files.kern

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

State-Changed-From-To: pending-pullups->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Tue, 21 Jan 2020 17:07:21 +0000
State-Changed-Why:
pullup-8 #1486 committed


>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.