Debian Bug report logs - #414601
fakeroot: sometimes treats copied files as directories

version graph

Package: fakeroot; Maintainer for fakeroot is Clint Adams <clint@debian.org>; Source for fakeroot is src:fakeroot.

Reported by: Ari Pollak <ari@debian.org>

Date: Wed, 21 Feb 2007 11:48:02 UTC

Severity: normal

Fixed in version 1.10.1

Done: Clint Adams <schizo@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Ari Pollak <ari@debian.org>:
Bug#411843; Package drscheme. Full text and rfc822 format available.

Acknowledgement sent to Lucas Nussbaum <lucas@lucas-nussbaum.net>:
New Bug report received and forwarded. Copy sent to Ari Pollak <ari@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Lucas Nussbaum <lucas@lucas-nussbaum.net>
To: submit@bugs.debian.org
Subject: drscheme: FTBFS: du: `./usr/share/plt/doc/doc-license.txt': Not a directory
Date: Wed, 21 Feb 2007 12:01:13 +0100
Package: drscheme
Version: 1:352-6
Severity: serious
Justification: FTBFS on i386, very likely to fail everywhere else
Usertags: grid5000 rebuild

Hi,

During a rebuild of all packages in etch, I discovered that your package
failed to build on i386.

Relevant parts:
dh_link -pdrscheme  
Can't cd to (debian/drscheme/usr/share/plt/doc/) doc-license.txt: Not a directory
 at /usr/bin/dh_link line 160
dh_installdocs -pmzscheme   
dh_installexamples -pmzscheme 
dh_installman -pmzscheme  
dh_installinfo -pmzscheme  
dh_installmenu -pmzscheme 
dh_installcron -pmzscheme 
dh_installinit -pmzscheme   
dh_installdebconf -pmzscheme 
dh_installemacsen -pmzscheme   
dh_installcatalogs -pmzscheme 
dh_installpam -pmzscheme 
dh_installlogrotate -pmzscheme 
dh_installlogcheck -pmzscheme 
dh_installmime -pmzscheme 
dh_installchangelogs -pmzscheme   
dh_installudev -pmzscheme 
dh_install -pmzscheme  
dh_link -pmzscheme  
dh_strip -pdrscheme  
Can't cd to (debian/drscheme/usr/share/plt/doc/) doc-license.txt: Not a directory
 at /usr/bin/dh_strip line 192
dh_compress -pdrscheme  
dh_fixperms -pdrscheme  
dh_makeshlibs -pdrscheme  
dh_strip -pmzscheme  
dh_compress -pmzscheme  
dh_fixperms -pmzscheme  
dh_makeshlibs -pmzscheme  
dh_installdeb -pdrscheme 
dh_perl -pdrscheme 
Can't cd to (debian/drscheme/usr/share/plt/doc/) doc-license.txt: Not a directory
 at /usr/bin/dh_perl line 116
dh_shlibdeps -pdrscheme    
couldn't open /etc/ld.so.conf: No such file or directory at /usr/bin/dpkg-shlibdeps line 155.
dh_installdeb -pmzscheme 
dh_perl -pmzscheme 
dh_shlibdeps -pmzscheme    
couldn't open /etc/ld.so.conf: No such file or directory at /usr/bin/dpkg-shlibdeps line 155.
dh_gencontrol -pdrscheme 
du: `./usr/share/plt/doc/doc-license.txt': Not a directory
dpkg-gencontrol: failure: du in `debian/drscheme' gave error exit status 1
dh_gencontrol: command returned error code 256
make: *** [binary-makedeb-IMPL/drscheme] Error 1

This doesn't happen during every build: I built it three times, and it failed
twice.

The full build log is available from 
http://people.debian.org/~lucas/logs/2007/02/20/

About the archive rebuilt: The rebuilt was done on about 50 AMD64 nodes
of the Grid'5000 platform, using a clean chroot containing an etch i386
environment (not unstable).  Internet was not accessible from the build
systems. The builds were processed as root.

About Grid'5000:
Grid'5000 is an highly reconfigurable experimental Grid platform
gathering 9 sites and featuring a total of 5000 CPUs. It serves as a
testbed for research in Grid Computing. See https://www.grid5000.fr/
-- 
| Lucas Nussbaum
| lucas@lucas-nussbaum.net   http://www.lucas-nussbaum.net/ |
| jabber: lucas@nussbaum.fr             GPG: 1024D/023B3F4F |



Information forwarded to debian-bugs-dist@lists.debian.org, Ari Pollak <ari@debian.org>:
Bug#411843; Package drscheme. Full text and rfc822 format available.

Acknowledgement sent to Steve Langasek <vorlon@debian.org>:
Extra info received and forwarded to list. Copy sent to Ari Pollak <ari@debian.org>. Full text and rfc822 format available.

Message #10 received at 411843@bugs.debian.org (full text, mbox):

From: Steve Langasek <vorlon@debian.org>
To: Lucas Nussbaum <lucas@lucas-nussbaum.net>, 411843@bugs.debian.org
Subject: Re: Bug#411843: drscheme: FTBFS: du: `./usr/share/plt/doc/doc-license.txt': Not a directory
Date: Wed, 21 Feb 2007 11:33:45 -0800
severity 411843 important
tags 411843 moreinfo unreproducible
thanks

