Repository navigation
Description
Describe the bug
Usually, you can run another Fedora release with toolbox by doing:
# On Fedora 32
$ toolbox create --release 31
Created container: fedora-toolbox-31
Enter with: toolbox enter --release 31
$ toolbox enter --release 31
But at Fedora Rawhide you get the following error:
# On Fedora 33
$ toolbox create --release 32
Created container: fedora-toolbox-32
Enter with: toolbox enter --release 32
$ toolbox enter --release 32
Error: invalid entry point PID of container fedora-toolbox-32
The full debug output:
$ toolbox -v enter -r 32
DEBU Running as real user ID 1000
DEBU Resolved absolute path to the executable as /usr/local/bin/toolbox
DEBU Running on a cgroups v2 host
DEBU Checking if /etc/subgid and /etc/subuid have entries for user vagrant
DEBU TOOLBOX_PATH is /usr/local/bin/toolbox
DEBU Toolbox config directory is /home/vagrant/.config/toolbox
DEBU Current Podman version is 2.1.0-dev
DEBU Old Podman version is 2.1.0-dev
DEBU Migration not needed: Podman version 2.1.0-dev is unchanged
DEBU Resolving container and image names
DEBU Container: ''
DEBU Image: ''
DEBU Release: '32'
DEBU Resolved container and image names
DEBU Container: 'fedora-toolbox-32'
DEBU Image: 'fedora-toolbox:32'
DEBU Release: '32'
DEBU Checking if container fedora-toolbox-32 exists
DEBU Calling org.freedesktop.Flatpak.SessionHelper.RequestSession
DEBU Starting container fedora-toolbox-32
DEBU Inspecting entry point of container fedora-toolbox-32
DEBU Entry point PID is a float64
DEBU Entry point of container fedora-toolbox-32 is toolbox (PID=0)
Error: invalid entry point PID of container fedora-toolbox-32
Steps how to reproduce the behaviour
- Enter into a Fedora Rawhide/33 system.
- Compile and install the current Toolbox versions from the source.
- Create a new container from the previoues release (32) with:
$ toolbox create --release 32
- Try to enter at that container by typing:
$ toolbox enter --release 32
- It fails.
Expected behaviour
That toolbox would enter the container normally.
Actual behaviour
It fails to perform enter on the container.
Output of toolbox --version (v0.0.90+)
toolbox version 0.0.93
Toolbox package info (rpm -q toolbox)
It was installed from the sources, no toolbox package installed.
Output of podman version
Version: 2.1.0-dev
API Version: 1
Go Version: go1.15rc2
Built: Thu Jan 1 00:00:00 1970
OS/Arch: linux/amd64
Podman package info (rpm -q podman)
podman-2.1.0-0.169.dev.git162625f.fc33.x86_64`
Info about your OS
I tested in a virtual machine with Vagrant. The OS is Fedora 33.
It was a fresh installation from today (August 14th) and with all the packages updated.
Additional context
I tried with the releases 31 and 32. The release 33 (the same that the host) was working fine. Well, apart for the bug: #523
Also, I tied the same at another VM with Fedora 32 and it worked fine. I tried at that F32 VM with the releases 29, 31, 32 and 33, with no problems.
I notice though, that the entry point PID, the one from the error, was different. At the Rawhide system the PID was always 0, but at my system (Silverblue 32) and the VM (Fedora 32) were always a non-zero value. Something like PID=32612 and such.
For example (inside Fedora 32 VM):
$ toolbox -v enter -r 29
DEBU Running as real user ID 1000
DEBU Resolved absolute path to the executable as /usr/local/bin/toolbox
DEBU Running on a cgroups v2 host
DEBU Checking if /etc/subgid and /etc/subuid have entries for user vagrant
DEBU TOOLBOX_PATH is /usr/local/bin/toolbox
DEBU Toolbox config directory is /home/vagrant/.config/toolbox
DEBU Current Podman version is 2.0.2
DEBU Old Podman version is 2.0.2
...
DEBU Starting container fedora-toolbox-29
DEBU Inspecting entry point of container fedora-toolbox-29
DEBU Entry point PID is a float64
DEBU Entry point of container fedora-toolbox-29 is toolbox (PID=33068)
DEBU Waiting for container fedora-toolbox-29 to finish initializing
...
DEBU --
DEBU -c
DEBU exec "$@"
DEBU /bin/sh
DEBU /bin/bash
DEBU -l
Activity
debarshiray commentedon Aug 19, 2020
This looks like the container failed to start.
Once you have attempted to
enterand it failed, could you please try this command and post the logs from it:juanje commentedon Aug 19, 2020
I did and this is the error message:
Here is with the
debugoutput:martymichal commentedon Aug 20, 2020
Yep, this is not good. Basically some library pulled in by the Toolbox code uses C code requiring the use of cgo. When
cgois used during the build and a libc library is found on the system, the binary is dynamically linked to the libc library. This is normally ok but since Toolbox is used as the entry-point of containers, different versions of libc (resp. glibc) can break it. I have a proposal for a fix (#531) but I need to discuss it more with @debarshiray.debarshiray commentedon Aug 20, 2020
Yes, as @HarryMichal mentioned, this is the problematic part:
It means that a
/usr/bin/toolboxbinary linked againstglibc-2.32from Fedora 33 on the host, doesn't work with an olderglibcfrom older Fedora releases inside the container.We end up in this situation because we bind mount
/usr/bin/toolboxfrom the host into the container so that it can be used as the container's entry-point. This worked fine in the past when Toolbox was implemented in POSIX shell, and it would be picked up the environment's/bin/sh. However, it doesn't work so well when it's an ELF binary.debarshiray commentedon Aug 20, 2020
I grabbed the Fedora 33 binary, unpacked it and poked at it a bit.
Looks like there's a new implementation of
pthread_sigmaskinglibc-2.32.[-]Toolbox at Rawhide (Fedora 33) doesn't run other releases[/-][+]/usr/bin/toolbox linked against glibc-2.32 doesn't run on older glibc[/+]build: Ensure binaries built on Fedora 33 run on Fedoras 32 & 31
build: Ensure binaries built on Fedora 33 run on Fedoras 32 & 31
build: Ensure binaries built on Fedora 33 run on Fedoras 32 & 31
debarshiray commentedon Aug 21, 2020
I found a way to tell the Go toolchain to avoid the new version of the
pthread_sigmasksymbol fromglibc-2.32. See: #534Testing welcome.
build: Ensure binaries built on Fedora 33 run on Fedoras 32 & 31
debarshiray commentedon Aug 21, 2020
Closing.
Please feel free to leave a comment on the PRs or here if you think that it's still broken.
Thanks for the testing, by the way. Much appreciated!
test/system: Replace fedora-toolbox:32 with fedora-toolbox:34
test/system: Test a container with an old forward incompatible runtime
test/system: Test a container with an old forward incompatible runtime
test/system: Test a container with an old forward incompatible runtime
build: Don't rely on external linking mode for dynamic linker and RPATH