NetBSD Problem Report #58225

From mlelstv@tazz.1st.de  Sun May  5 07:57:41 2024
Return-Path: <mlelstv@tazz.1st.de>
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 EF1A61A9238
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  5 May 2024 07:57:40 +0000 (UTC)
Message-Id: <20240505063503.8B722CCAE5@tazz.1st.de>
Date: Sun,  5 May 2024 08:35:03 +0200 (CEST)
From: mlelstv@netbsd.org
Reply-To: mlelstv@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: netbsd9/amd64 requires COMPAT_16 for 32bit support
X-Send-Pr-Version: 3.95

>Number:         58225
>Category:       kern
>Synopsis:       netbsd9/amd64 requires COMPAT_16 for 32bit support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pgoyette
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 05 08:00:00 +0000 2024
>Last-Modified:  Mon May 06 06:43:27 +0000 2024
>Originator:     Michael van Elst
>Release:        NetBSD 10.99.10
>Organization:
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."
>Environment:


System: NetBSD tazz 10.99.10 NetBSD 10.99.10 (TAZZ) #401: Sun May 5 05:55:10 UTC 2024 mlelstv@slowpoke:/scratch2/obj.amd64/scratch/netbsd-current/src/sys/arch/amd64/compile/TAZZ amd64
Architecture: x86_64
Machine: amd64
>Description:

You can run 32bit NetBSD binaries on amd64 by using a kernel that is built
with COMPAT_NETBSD32 (like GENERIC). But for binaries from netbsd-9 or older,
this relies on the compat_netbsd32_16 module to be present to handle the
old signal context.

When you run a kernel without the older COMPAT options, you don't expect older
compat modules to be loaded. If you use a !INSECURE kernel, autoloading the
modules will also fail, leading to strange failures (e.g.  python3.1.2 failing
to build).

Modules loaded because of compat_netbsd32_16 requirement.

compat_100               exec     filesys  a        2       - -
compat_16                exec     filesys  a        1       - compat_20
compat_20                exec     filesys  a        2       - compat_30
compat_30                exec     filesys  a        2       - compat_util,compat_40
compat_40                exec     filesys  a        2       - compat_50
compat_50                exec     filesys  a        2       - compat_60
compat_60                exec     filesys  a        2       - compat_70
compat_70                exec     filesys  a        1       - compat_80
compat_80                exec     filesys  a        2       - compat_90
compat_90                exec     filesys  a        2       - compat_100
compat_netbsd32          exec     builtin  -        7       - ksem,compat_util,exec_elf32
compat_netbsd32_100      exec     filesys  a        1       - compat_netbsd32,compat_100
compat_netbsd32_16       exec     filesys  -        0       - compat_netbsd32_20,compat_16
compat_netbsd32_20       exec     filesys  a        1       - compat_netbsd32_30,compat_20
compat_netbsd32_30       exec     filesys  a        1       - compat_netbsd32_40,compat_30
compat_netbsd32_40       exec     filesys  a        1       - compat_netbsd32_50,compat_40
compat_netbsd32_50       exec     filesys  a        1       - compat_netbsd32_60,compat_50
compat_netbsd32_60       exec     filesys  a        1       - compat_netbsd32_80,compat_60
compat_netbsd32_80       exec     filesys  a        1       - compat_netbsd32_90,compat_80
compat_netbsd32_90       exec     filesys  a        1       - compat_netbsd32_100,compat_90

Modules built in because of COMPAT_NETBSD32:

compat_netbsd32_coredump misc     builtin  -        0       - compat_netbsd32,compat_netbsd32_ptrace,coredump
compat_netbsd32_mqueue   exec     builtin  -        0       - mqueue,compat_netbsd32
compat_netbsd32_nfssrv   exec     builtin  -        0       - nfsserver,compat_netbsd32
compat_netbsd32_ptrace   exec     builtin  -        1       - compat_netbsd32,ptrace_common
compat_netbsd32_quota    exec     builtin  -        0       - compat_netbsd32
compat_netbsd32_sysvipc  exec     builtin  -        0       - compat_netbsd32,sysv_ipc
compat_util              misc     builtin  -        2       - -


Option COMPAT_90 should be sufficient to build a kernel that supports netbsd-9
binaries, including 32bit ones. It shouldn't silently include alsmost all
old compat code.

>How-To-Repeat:

Run netbsd-9/i386 binaries on a amd64 system (-10 or -current) without COMPAT_16.

>Fix:


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Mon, 06 May 2024 06:43:27 +0000
Responsible-Changed-Why:
take


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.