NetBSD Problem Report #35943
From giles.lean@pobox.com Wed Mar 7 12:34:17 2007
Return-Path: <giles.lean@pobox.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id A0BBF63BA19
for <gnats-bugs@gnats.NetBSD.org>; Wed, 7 Mar 2007 12:34:17 +0000 (UTC)
Message-Id: <20070307123415.1181.qmail@netherstone.net>
Date: 7 Mar 2007 23:34:15 +1100
From: giles.lean@pobox.com
Reply-To: giles.lean@pobox.com
To: gnats-bugs@NetBSD.org
Subject: NetBSD 4.0 BETA_2: file(1) is ... confused
X-Send-Pr-Version: 3.95
>Number: 35943
>Category: bin
>Synopsis: file(1) reports regular binaries as X11/NeWS bitmap fonts
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: christos
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Mar 07 12:35:00 +0000 2007
>Closed-Date:
>Last-Modified: Mon Aug 05 23:24:45 +0000 2019
>Originator: Giles Lean
>Release: NetBSD 4.0_BETA2
>Organization:
>Environment:
System: NetBSD amethyst.netherstone.net 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC) #0: Fri Mar 2 11:45:20 EST 2007 giles@citrine.netherstone.net:/Users/giles/projects/netbsd-4/tmp/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
file(1) is rather confused:
$ /usr/bin/file /usr/bin/vi
/usr/bin/vi: X11/NeWS bitmap font, for NetBSD 4.0, dynamically linked (uses shared libs), not stripped
$ /usr/bin/ldd /usr/bin/vi
/usr/bin/vi:
-lcurses.6 => /usr/lib/libcurses.so.6
-lc.12 => /usr/lib/libc.so.12
So ... file(1) knows that 4.0 executables are NetBSD 4.0 *something*,
but a font with shared libraries is new to me.
>How-To-Repeat:
See above.
>Fix:
>Release-Note:
>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org, giles.lean@pobox.com
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: re: bin/35943: NetBSD 4.0 BETA_2: file(1) is ... confused
Date: Thu, 08 Mar 2007 10:17:54 +1100
this reminds me of a problem we were having a few months ago with file
building corrupted magic files. what system built your release? try
rebuilding file from scratch including deleting the magic files and
re-building those with the new file. this problem occured only on 64bit
build hosts iirc...
the symptoms we saw earlier included pkgsrc failing to deal with shlibs
properly...
.mrg.
From: Giles Lean <giles.lean@pobox.com>
To: matthew green <mrg@eterna.com.au>
Cc: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: bin/35943: NetBSD 4.0 BETA_2: file(1) is ... confused
Date: Thu, 08 Mar 2007 10:45:42 +1100
Hi Matt,
> this reminds me of a problem we were having a few months ago with file
> building corrupted magic files. what system built your release?
OS/X 10.4.8 on PPC.
I'll try a build on the i386 4.0_BETA2 machine itself and
see if that fixes it.
Cheers,
Giles
From: Nick Hudson <skrll@netbsd.org>
To: Giles Lean <giles.lean@pobox.com>
Cc: matthew green <mrg@eterna.com.au>, gnats-bugs@netbsd.org,
gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/35943: NetBSD 4.0 BETA_2: file(1) is ... confused
Date: Thu, 8 Mar 2007 19:37:23 +0000
On Wednesday 07 March 2007 23:45, Giles Lean wrote:
> Hi Matt,
>
> > this reminds me of a problem we were having a few months ago with file
> > building corrupted magic files. what system built your release?
>
> OS/X 10.4.8 on PPC.
>
> I'll try a build on the i386 4.0_BETA2 machine itself and
> see if that fixes it.
Make sure you have dist/file/src/apprentice.c:1.12.2.1
Nick
From: Giles Lean <giles.lean@pobox.com>
To: Nick Hudson <skrll@netbsd.org>, matthew green <mrg@eterna.com.au>
Cc: gnats-bugs@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: bin/35943: NetBSD 4.0 BETA_2: file(1) is ... confused
Date: Sun, 11 Mar 2007 18:19:52 +1100
Hi Nick and Matt,
Nick wrote:
nick> Make sure you have dist/file/src/apprentice.c:1.12.2.1
That's the version in the source tree I built.
Matt wrote:
mrg> this reminds me of a problem we were having a few months ago
mrg> with file building corrupted magic files. what system built
mrg> your release?
Close enough. They're not really corrupted, just built with the
wrong endianness:
From the OS/X PPC hosted cross build for i386:
$ file magic.mgc
magic.mgc: magic binary file for file(1) cmd (version 3) (big endian)
From the i386 hosted build:
$ file magic.mgc
magic.mgc: magic binary file for file(1) cmd (version 3) (little endian)
I confirmed that it's just the magic.mgc file that is the problem:
the file(1) binary from either build works providing it is given
the little endian magic.mgc file. (n.b. The same problem exists
with /usr/share/misc/magic.mime.mgc.)
I haven't looked at the build to see what needs to be changed.
(I possibly will, but I can't promise to -- time is short at the
moment.)
If someone creates a fix and wants me to run another OS/X hosted
build to test, that I can do -- just let me know.
Cheers,
Giles
P.S. I don't suppose it's interesting that build.sh is broken on
NetBSD 1.6.2, but for the list archives and Google: building
4.0_BETA2/i386 on NetBSD-1.6.2/i386 fails.
From: Giles Lean <giles@stonerows.net>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/35943: NetBSD 4.0 BETA_2: file(1) is ... confused
Date: Sun, 15 Jul 2007 14:50:45 +1000
Hi all,
I think this PR can be closed: the update of the file (1) cmd version
format from '3' to '4' appears to have fixed this problem.
In my original report with 4.0_BETA2/i386 compiled on OS/X I
saw:
| $ /usr/bin/file /usr/bin/vi
| /usr/bin/vi: X11/NeWS bitmap font, for NetBSD 4.0, dynamically linked
| (uses shared libs), not stripped
I now see:
$ /usr/bin/file /usr/bin/vi
/usr/bin/vi: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
for NetBSD 4.0, dynamically linked (uses shared libs), not stripped
The magic.mgc file is still being compiled with host endianness, but
that's OK as file(1) is (now) able to cope correctly with that. The
change that made the difference:
Old magic:
| $ file magic.mgc
| magic.mgc: magic binary file for file(1) cmd (version 3) (big endian)
New magic:
$ file magic.mgc
magic.mgc: magic binary file for file(1) cmd (version 4) (big endian)
Regards,
Giles
State-Changed-From-To: open->closed
State-Changed-By: christos@netbsd.org
State-Changed-When: Sun, 15 Jul 2007 23:17:29 -0400
State-Changed-Why:
submitter verified that it is fixed
From: Giles Lean <giles.lean@pobox.com>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
christos@netbsd.org
Subject: Re: bin/35943 (file(1) reports regular binaries as X11/NeWS bitmap fonts)
Date: Tue, 31 Jul 2007 09:46:40 +1000
Hi Christos,
christos@netbsd.org wrote:
> Synopsis: file(1) reports regular binaries as X11/NeWS bitmap fonts
>
> State-Changed-From-To: open->closed
> State-Changed-By: christos@netbsd.org
> State-Changed-When: Sun, 15 Jul 2007 23:17:29 -0400
> State-Changed-Why:
> submitter verified that it is fixed
Thanks ... unfortunately, while I *thought* this was fixed, I must have
botched my testing. After a new build with ~July 29th sources and
installation the problem is still present:
Wrong answers:
$ file /usr/bin/file /usr/share/misc/magic /usr/share/misc/magic.mgc
/usr/bin/file: Symbian installation file, for NetBSD 4.0,
dynamically linked (uses shared libs), not stripped
/usr/share/misc/magic: magic text file for file(1) cmd
/usr/share/misc/magic.mgc: Infocom game data (Z-machine 241, Release
1052 /
# mv /usr/share/misc/magic.mgc /usr/share/misc/magic.mgc-bigendian
# file -C -m /usr/share/misc/magic
$ file /usr/share/misc/magic.mgc*
/usr/share/misc/magic.mgc: magic binary file for file(1) cmd
(version 4) (little endian)
/usr/share/misc/magic.mgc-bigendian: magic binary file for file(1) cmd
(version 4) (big endian)
The 'mv' and 'file -C' are an easy workaround, at least.
Host and target platforms the same as when the PR was filed.
Can the PR be placed back in 'open' state, please?
Regards,
Giles
State-Changed-From-To: closed->open
State-Changed-By: pavel@netbsd.org
State-Changed-When: Tue, 31 Jul 2007 08:48:07 +0000
State-Changed-Why:
problem still here.
Responsible-Changed-From-To: bin-bug-people->christos
Responsible-Changed-By: maya@NetBSD.org
Responsible-Changed-When: Mon, 05 Aug 2019 23:24:45 +0000
Responsible-Changed-Why:
Is building magic files on opposite endianness a problem you've seen recently?
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.