[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#45104: marked as done (setsid() breakage)



Your message dated Sat, 2 Oct 1999 17:15:15 -0400
with message-id <199910022115.RAA16799@frob.com>
and subject line setsid() breakage
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 15 Sep 1999 00:07:45 +0000
Received: (qmail 26522 invoked from network); 15 Sep 1999 00:07:45 -0000
Received: from sunu450.rz.ruhr-uni-bochum.de (134.147.222.33)
  by master.debian.org with SMTP; 15 Sep 1999 00:07:45 -0000
Received: (qmail 14278 invoked from network); 15 Sep 1999 00:07:41 -0000
Received: from dialppp-1-183.rz.ruhr-uni-bochum.de (HELO localhost) (mail@134.147.1.183)
  by mailhost.rz.ruhr-uni-bochum.de with SMTP; 15 Sep 1999 00:07:41 -0000
Received: from marcus by localhost with local (Exim 2.11 #1 (Debian))
	for submit@bugs.debian.org
	id 11R2FI-00007Z-00; Wed, 15 Sep 1999 01:44:20 +0200
Date: Wed, 15 Sep 1999 01:44:20 +0200
From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
To: submit@bugs.debian.org
Subject: setsid() breakage
Message-ID: <19990915014420.A321@ulysses.dhis.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.0pre1i
X-Debian-CC: bug-hurd@gnu.org
Organization: Marcus Brinkmann's Home

Package: libc0.2
Version: N/A

Hello,

the setsid() function does not behave correctly on the Hurd.

First, it returns an unconditional 0 at succesful operation, instead the
process group id.

Secondly, and this is currently the main problem with screen, it does
not disconnect properly from its controlling terminal. At least this
is how I interpret the behaviour. First, screen: screen calls setsid(), and
then does a read() on /dev/console while ignoring SIGTTIN. This leads to
a failure EIO (which means that it still has /dev/console as ctty).
Secondly, I tried to isolate a test case, which shows the errornous
behaviour.

The below program under Linux:

ulysses:/tmp# ./setsid
setsid: 360, Success
hello
read: 6, Success
world
ulysses:/tmp# world
bash: world: command not found

Under the Hurd:

hurd:/tmp# ./setsid
setsid: 0, (os/kern) successful
hello
world
hurd:/tests/setsid# hello
bash: hello: command not found
hurd:/tests/setsid# world
bash: world: command not found

Note that read() does not return.
Obviously, the keyboard input never reaches the child process.

===============================================================
#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>

main()
{
   int child, fd, length; 
   pid_t p;
   char b[16];
   
   fd=open("/dev/console",O_RDONLY,0);
   if (!fd)
     printf("open: %s\n", strerror(errno));

   child=fork();
   if(!child) {
      p = setsid();
      printf("%i, %s\n", p, strerror(errno));
      length = read(fd, 16, b);
      printf("read: %i, %s\n", length, strerror(errno));
   }
   sleep(5);
}
==============================================================

Thanks,
Marcus


-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org  Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
Marcus.Brinkmann@ruhr-uni-bochum.de                        PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/
---------------------------------------
Received: (at 45104-done) by bugs.debian.org; 2 Oct 1999 21:15:25 +0000
Received: (qmail 17131 invoked from network); 2 Oct 1999 21:15:24 -0000
Received: from r85aap012887.sbo-smr.ma.cable.rcn.com (HELO frob.com) (209.6.192.195)
  by master.debian.org with SMTP; 2 Oct 1999 21:15:24 -0000
Received: (from roland@localhost)
	by frob.com (8.9.1/8.9.1) id RAA16799;
	Sat, 2 Oct 1999 17:15:15 -0400
Date: Sat, 2 Oct 1999 17:15:15 -0400
Message-Id: <199910022115.RAA16799@frob.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Roland McGrath <roland@gnu.org>
To: Mark Kettenis <kettenis@wins.uva.nl>
Cc: Marcus.Brinkmann@ruhr-uni-bochum.de, bug-hurd@gnu.org,
        45104-done@bugs.debian.org
Subject: Re: setsid() breakage
In-Reply-To: Mark Kettenis's message of  Sat, 2 October 1999 21:03:35 +0200 <[🔎] 199910021903.VAA00105@delius.kettenis.nl>
X-Zippy-Says: HOORAY, Ronald!!  Now YOU can marry LINDA RONSTADT too!

>    Date: Fri, 1 Oct 1999 16:04:15 -0400
>    From: Roland McGrath <roland@gnu.org>
> 
>    I've checked in a different fix for this to libc 2.1, that I think is
>    correct and avoids some more busy-work.  But I have not tested this code at
>    all beyond compiling it, so please let me know how it is.  I think the
>    comments in the new code explain the rationale.
> 
> Looks good and seems to be working fine.

Great!  Thanks for the feedback.  
I am declaring the setsid bug report closed.


Reply to: