NetBSD Problem Report #54875

From tsutsui@ceres.dti.ne.jp  Sat Jan 18 21:30:02 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 2CEF37A16D
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Jan 2020 21:30:00 +0000 (UTC)
Message-Id: <202001182129.00ILToPs010508@ceres.dti.ne.jp>
Date: Sun, 19 Jan 2020 06:29:50 +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 compat_50" fails on kernel without "options QUOTA"
X-Send-Pr-Version: 3.95

>Number:         54875
>Category:       kern
>Synopsis:       "modload compat_50" fails on kernel without "options QUOTA"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 18 21:35:00 +0000 2020
>Closed-Date:    Thu Feb 20 13:24:53 +0000 2020
>Last-Modified:  Thu Feb 20 13:24:53 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0_RC1
>Organization:
>Environment:
System: NetBSD  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 QUOTE is disabled by default)
"modload compat_50" fails:
---
# modload compat_50
[ 3411.1500220] kobj_checksyms, 988: [compat_50]: linker error: symbol `dqblk_to_quotavals' not found
[ 3411.2000220] kobj_checksyms, 988: [compat_50]: linker error: symbol `quotavals_to_dqblk' not found
[ 3411.2300220] WARNING: module error: unable to affix module `compat_50', error 8
modload: compat_50: Exec format error
# 
---

This means all compat modules prior 5.0 also fail:
---
# modload compat_40
[ 3497.8800220] kobj_checksyms, 988: [compat_50]: linker error: symbol `dqblk_to_quotavals' not found
[ 3497.9300220] kobj_checksyms, 988: [compat_50]: linker error: symbol `quotavals_to_dqblk' not found
[ 3497.9600220] WARNING: module error: unable to affix module `compat_50', error 8
[ 3497.9800220] WARNING: module error: recursive load failed for `compat_40' (`compat_50' required), error 8
modload: compat_40: Exec format error
#
---

The missing dqblk_to_quotavals() and quotavals_to_dqblk() are
in quota1_subr.c, but it's pulled only if options QUOTA
(and ufs derived filesystems) are configured:
---
file	ufs/ufs/quota1_subr.c		quota & (ffs | mfs | ext2fs | chfs)
---

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

>Fix:
No idea how such options in compat modules should be handled.

---
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:46:47 +0000
Responsible-Changed-Why:
It's mine


State-Changed-From-To: open->feedback
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Sat, 18 Jan 2020 21:55:31 +0000
State-Changed-Why:
Explanation provided.  This is not something that can be fixed in any
short term.


From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/54875: "modload compat_50" fails on kernel without "options
 QUOTA"
Date: Sat, 18 Jan 2020 13:53:59 -0800 (PST)

 The compat_50 module is built with the assumption that ``options
 QUOTA'' is available in the kernel.  If your kernel does not contain
 the option, then you have to build the module without the option by
 editing src/sys/modules/compat_50/Makefile and removing the relevant
 CPPFLAGS line.

 Perhaps someday the QUOTA option will be its own stand-alone module,
 but that day has not yet arrived.

 Note that the same issue arises for ``options WAPBL''...


 +--------------------+--------------------------+-----------------------+
 | 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: "Paul Goyette" <pgoyette@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54875 CVS commit: src
Date: Tue, 21 Jan 2020 02:37:17 +0000

 Module Name:	src
 Committed By:	pgoyette
 Date:		Tue Jan 21 02:37:17 UTC 2020

 Modified Files:
 	src/distrib/sets/lists/modules: mi
 	src/sys/compat/common: files.common vfs_syscalls_50.c
 	src/sys/kern: syscalls.master
 	src/sys/modules: Makefile
 	src/sys/modules/compat_50: Makefile
 	src/sys/sys: param.h
 Added Files:
 	src/sys/compat/common: compat_50_quota.c
 	src/sys/modules/compat_50_quota: Makefile

 Log Message:
 Split the compat_50 module into two, separating the QUOTA-related
 stuff from the rest of the module.  This allows loading of the
 (main) compat_50 module on kernels that don't include ``options
 QUOTA''.

 Welcome to 9.99.40 !

 Addresses PR kern/54875


 To generate a diff of this commit:
 cvs rdiff -u -r1.130 -r1.131 src/distrib/sets/lists/modules/mi
 cvs rdiff -u -r0 -r1.1 src/sys/compat/common/compat_50_quota.c
 cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/files.common
 cvs rdiff -u -r1.24 -r1.25 src/sys/compat/common/vfs_syscalls_50.c
 cvs rdiff -u -r1.296 -r1.297 src/sys/kern/syscalls.master
 cvs rdiff -u -r1.236 -r1.237 src/sys/modules/Makefile
 cvs rdiff -u -r1.6 -r1.7 src/sys/modules/compat_50/Makefile
 cvs rdiff -u -r0 -r1.1 src/sys/modules/compat_50_quota/Makefile
 cvs rdiff -u -r1.642 -r1.643 src/sys/sys/param.h

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

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/54875: "modload compat_50" fails on kernel without "options
 QUOTA"
Date: Mon, 20 Jan 2020 18:44:51 -0800 (PST)

 I've committed a fix for this on HEAD.  Unfortunately, since it changes
 the kernel-module ABI it is not appropriate to make this change on the
 netbsd-9 branch.  For the branch, if you need to load the compat_50
 module into a kernel which does not have ``options QUOTA'', you will
 need to build a custom module by removing the definition of QUOTA from
 src/sys/module/compat_50/Makefile



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

State-Changed-From-To: feedback->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Thu, 20 Feb 2020 13:24:53 +0000
State-Changed-Why:
Fix committed to HEAD, inappropriate for pull-up to the branch.  Originator
advised of state via feeddback, and no further comment received.


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