NetBSD Problem Report #55025
From dp@nbsd90-32-vmw.bsdnix.net Wed Feb 26 21:45:16 2020
Return-Path: <dp@nbsd90-32-vmw.bsdnix.net>
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 2FC131A9217
for <gnats-bugs@gnats.NetBSD.org>; Wed, 26 Feb 2020 21:45:16 +0000 (UTC)
Message-Id: <20200226042334.AC8EF365A0D@nbsd90-32-vmw.bsdnix.net>
Date: Tue, 25 Feb 2020 23:23:34 -0500 (EST)
From: dplassche@gmail.com
Reply-To: dplassche@gmail.com
To: gnats-bugs@NetBSD.org
Subject: COMPAT_09 Syscall Failures on NetBSD 9.0 i386 (Change from 8.0)
X-Send-Pr-Version: 3.95
>Number: 55025
>Category: kern
>Synopsis: COMPAT_09 Fails Calling COMPAT_43 Syscalls on 9.0
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pgoyette
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Feb 26 21:50:00 +0000 2020
>Closed-Date: Thu Feb 27 20:02:16 +0000 2020
>Last-Modified: Sat Feb 29 13:00:02 +0000 2020
>Originator: Dan Plassche
>Release: NetBSD 9.0
>Organization:
>Environment:
System: NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020
mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/
GENERIC i386
Architecture: i386
Machine: i386
>Description:
Running NetBSD 0.9 binaries on Release 8 worked and now fails with errors
when attempting to use COMPAT_43 syscalls.
Examples:
# ktrace /emul/nbsd-09/bin/ls; kdump
[1] Bad system call (core dumped) ktrace /emul/nbsd-09/bin/ls
41 1 ktrace EMUL "netbsd"
41 1 ktrace CALL execve(0xbfaffbdf,0xbfaff710,0xbfaff718)
41 1 ktrace NAMI "/emul/nbsd-09/bin/ls"
41 1 ls EMUL "netbsd"
41 1 ls RET execve JUSTRETURN
41 1 ls CALL ioctl(1,TIOCGETA,0xbfbfed60)
41 1 ls GIO fd 1 read 44 bytes
"\^B+\0\0\a\0\0\0\0K\0\0\M-K\^E\0 \^D\M^?\M^?\^?\^W\^U\^R\M^?\^C\^\\^Z\
\^Y\^Q\^S\^V\^O\^A\0\^T\M^?\0\M^V\0\0\0\M^V\0\0"
41 1 ls RET ioctl 0
41 1 ls CALL ioctl(1,TIOCGWINSZ,0xbfbfeda4)
41 1 ls GIO fd 1 read 8 bytes
"0\0P\0\0\0\0\0"
41 1 ls RET ioctl 0
41 1 ls CALL getuid
41 1 ls RET getuid 0
41 1 ls CALL compat_43_stat43(0xbfbfeda2,0xbfbfed48)
41 1 ls RET compat_43_stat43 -1 errno 78 Function not
implemented
41 1 ls PSIG SIGSYS SIG_DFL: code=SI_NOINFO
41 1 ls NAMI "ls.core"
# ktrace /emul/nbsd-09/bin/echo test; kdump
[1] Bad system call (core dumped) ktrace /emul/nbsd-09/bin/echo test
332 1 ktrace EMUL "netbsd"
332 1 ktrace CALL execve(0xbfbad76f,0xbfbad29c,0xbfbad2a8)
332 1 ktrace NAMI "/emul/nbsd-09/bin/echo"
332 1 echo EMUL "netbsd"
332 1 echo RET execve JUSTRETURN
332 1 echo CALL compat_43_fstat43(1,0xbfbfeab0)
332 1 echo RET compat_43_fstat43 -1 errno 78 Function not
implemented
332 1 echo PSIG SIGSYS SIG_DFL: code=SI_NOINFO
332 1 echo NAMI "echo.core"
I could not test other Net/2 derived i386 BSD releases that would rely on
43_COMPAT syscalls on 9.0 (386BSD 0.1, NetBSD 0.8, and BSD/OS 1.0) because
they fail with an executable format error starting with release NetBSD 8.0.
Those binaries and NetBSD 0.9 binaries ran on release 7.
>How-To-Repeat:
Run NetBSD 0.9 binaries using the default options in GENERIC or MONOLITHIC
kernels.
Both kernels failed with the errors above, although COMPAT_43 is included by
the /usr/src/sys/conf/compat_netbsd.config that's included from /usr/src/sys/
conf/compat_netbsd09.config by default.
>Fix:
Unknown
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Thu, 27 Feb 2020 13:25:55 +0000
Responsible-Changed-Why:
It's my bug
From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@netbsd.org
Cc: dplassche@gmail.com
Subject: Re: kern/55025: COMPAT_09 Syscall Failures on NetBSD 9.0 i386 (Change
from 8.0)
Date: Thu, 27 Feb 2020 08:03:58 -0800 (PST)
I've got a fix for this, and will test it as soon as some other build
breakage gets resolved.
HOWEVER, the fix will _not_ make it into the 9.0 release, since that
has already been built. The fix will get into subsequent maintenance
releases (ie, 9.1) and into 10.0. If you need the fix sooner, you'll
be needing to build and run a custom kernel from HEAD.
+--------------------+--------------------------+-----------------------+
| 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 <paul@whooppee.com>
To: gnats-bugs@netbsd.org
Cc: dplassche@gmail.com
Subject: Re: kern/55025: COMPAT_09 Syscall Failures on NetBSD 9.0 i386 (Change
from 8.0)
Date: Thu, 27 Feb 2020 09:03:31 -0800 (PST)
On Thu, 27 Feb 2020, Paul Goyette wrote:
> I've got a fix for this, and will test it as soon as some other build
> breakage gets resolved.
>
> HOWEVER, the fix will _not_ make it into the 9.0 release, since that
> has already been built. The fix will get into subsequent maintenance
> releases (ie, 9.1) and into 10.0. If you need the fix sooner, you'll
> be needing to build and run a custom kernel from HEAD.
As pointed out in private email, the fix will also be available in a
daily build from the NetBSD-9 branch, once the fix is committed _and_
the pullup to the branch is complete.
+--------------------+--------------------------+-----------------------+
| 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/55025 CVS commit: src/sys/compat/common
Date: Thu, 27 Feb 2020 18:19:16 +0000
Module Name: src
Committed By: pgoyette
Date: Thu Feb 27 18:19:16 UTC 2020
Modified Files:
src/sys/compat/common: vfs_syscalls_43.c
Log Message:
Include all of the vfs syscalls in the syscall_package, not just oquota.
Should fix PR kern/55025
XXX pullup-9
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/common/vfs_syscalls_43.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->pending-pullups
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Thu, 27 Feb 2020 18:26:11 +0000
State-Changed-Why: fix committed - pending pullup-9 #741
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/55025 CVS commit: [netbsd-9] src/sys/compat/common
Date: Thu, 27 Feb 2020 19:00:05 +0000
Module Name: src
Committed By: martin
Date: Thu Feb 27 19:00:05 UTC 2020
Modified Files:
src/sys/compat/common [netbsd-9]: vfs_syscalls_43.c
Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #741):
sys/compat/common/vfs_syscalls_43.c: revision 1.65
Include all of the vfs syscalls in the syscall_package, not just oquota.
Should fix PR kern/55025
XXX pullup-9
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.64.4.1 src/sys/compat/common/vfs_syscalls_43.c
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: Thu, 27 Feb 2020 20:02:16 +0000
State-Changed-Why:
Ticket pullup-9 #741 committed to the branch.
From: Dan Plassche <dplassche@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pgoyette@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
martin@netbsd.org
Subject: Re: kern/55025: COMPAT_09 Syscall Failures on NetBSD 9.0 i386 (Change
from 8.0)
Date: Thu, 27 Feb 2020 21:27:03 -0500
> On Thu, 27 Feb 2020, Paul Goyette wrote:
>
> > I've got a fix for this, and will test it as soon as some other build
> > breakage gets resolved.
> >
> > HOWEVER, the fix will _not_ make it into the 9.0 release, since that
> > has already been built. The fix will get into subsequent maintenance
> > releases (ie, 9.1) and into 10.0. If you need the fix sooner, you'll
> > be needing to build and run a custom kernel from HEAD.
Thanks Paul. I updated from HEAD via anoncvs around 5:30 EST today,
rebuilt the kernel/modules, and I was able to run NetBSD 0.9 binaries
successfully. As a test, I tried making world and making a kernel in
a NetBSD 0.9 chroot, which was all done successfully in 60 seconds :)
This is great!
# uname -a
NetBSD nbsd90-32-vmw.bsdnix.net 9.99.48 NetBSD 9.99.48 (GENERIC) #0: Thu
Feb 27 17:54:33 EST 2020 dp@nbsd90-32-vmw.bsdnix.net:/usr/src/sys/arch/i386/
compile/GENERIC i386
# chroot /emul/nbsd-09-build
ash: need new tty driver to run job control; job control turned off
# cd /usr/src
# time make
...
55.43 real 28.01 user 22.84 sys
# cd /usr/src/sys/arch/i386/conf
# config GENERICAHBBT
maxfdescs not specified; 2048 assumed
Don't forget to run "make depend"
# cd ../compile/GENERICAHBBT
# time make
...
loading netbsd
rearranging symbols
text data bss dec hex
434176 20480 107300 561956 89324
3.49 real 2.00 user 1.28 sys
This issue appears to be fully resolved.
Note: I will follow-up to send a separate PR to document the situation
I mentioned earlier where older 386BSD, NetBSD 0.8, and BSD/OS
(BSD/386) Q/ZMagic binaries that are under COMPAT_NOMID no longer
execute (exec format error) since NetBSD 8.0. That's a separate
matter.
Best,
Dan Plassche
From: Dan Plassche <dplassche@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pgoyette@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
martin@netbsd.org
Subject: Re: kern/55025: COMPAT_09 Syscall Failures on NetBSD 9.0 i386 (Change
from 8.0)
Date: Sat, 29 Feb 2020 07:57:53 -0500
On Thu, Feb 27, 2020 at 9:27 PM Dan Plassche <dplassche@gmail.com> wrote:
>
> Note: I will follow-up to send a separate PR to document the situation
> I mentioned earlier where older 386BSD, NetBSD 0.8, and BSD/OS
> (BSD/386) Q/ZMagic binaries that are under COMPAT_NOMID no longer
> execute (exec format error) since NetBSD 8.0. That's a separate
> matter.
I found the resolution to the exec format error and confirmed that
these q and zmagic binaries work following the COMPAT_43 syscall fix
on 9.0 (i386).
The binaries execute if you set "sysctl -w vm.user_va0_disable=0" on
release 7, 8, and 9.
On NetBSD 9 you also need to build a custom kernel with "options
COMPAT_NOMID" (was included in GENERIC on 7 and 8) and the pullup from
this PR for the binaries to run properly.
BSD/386 (BSD/OS) 1.0 binaries had worked on 7 without the memory
protection disabled.
Just wanted to document that this was working as a final follow-up on
my earlier report.
Thanks,
Dan
>Unformatted:
(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.