NetBSD Problem Report #43835

From njoly@lanfeust.sis.pasteur.fr  Fri Sep  3 13:45:41 2010
Return-Path: <njoly@lanfeust.sis.pasteur.fr>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id AECE463B8C3
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  3 Sep 2010 13:45:41 +0000 (UTC)
Message-Id: <20100903134536.5C17DDC9BB@lanfeust.sis.pasteur.fr>
Date: Fri,  3 Sep 2010 15:45:36 +0200 (CEST)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: ksh(1) regression under compat_netbsd32
X-Send-Pr-Version: 3.95

>Number:         43835
>Category:       port-amd64
>Synopsis:       ksh(1) regression under compat_netbsd32
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 03 13:50:01 +0000 2010
>Closed-Date:    Sun Sep 05 22:38:24 +0000 2010
>Last-Modified:  Tue Sep 07 19:40:09 +0000 2010
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.39
>Organization:
Intitut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 5.99.39 NetBSD 5.99.39 (LANFEUST) #14: Thu Sep 2 11:23:23 CEST 2010 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
i386 ksh(1) does not work anymore under compat_netbsd32 with the following
$HOME/.kshrc file ... No problem with native version.

njoly@lanfeust [~]> cat .kshrc
ARCH=$(uname -m)
echo $ARCH

njoly@lanfeust [~]> file /bin/ksh 
/bin/ksh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for NetBSD 5.99.39, not stripped
njoly@lanfeust [~]> /bin/ksh   
amd64
$ 

njoly@lanfeust [~]> file /misc/chroot/netbsd32/bin/ksh 
/misc/chroot/netbsd32/bin/ksh: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for NetBSD 5.99.39, not stripped
njoly@lanfeust [~]> /misc/chroot/netbsd32/bin/ksh 
njoly@lanfeust [~]> echo $?
255

Tracing show that netbsd32_setcontext() syscall is failling:
[...]
 25351      1 ksh      RET   netbsd32___getrusage50 0
 25351      1 ksh      CALL  netbsd32___gettimeofday50(0xffffd2cc,0)
 25351      1 ksh      RET   netbsd32___gettimeofday50 0
 25351      1 ksh      CALL  netbsd32___wait450(0xffffffff,0xffffd348,3,0)
 25351      1 ksh      RET   netbsd32___wait450 -1 errno 10 No child processes
 25351      1 ksh      CALL  netbsd32_setcontext(0xffffd41c,0xffffd41c,0x14)
 25351      1 ksh      RET   netbsd32_setcontext -1 errno 22 Invalid argument
 25351      1 ksh      CALL  netbsd32_exit(0xffffffff)

>How-To-Repeat:
Run i386 ksh(1) under compat_netbsd32, with appropriate .kshrc file
>Fix:

>Release-Note:

>Audit-Trail:
From: Chuck Silvers <chs@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43835 CVS commit: src/sys/arch/amd64
Date: Sun, 5 Sep 2010 20:14:40 +0000

 Module Name:	src
 Committed By:	chs
 Date:		Sun Sep  5 20:14:40 UTC 2010

 Modified Files:
 	src/sys/arch/amd64/amd64: netbsd32_machdep.c
 	src/sys/arch/amd64/include: segments.h

 Log Message:
 in check_mcontext32(), accept the LDT selector for 32-bit user code
 as well as the GDT selector.  fixes PR 43835.


 To generate a diff of this commit:
 cvs rdiff -u -r1.65 -r1.66 src/sys/arch/amd64/amd64/netbsd32_machdep.c
 cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amd64/include/segments.h

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

State-Changed-From-To: open->feedback
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 05 Sep 2010 20:26:28 +0000
State-Changed-Why:
chs committed a fix, fine now?


From: Nicolas Joly <njoly@pasteur.fr>
To: gnats-bugs@NetBSD.org
Cc: port-amd64-maintainer@netbsd.org, netbsd-bugs@netbsd.org,
	gnats-admin@netbsd.org, wiz@NetBSD.org, njoly@pasteur.fr
Subject: Re: port-amd64/43835 (ksh(1) regression under compat_netbsd32)
Date: Mon, 6 Sep 2010 00:07:56 +0200

 On Sun, Sep 05, 2010 at 08:26:29PM +0000, Thomas Klausner wrote:
 > Synopsis: ksh(1) regression under compat_netbsd32
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: wiz@NetBSD.org
 > State-Changed-When: Sun, 05 Sep 2010 20:26:28 +0000
 > State-Changed-Why:
 > chs committed a fix, fine now?

 Yes, problem gone.

 Thanks.

 -- 
 Nicolas Joly

 Biological Software and Databanks.
 Institut Pasteur, Paris.

State-Changed-From-To: feedback->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 05 Sep 2010 22:38:24 +0000
State-Changed-Why:
Confirmed fixed, thanks for the feedback!


From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43835 CVS commit: [netbsd-5] src/sys/arch/amd64
Date: Tue, 7 Sep 2010 19:38:21 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Tue Sep  7 19:38:21 UTC 2010

 Modified Files:
 	src/sys/arch/amd64/amd64 [netbsd-5]: netbsd32_machdep.c
 	src/sys/arch/amd64/include [netbsd-5]: segments.h

 Log Message:
 Pull up following revision(s) (requested by chs in ticket #1449):
 	sys/arch/amd64/amd64/netbsd32_machdep.c: revisions 1.66, 1.67
 	sys/arch/amd64/include/segments.h: revision 1.21
 in check_mcontext32(), accept the LDT selector for 32-bit user code
 as well as the GDT selector.  fixes PR 43835.
 accept the LDT selector in check_sigcontext32() too.


 To generate a diff of this commit:
 cvs rdiff -u -r1.55.4.2 -r1.55.4.3 \
     src/sys/arch/amd64/amd64/netbsd32_machdep.c
 cvs rdiff -u -r1.19 -r1.19.4.1 src/sys/arch/amd64/include/segments.h

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

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43835 CVS commit: [netbsd-5-0] src/sys/arch/amd64
Date: Tue, 7 Sep 2010 19:38:45 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Tue Sep  7 19:38:45 UTC 2010

 Modified Files:
 	src/sys/arch/amd64/amd64 [netbsd-5-0]: netbsd32_machdep.c
 	src/sys/arch/amd64/include [netbsd-5-0]: segments.h

 Log Message:
 Pull up following revision(s) (requested by chs in ticket #1449):
 	sys/arch/amd64/amd64/netbsd32_machdep.c: revisions 1.66, 1.67
 	sys/arch/amd64/include/segments.h: revision 1.21
 in check_mcontext32(), accept the LDT selector for 32-bit user code
 as well as the GDT selector.  fixes PR 43835.
 accept the LDT selector in check_sigcontext32() too.


 To generate a diff of this commit:
 cvs rdiff -u -r1.55.6.1 -r1.55.6.2 \
     src/sys/arch/amd64/amd64/netbsd32_machdep.c
 cvs rdiff -u -r1.19 -r1.19.10.1 src/sys/arch/amd64/include/segments.h

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.