NetBSD Problem Report #47172

From martin@aprisoft.de  Thu Nov  8 09:02:26 2012
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 04EC563B95F
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  8 Nov 2012 09:02:25 +0000 (UTC)
Message-Id: <20121108090215.B40A1ED0E48@emmas.aprisoft.de>
Date: Thu,  8 Nov 2012 10:02:15 +0100 (CET)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: ast-ksh vs. posix_spawn
X-Send-Pr-Version: 3.95

>Number:         47172
>Category:       kern
>Synopsis:       ast-ksh vs. posix_spawn
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 08 09:05:00 +0000 2012
>Closed-Date:    Mon Jan 07 13:41:27 +0000 2013
>Last-Modified:  Mon Jan 07 13:41:27 +0000 2013
>Originator:     Martin Husemann
>Release:        NetBSD 6.99.14
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD whoever-brings-the-night.aprisoft.de 6.99.14 NetBSD 6.99.14 (WHOEVER) #7: Sat Oct 27 14:11:49 CEST 2012 martin@emmas.aprisoft.de:/usr/src/sys/arch/sparc64/compile/WHOEVER sparc64
Architecture: sparc64
Machine: sparc64
>Description:

When building pkgsrc/shells/ast-ksh on a NetBSD version that has posix_spawn
(6 or newer), the resulting shell misbehaves:

[/tmp] martin@whoever-brings-the-night > /usr/pkg/bin/ksh93
$ ls
[1] +                          ls
$ dbus-wfVo2LqkzB     dump                ktrace.out          ssh-0000000494aa
^D

The problem does not show up when ast-ksh does not detect posix_spawn.

Likely part of the problem is the failing setpgid here:
 12901      1 ksh93    CALL  posix_spawn(0xffffffffffffa478,0x40385bd1,0,0xffffffffffffa448,0x403859f8,0x40385ae0)
 12901      1 ksh93    NAMI  "/bin/ls"
 12901      1 ksh93    NAMI  "/libexec/ld.elf_so"
 12296      1 ls       EMUL  "netbsd"
 12901      1 ksh93    RET   posix_spawn 0, 1077435345/0x40385bd1
 12901      1 ksh93    CALL  __sigaction_sigtramp(SIGTTIN,0xffffffffffffaf90,0xffffffffffffaf70,0x40b4b6a0,2)
 12901      1 ksh93    RET   __sigaction_sigtramp 0, -20592/0xffffffffffffaf90
 12901      1 ksh93    CALL  __sigaction_sigtramp(SIGTTOU,0xffffffffffffaf90,0xffffffffffffaf70,0x40b4b6a0,2)
 12901      1 ksh93    RET   __sigaction_sigtramp 0, -20592/0xffffffffffffaf90
 12901      1 ksh93    CALL  setpgid(0x3008,0x3008)
 12901      1 ksh93    RET   setpgid -1 errno 13 Permission denied


Failure has been pointed out on netbsd-users:
  http://mail-index.netbsd.org/netbsd-users/2012/11/06/msg011840.html

>How-To-Repeat:
s/a
>Fix:
n/a

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Thu, 08 Nov 2012 09:15:49 +0000
Responsible-Changed-Why:
Take


From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, martin@NetBSD.org, kern-bug-people@netbsd.org, 
	netbsd-bugs@netbsd.org, gnats-admin@netbsd.org
Cc: 
Subject: Re: kern/47172 (ast-ksh vs. posix_spawn)
Date: Thu, 8 Nov 2012 12:42:32 -0500

 On Nov 8,  9:15am, martin@NetBSD.org (martin@NetBSD.org) wrote:
 -- Subject: Re: kern/47172 (ast-ksh vs. posix_spawn)

 Fixed in kern_exec.c 1.358

 christos

State-Changed-From-To: open->pending-pullups
State-Changed-By: martin@NetBSD.org
State-Changed-When: Fri, 09 Nov 2012 08:22:54 +0000
State-Changed-Why:
Confirmed fix, waiting for pullup-6 #670


State-Changed-From-To: pending-pullups->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Mon, 07 Jan 2013 13:41:27 +0000
State-Changed-Why:
pullups done


>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.