bug-hurd
[Top][All Lists]
Advanced

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

fakeroot-tcp; select() bug?


From: Thomas Schwinge
Subject: fakeroot-tcp; select() bug?
Date: Thu, 13 Apr 2006 04:54:00 -0400
User-agent: Mutt/1.5.6+20040907i

On Wed, Apr 12, 2006 at 11:17:44PM +0200, olafBuddenhagen@gmx.net wrote:
> On Tue, Apr 11, 2006 at 06:45:04AM -0400, Thomas Schwinge wrote:
> 
> > tschwinge@clubber:~/tmp/ext2fs/filesystem.0.i$ while fakeroot-tcp sh -c 
> > `pwd`/ping > /dev/null; do date; done
> [...]
> > I stopped this experiment after a few minutes, because of ...
> > 
> > #v+
> > tschwinge@clubber:~$ ps -Af | grep faked-tcp | wc -l
> > 247
> > #v-
> 
> fakeroot is supposed to kill the faked process after the command
> finishes. Seems it doesn't happen in your case -- either a bug in the
> new fakeroot-tcp

Not a bug in fakeroot, but a feature in it and a bug in the Hurd or
glibc, I suppose.  It might be the select() bug that was already reported
a few times in the past.

#v+
fakeroot (1.4) unstable; urgency=low

[...]

  * Daemon support (TCP version): faked goes into "detached" mode when it
    receives SIGHUP: it will terminate as soon as all clients close their
    connections. The fakeroot script kills faked with SIGHUP instead of
    SIGTERM when it exits. This is done in order to provide a working
    (although isolated) fakeroot environment for daemon processes that are
    launched from a fakeroot session.
#v-

Here's a gdb backtrace of such a supposed-to-have-already-terminated
faked-tcp:

#v+
(gdb) bt
#0  0x0105326c in evc_wait () from /lib/libc.so.0.3
#1  0x01053b9e in mach_msg () from /lib/libc.so.0.3
#2  0x0105972d in _hurd_exec () from /lib/libc.so.0.3
#3  0x0113c465 in select () from /lib/libc.so.0.3
#4  0x08049bea in get_msg (listen_sd=3) at ../faked.c:793
#5  0x0804a373 in main (argc=1, argv=0x13ffccc) at ../faked.c:1178
(gdb) frame 5
#5  0x0804a373 in main (argc=1, argv=0x13ffccc) at ../faked.c:1178
1178      get_msg(sd);  /* we shouldn't return from this function */
(gdb) list
1173      }
1174
1175    #ifndef FAKEROOT_FAKENET
1176      get_msg();    /* we shouldn't return from this function */
1177    #else /* FAKEROOT_FAKENET */
1178      get_msg(sd);  /* we shouldn't return from this function */
1179    #endif /* FAKEROOT_FAKENET */
1180
1181      cleanup(-1);  /* if we do return, try to clean up and exit with a 
nonzero
1182                       return status */
(gdb) frame 4
#4  0x08049bea in get_msg (listen_sd=3) at ../faked.c:793
793         count = select(maxfd + 1, &readfds, NULL, NULL, NULL);
(gdb) list
788
789           FD_SET(sd, &readfds);
790           maxfd = MAX(sd, maxfd);
791         }
792
793         count = select(maxfd + 1, &readfds, NULL, NULL, NULL);
794         if (count < 0) {
795           if (errno == EINTR)
796             continue;
797
#v-


If someone feels like having a look at that...


Regards,
 Thomas


P.S. If you don't need the `fakerooting daemons' functionality, you can
work around this bug by s/HUP/TERM in /usr/bin/fakeroot, but that's--of
course--not a proper fix.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]