Bug#884662: fakeroot: regular files sometimes treated as directories

Mattia Rizzolo mattia at debian.org
Mon Jan 18 23:34:38 GMT 2021


Control: reassign -1 fakeroot 1.22-1
Control: retitle -1 fakeroot: regular files sometimes treated as directories when they are removed without fakeroot knowing
Control: affects -1 jenkins.debian.org

On Thu, Oct 08, 2020 at 01:39:09PM +0200, Christoph Berg wrote:
> > On Mon, 18 Dec 2017 at 23:30:05 +0000, Simon McVittie wrote:
> > > dpkg-deb: building package 'libglib2.0-data' in '../libglib2.0-data_2.54.2-2_all.deb'.
> > > tar: ./usr/share/locale/en_CA/LC_MESSAGES/glib20.mo/: Cannot savedir: Not a directory
> > 
> > This seems to be a symptom of some more general problem on the
> > reproducible-builds builders - I would guess it's either the
> > (FUSE?) filesystem, or a LD_PRELOAD hack that intercepts stat(), like
> > fakeroot does.
> 
> This "Not a directory" problem has started popping up in PostgreSQL
> build logs:
> 
> https://buildd.debian.org/status/fetch.php?pkg=pgagent&arch=alpha&ver=4.0.0-7&stamp=1602009768&raw=0

yay, at least we can't say it's a r-b infra problem only! \o/

> https://buildd.debian.org/status/fetch.php?pkg=pgagent&arch=sparc64&ver=4.0.0-7&stamp=1601991893&raw=0
> 
> It has also been seen on amd64.

> PG extension packages have started to run tests at build time, which
> is done via pg_virtualenv. Internally, for creating the temporary
> PostgreSQL server instance, LD_PRELOAD is unset, and that seems to be
> what confuses the "dh" and dpkg-buildpackage processes that share the
> same fakeroot instance.
> 
> jwilk did some debugging (thanks!) and came up with this simple
> recipe:
> 
> $ fakeroot sh -c 'mkdir foo; env -u LD_PRELOAD rmdir foo; touch bar; stat bar | grep directory' Size: 0               Blocks: 0          IO Block: 4096 directory
> 
> So, if "foo" is removed without fakeroot knowing, the "bar" file is
> reported as a directory. (It doesn't get it wrong for me, it depends
> on inode numbers being recycled and similar.)

Thank you for providing such simple reproducer!

The fact that it depends on inode number recylcing also expains why we
saw it more often in tests.r-b.o, since there we have many more
concurrent builds and as such more writes.

> jwilk also noted that glib-2.0's debian/rules unsets LD_PRELOAD for
> the test suite too which strengthens the evidence that fakeroot is to
> blame.

As such, I'm finally reasigning this bug to fakeroot, thank you to all
you involved in debugging the matter!

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
More about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-dev/attachments/20210119/9f11310c/attachment-0001.sig>


More information about the Qa-jenkins-dev mailing list