fakechroot icon indicating copy to clipboard operation
fakechroot copied to clipboard

/usr/sbin/chroot.fakechroot: line 105: 14031 Segmentation fault

Open cristianrz opened this issue 4 years ago • 5 comments

How to reproduce:

  • fakechroot version 2.19
  • devuan ascii
  • Download an ubuntu image from: https://us.images.linuxcontainers.org/images/ubuntu/focal/amd64/default/20200507_07:42/
  • fakechroot fakeroot chroot <dir> /bin/bash into the directory where it's extracted

Expected

  • chroot is successful

Actual

/usr/sbin/chroot.fakechroot: line 105: 14031 Segmentation fault      env -u FAKECHROOT_BASE_ORIG FAKECHROOT_CMD_ORIG= LD_LIBRARY_PATH="$fakechroot_chroot_paths" FAKECHROOT_BASE="$fakechroot_chroot_base" "$fakechroot_chroot_chroot" "${@:1:$(($fakechroot_chroot_n - 1))}" "${fakechroot_chroot_newroot#$FAKECHROOT_BASE_ORIG}" "${@:$(($fakechroot_chroot_n + 1))}"

Comments

Similar error on an Arch Linux image. Alpine Linux images work fine though.

cristianrz avatar May 07 '20 17:05 cristianrz

So we need to switch to proot till this segfault will be fixed?

QkiZMR avatar May 18 '20 09:05 QkiZMR

Hi,

I face the same issue running the sample command: fakechroot fakeroot debootstrap sid /tmp/isolated.

An error message comes out:

W: Failure trying to run: chroot /tmp/isolated dpkg-deb -f /var/cache/apt/archives/dpkg_1.20.5_amd64.deb Version
W: See /tmp/isolated/debootstrap/debootstrap.log for details
W: Failure trying to run: chroot /tmp/isolated mount -t proc proc /proc
W: See /tmp/isolated/debootstrap/debootstrap.log for details

Then, inside the debootstrap.log:

gpgv: Signature made Thu 30 Jul 2020 04:17:43 PM +08
gpgv:                using RSA key 16E90B3FDF65EDE3AA7F323C04EE7237B7D453EC
gpgv: Good signature from "Debian Archive Automatic Signing Key (9/stretch) <[email protected]>"
gpgv: Signature made Thu 30 Jul 2020 04:17:44 PM +08
gpgv:                using RSA key 0146DC6D4A0B2914BDED34DB648ACFD622F3D138
gpgv: Can't check signature: No public key
/usr/sbin/chroot.fakechroot: line 105:  9941 Segmentation fault      (core dumped) env -u FAKECHROOT_BASE_ORIG FAKECHROOT_CMD_ORIG= LD_LIBRARY_PATH="$fakechroot_chroot_paths" FAKECHROOT_BASE="$fakechroot_chroot_base" "$fakechroot_chroot_chroot" "${@:1:$(($fakechroot_chroot_n - 1))}" "${fakechroot_chroot_newroot#$FAKECHROOT_BASE_ORIG}" "${@:$(($fakechroot_chroot_n + 1))}"
/usr/sbin/chroot.fakechroot: line 105:  9975 Segmentation fault      (core dumped) env -u FAKECHROOT_BASE_ORIG FAKECHROOT_CMD_ORIG= LD_LIBRARY_PATH="$fakechroot_chroot_paths" FAKECHROOT_BASE="$fakechroot_chroot_base" "$fakechroot_chroot_chroot" "${@:1:$(($fakechroot_chroot_n - 1))}" "${fakechroot_chroot_newroot#$FAKECHROOT_BASE_ORIG}" "${@:$(($fakechroot_chroot_n + 1))}"

JiaHong-Lee avatar Jul 30 '20 10:07 JiaHong-Lee

I'm getting segfault at the same line trying to debootstrap Debian Buster on Ubuntu 20.04 when building image with buildah.

This is the failing command:

fakechroot -s fakeroot debootstrap --arch $(dpkg-architecture -q DEB_BUILD_ARCH) ${edition} ${my_deb_mnt} ${mirror}

The result with -s and without is exactly the same.

Failure:

W: Failure trying to run: chroot "/home/jazg/.local/share/containers/storage/vfs/dir/f163beec7a7663c55cae017d7012528820490ad3e07a558daefbcc287ce309b1" /bin/true
W: See /home/jazg/.local/share/containers/storage/vfs/dir/f163beec7a7663c55cae017d7012528820490ad3e07a558daefbcc287ce309b1/debootstrap/debootstrap.log for details
ERRO exit status 1

Log:

/usr/sbin/chroot.fakechroot: line 105: 61720 Segmentation fault      (core dumped) env -u FAKECHROOT_BASE_ORIG FAKECHROOT_CMD_ORIG= LD_LIBRARY_PATH="$fakechroot_chroot_paths" FAKECHROOT_BASE="$fakechroot_chroot_base" "$fakechroot_chroot_chroot" "${@:1:$(($fakechroot_chroot_n - 1))}" "${fakechroot_chroot_newroot#$FAKECHROOT_BASE_ORIG}" "${@:$(($fakechroot_chroot_n + 1))}"

Bootstrapping Ubuntu on Ubuntu works fine.

zgoda avatar Dec 01 '20 22:12 zgoda

Any updates on this? Facing the same error here.

steffenboe avatar Feb 16 '21 06:02 steffenboe

I too had this issue and came here whilst attempting to chroot into a Ubuntu 20.04 environment from a Ubuntu 18.04 using fakechroot. I think this issue arises when your host environments libraries are incompatible with the environment you are attempting to chroot into.

I use it to build system environments without the need to run anything as root. So for me I was able to create a new 20.04 environment to run the builds for. The target systems also being 20.04. This works as expected.

mangodan2003 avatar Mar 05 '21 11:03 mangodan2003