On Wed, Feb 21, 2007 at 12:01:13PM +0100, Lucas Nussbaum wrote:
> Justification: FTBFS on i386, very likely to fail everywhere else

> This doesn't happen during every build: I built it three times, and it failed
> twice.

I've tried to rebuild the package 4 times, and it hasn't failed for me once
yet.

Having du error out is a *very* strange error condition.  If this problem is
reproducible, please inspect the results of a failed build so that we can
understand why du thinks this *should* be a directory instead of a file, and
what it actually is.

I fear, given the error message, that a filesystem error is as likely as a
package build problem.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/



Severity set to `important' from `serious' Request was from Steve Langasek <vorlon@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags added: moreinfo, unreproducible Request was from Steve Langasek <vorlon@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Bug 411843 cloned as bug 414601. Request was from Ari Pollak <ari@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Bug reassigned from package `drscheme' to `fakeroot'. Request was from Ari Pollak <ari@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug title. Request was from Ari Pollak <ari@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Blocking bugs of 411843 added: 414601 Request was from Ari Pollak <ari@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags removed: unreproducible Request was from Ari Pollak <ari@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags removed: moreinfo Request was from Ari Pollak <ari@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug submitter from Lucas Nussbaum <lucas@lucas-nussbaum.net> to Ari Pollak <ari@debian.org>. Request was from Ari Pollak <ari@debian.org> to control@bugs.debian.org. (Thu, 15 Mar 2007 19:18:02 GMT) Full text and rfc822 format available.

Message sent on to Ari Pollak <ari@debian.org>:
Bug#414601. Full text and rfc822 format available.

Message #31 received at 414601-submitter@bugs.debian.org (full text, mbox):

From: Clint Adams <schizo@debian.org>
To: 414601-submitter@bugs.debian.org
Subject: race condition?
Date: Sat, 14 Apr 2007 05:56:32 -0400
Give me a very simple always-reproducible test case.



Severity set to `normal' from `important' Request was from Clint Adams <schizo@debian.org> to control@bugs.debian.org. (Sun, 06 May 2007 20:51:11 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Clint Adams <schizo@debian.org>:
Bug#414601; Package fakeroot. Full text and rfc822 format available.

Acknowledgement sent to Michael Itz <mitz@metacarta.com>:
Extra info received and forwarded to list. Copy sent to Clint Adams <schizo@debian.org>. Full text and rfc822 format available.

Message #38 received at 414601@bugs.debian.org (full text, mbox):

From: Michael Itz <mitz@metacarta.com>
To: 414601@bugs.debian.org
Subject: fakeroot: sometimes treats copied files as directories
Date: Wed, 10 Sep 2008 17:29:37 -0400
We've run into something similar, and I think I can explain what's going 
on.  In our particular case, we're using pbuilder to build packages in a 
chroot and we're seeing that fakeroot will very rarely start reporting 
that a directory is a regular file.  Once it starts it will often do so 
for several runs, and then it will go back to working.

The culprit seems to be the statically linked ldconfig in the pbuilder 
chroot which runs shortly before a mkdir.  Since fakeroot can't wrap its 
calls, ldconfig is able to call unlink without fakeroot updating its 
database.  Then the inodes of the unlinked files can be reused for new 
files for which fakeroot will report out of date information.

In the most common failure we've seen, the inode that holds 
/etc/ld.so.cache is noted by fakeroot when it's untarred and chowned, 
then it's unlinked by ldconfig and the the same inode is given to a 
subsequent mkdir in /etc, which then stats as a file when it's really a 
directory.  It's probably also possible for ldconfig to remove a symlink 
and then have that inode reused for a regular file or directory later 
on, but I haven't seen that happen.

Because it requires an inode be reused, it's difficult to reproduce 
this.  It may be more likely to happen on almost empty or almost full 
filesystems.  I've had luck reproducing it somewhat consistently in very 
small loop mounts using the approach/hack pasted below.

I'm posting this under issue 414601 as it's closest to what we've seen, 
but I believe 366067 and 425007 could have the same or similar 
underlying cause and might warrant merging.

--------------

While fakerooted inside a chroot:

root@fuji:/# chmod 0644 /etc/ld.so.cache
root@fuji:/# stat /etc/ld.so.cache
  File: `/etc/ld.so.cache'
  Size: 9486            Blocks: 24         IO Block: 4096   regular file
Device: 700h/1792d      Inode: 61120       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2008-09-08 15:28:10.000000000 -0400
Modify: 2008-09-08 15:27:42.000000000 -0400
Change: 2008-09-08 15:28:04.000000000 -0400
root@fuji:/# /sbin/ldconfig
root@fuji:/# stat /etc/ld.so.cache
  File: `/etc/ld.so.cache'
  Size: 9486            Blocks: 24         IO Block: 4096   regular file
Device: 700h/1792d      Inode: 61076       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2008-09-08 15:28:41.000000000 -0400
Modify: 2008-09-08 15:28:20.000000000 -0400
Change: 2008-09-08 15:28:20.000000000 -0400
root@fuji:/# ./mkdirwithinode a 61120
trying for inode 61120
hit on try a4
root@fuji:/# stat a4
  File: `a4'
  Size: 4096            Blocks: 8          IO Block: 4096   regular file
Device: 700h/1792d      Inode: 61120       Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2008-09-08 15:28:52.000000000 -0400
Modify: 2008-09-08 15:28:52.000000000 -0400
Change: 2008-09-08 15:28:52.000000000 -0400
root@fuji:/# cd a4
root@fuji:/a4# ls
root@fuji:/a4# cd ..
root@fuji:/#

On that final stat, faked --debug prints:

FAKEROOT: r=56, received message type=1, message=3
FAKEROOT: process stat oldstate=dev:ino=(700:61120), mode=040755, 
own=(10062,100), nlink=2, rdev=0
FAKEROOT: (previously known): fake=dev:ino=(700:61120), mode=0100755, 
own=(0,0), nlink=2, rdev=0

Source of mkdirwithinode.c:

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {
    if(argc != 3) return -1;

    char *prefix = argv[1];
    long inode = atol(argv[2]);

    printf("trying for inode %d\n", inode);
    char filename[100];
    struct stat st;
    for(int i = 0; i < 1000; i++) {
        sprintf(filename, "%s%d", prefix, i);
        mkdir(filename, 0777);
        stat(filename, &st);
        if(st.st_ino == inode) {
            printf("hit on try %s%d\n", prefix, i);
            return 0;
        }
    }
    printf("failed\n");
    return 1;
}




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#414601; Package fakeroot. (Sat, 04 Oct 2008 18:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Clint Adams <schizo@debian.org>:
Extra info received and forwarded to list. (Sat, 04 Oct 2008 18:57:02 GMT) Full text and rfc822 format available.

Message #43 received at 414601@bugs.debian.org (full text, mbox):

From: Clint Adams <schizo@debian.org>
To: 414601@bugs.debian.org
Subject: fakeroot and drscheme
Date: Sat, 4 Oct 2008 18:55:36 +0000
Does 1.10.1 solve the problem?




Reply sent to Clint Adams <schizo@debian.org>:
You have taken responsibility. (Sun, 04 Jan 2009 04:15:02 GMT) Full text and rfc822 format available.

Notification sent to Ari Pollak <ari@debian.org>:
Bug acknowledged by developer. (Sun, 04 Jan 2009 04:15:02 GMT) Full text and rfc822 format available.

Message #48 received at 414601-done@bugs.debian.org (full text, mbox):

From: Clint Adams <schizo@debian.org>
To: 414601-done@bugs.debian.org
Subject: drscheme
Date: Sun, 4 Jan 2009 04:12:35 +0000
Version: 1.10.1

Reopen if not.




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 05 Feb 2009 07:25:55 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 06:33:31 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.