NetBSD Problem Report #60576

From www@netbsd.org  Wed Aug 12 21:50:05 2026
Return-Path: <www@netbsd.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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 32B171A923B
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 12 Aug 2026 21:50:05 +0000 (UTC)
Message-Id: <20260812215004.534291A923C@mollari.NetBSD.org>
Date: Wed, 12 Aug 2026 21:50:04 +0000 (UTC)
From: thorpej@me.com
Reply-To: thorpej@me.com
To: gnats-bugs@NetBSD.org
Subject: file(1) does not work on 68010 systems due to address space limits
X-Send-Pr-Version: www-1.0
X-From4GNATS: "thorpej@me.com via gnats" <gnats-admin@NetBSD.org>

>Number:         60576
>Category:       bin
>Synopsis:       file(1) does not work on 68010 systems due to address space limits
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 12 21:55:00 +0000 2026
>Last-Modified:  Mon Aug 17 07:35:01 +0000 2026
>Originator:     Jason Thorpe
>Release:        11.99.7
>Organization:
Retrogrouches'R'Us
>Environment:
NetBSD icarus 11.99.7 NetBSD 11.99.7 (PHAETHON1) #154: Fri Aug  7 14:45:49 PDT 2026  thorpej@dhcp-105.ktnet:/Users/thorpej/NetBSD/current/src/sys/arch/hb68k/compile/PHAETHON1 hb68k
>Description:
file(1) does not work on 68010 systems because cannt mmap the compiled magic file:

icarus# file /netbsd
file: cannot map `/usr/share/misc/magic.mgc' (Cannot allocate memory) (No such file or directory)
icarus# ls -lh /usr/share/misc/magic.mgc
-r--r--r--  1 root  wheel   10M Jul  6 22:29 /usr/share/misc/magic.mgc
icarus# 

The total address space limit on 68010, of course, is 16MB, and mmap'ing a 10MB magic file just won't fit along with everything else.
>How-To-Repeat:
See above.
>Fix:
For constrained systems, split the single magic file into separate files?  Christos aluded to this being a possibility.

>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: bin/60576: file(1) does not work on 68010 systems due to address
 space limits
Date: Sun, 16 Aug 2026 12:39:02 +0300

 Try:
 	cp -r /usr/src/external/bsd/file/dist/magic/magdir /usr/share/misc
 	rm /usr/share/misc/magic.mgc

 and see if that behaves better.

 christos

From: Jason Thorpe <thorpej@me.com>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: bin/60576: file(1) does not work on 68010 systems due to address
 space limits
Date: Sun, 16 Aug 2026 07:09:31 -0700

 > On Aug 16, 2026, at 2:39=E2=80=AFAM, Christos Zoulas =
 <christos@zoulas.com> wrote:
 >=20
 > Try:
 > cp -r /usr/src/external/bsd/file/dist/magic/magdir /usr/share/misc
 > rm /usr/share/misc/magic.mgc
 >=20
 > and see if that behaves better.

 icarus# ls -ld /usr/share/misc/magdir/
 drwxr-xr-x  2 root  wheel  6144 Aug 16 07:06 /usr/share/misc/magdir/
 icarus# ls -ld /usr/share/misc/magdir/elf
 -rw-r--r--  1 root  wheel  13780 Jun 13 07:04 /usr/share/misc/magdir/elf
 icarus# file /netbsd
 file: could not find any valid magic files! (No such file or directory)
 icarus#=20

 -- thorpej

From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 thorpej@me.com
Subject: Re: bin/60576: file(1) does not work on 68010 systems due to address
 space limits
Date: Mon, 17 Aug 2026 10:31:05 +0300

 Oops sorry, the directory in /usr/share/misc should be called magic not =
 magdir.

 christos

 > On Aug 16, 2026, at 5:10=E2=80=AFPM, Jason Thorpe via gnats =
 <gnats-admin@netbsd.org> wrote:
 >=20
 > The following reply was made to PR bin/60576; it has been noted by =
 GNATS.
 >=20
 > From: Jason Thorpe <thorpej@me.com>
 > To: Christos Zoulas <christos@zoulas.com>
 > Cc: gnats-bugs@netbsd.org,
 > gnats-admin@netbsd.org,
 > netbsd-bugs@netbsd.org
 > Subject: Re: bin/60576: file(1) does not work on 68010 systems due to =
 address
 > space limits
 > Date: Sun, 16 Aug 2026 07:09:31 -0700
 >=20
 >> On Aug 16, 2026, at 2:39=3DE2=3D80=3DAFAM, Christos Zoulas =3D
 > <christos@zoulas.com> wrote:
 >> =3D20
 >> Try:
 >> cp -r /usr/src/external/bsd/file/dist/magic/magdir /usr/share/misc
 >> rm /usr/share/misc/magic.mgc
 >> =3D20
 >> and see if that behaves better.
 >=20
 > icarus# ls -ld /usr/share/misc/magdir/
 > drwxr-xr-x  2 root  wheel  6144 Aug 16 07:06 /usr/share/misc/magdir/
 > icarus# ls -ld /usr/share/misc/magdir/elf
 > -rw-r--r--  1 root  wheel  13780 Jun 13 07:04 =
 /usr/share/misc/magdir/elf
 > icarus# file /netbsd
 > file: could not find any valid magic files! (No such file or =
 directory)
 > icarus#=3D20
 >=20
 > -- thorpej
 >=20

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.