On 9/28/07, Clint Adams <[EMAIL PROTECTED]> wrote:
> On Fri, Sep 28, 2007 at 05:26:15PM +0200, Martin Michlmayr wrote:
> > Since version 1.8, many (but not all) of my daily debian-installer
> > builds fail with:
> >
> > | Database load failed
> > | fakeroot: error while starting the `faked' daemon.
> > | kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... 
> > or kill -l [sigspec]
> >
> > Seems like the change in 1.8 introduced a race.
> >
> > This is on mipsel.
> >
> > Linux swarm 2.6.18-1-sb1-bcm91250a #1 SMP Wed Oct 18 15:19:17 UTC 2006 
> > mips64 GNU/Linux
>
> Jan, thoughts?
>

Ouch! I see a possibility of faked dropping into an endless loop due
to my patch (if the save file does not exist, and the uninitialized
struct stat s is accidentally such that the S_FIFO bit is set in
s.st_mode). That was really stupid of me. The attached
faked-1.8-oo.patch should fix it.

However, if faked runs into an infinite loop, the fakeroot script
should block waiting for it. Moreover, mktemp in
debian-installer/installer/build/daily-build creates the file before
fakeroot is run, so in Martin's case faked couldn't get into the loop.
So this doesn't explain why one faked tries to read the save file
while another faked is in the middle of writing it -- if that's what
happens. I've got d-i sources from svn, and run daily-build three or
four times with no errors on an athlon box. I'm not getting any errors
from my fakeroot/rsync backup scripts either.

Martin, please, try faked-1.8-oo.patch. I don't believe it can help,
but just in case... I'll send you some debugging patches against d-i's
daily-build and faked.c in a day or two. I'm too tired to put them
together now. I really can't tell what's wrong without some more
input. BTW, are you sure your previous version of fakeroot was 1.7.1?

Regards.

                                                  Jan
diff -ru fakeroot-1.8/faked.c fakeroot-1.8.1/faked.c
--- fakeroot-1.8/faked.c	2007-09-20 19:48:12.000000000 +0200
+++ fakeroot-1.8.1/faked.c	2007-10-08 00:09:59.000000000 +0200
@@ -468,7 +468,12 @@
     int r,fd=0;
     struct stat s;
     r=stat(save_file,&s);
-    if (r<0 && errno != ENOENT) return EOF;
+    if (r<0) {
+       if (errno == ENOENT)
+	  break;
+       else
+	  return EOF;
+    }
     if (!(s.st_mode&S_IFIFO)) break;
     fd=open(save_file,O_WRONLY|O_NONBLOCK);
     if (fd<0) {

Reply via email to