#606064 fakeroot: mklibs segfaults in an i386 chroot on an amd64 host

Package:
fakeroot
Source:
fakeroot
Description:
tool for simulating superuser privileges
Submitter:
Michael Gilbert
Date:
2010-12-06 04:30:05 UTC
Severity:
important
#606064#5
Date:
2010-12-06 04:29:51 UTC
From:
To:
package: fakeroot
version: 1.14.5-1
severity: important

Fakeroot seems to cause mklibs to segfault in an i386 chroot on an amd64 host.
This only happens when the file argument to mklibs is not an ELF file. The
following should reproduce the problem:

 $ export PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin
 $ fakeroot fakechroot debootstrap --variant fakechroot --arch=i386 squeeze ./chroot http://ftp.us.debian.org/debian
 $ fakeroot fakechroot chroot ./chroot/ mklibs -v --ldlib /lib/ld-linux.so.2 -d / /usr/bin/mklibs
 I: Using /lib/ld-linux.so.2 as dynamic linker.
 I: library reduction pass 1
 Objects:
 /usr/bin/fakeroot: line 178: 23845 Segmentation fault      FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB" "$@"

Note that under an amd64 chroot, the same command does not segfault:

 $ export PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin
 $ fakeroot fakechroot debootstrap --variant fakechroot --arch=amd64 squeeze ./chroot http://ftp.us.debian.org/debian
 $ fakeroot fakechroot chroot ./chroot/ mklibs -v --ldlib /lib/ld-linux.so.2 -d / /usr/bin/mklibs
 I: Using /lib/ld-linux.so.2 as dynamic linker.
 I: library reduction pass 1
 Objects:
 0 symbols, 0 unresolved
 I: stripping and copying dynamic linker.
 objcopy://ld-linux.so.2: Permission denied
 Command failed with status 1 : objcopy --strip-unneeded -R .note -R .comment /lib//ld-linux.so.2 //ld-linux.so.2

The error message seems to indicate that fakeroot is the culprit, but it very well
may be fakechroot.  This problem leads to failures when building d-i for i386.

Thanks for looking into this.

Best wishes,
Mike