[Bug 1843479] Re: gzip in Ubuntu Eoan results in Exec format error on WSL1
Steve Langasek
steve.langasek at canonical.com
Sat Dec 14 01:29:11 UTC 2019
Hello Hayden, or anyone else affected,
Accepted binutils into eoan-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/binutils/2.33-2ubuntu1.1 in a few
hours, and then in the -proposed repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested and change the tag from
verification-needed-eoan to verification-done-eoan. If it does not fix
the bug for you, please add a comment stating that, and change the tag
to verification-failed-eoan. In either case, without details of your
testing we will not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: binutils (Ubuntu Eoan)
Status: New => Fix Committed
** Tags added: verification-needed verification-needed-eoan
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gzip in Ubuntu.
https://bugs.launchpad.net/bugs/1843479
Title:
gzip in Ubuntu Eoan results in Exec format error on WSL1
Status in binutils:
Confirmed
Status in binutils package in Ubuntu:
In Progress
Status in gzip package in Ubuntu:
In Progress
Status in binutils source package in Eoan:
Fix Committed
Bug description:
[Impact]
* Running gzip on WSL1 results in the following error:
$ gzip
-bash: /bin/gzip: cannot execute binary file: Exec format error
* The error occurs frequently in package updates and makes gzip inoperable on WSL1
* The problem is caused by PT_LOAD offset pointing past the end of file and the fix is fixing strip to not generate such ELF files and recompiling gzip with the fixed strip.
[Test Case]
* Check the gzip binary for wrong offset:
$ FILE=/usr/bin/gzip; readelf -W --program-headers $FILE | awk -v size=$(stat -c %s $FILE) '/^ LOAD/ {if (strtonum($2) > size) {print "wrong offset ("$2" ("strtonum($2)") points past EOF:" size; exit 1;}}'
[ Regression Potential ]
* The binutils fix could cause binutils to generate invalid ELF files. The fix is very small and isolated and has been tested and accepted by upstream, which makes such problems unlikely.
* Bugs in the toolchain in general can make the rebuilt gzip show new errors, but this generally applies to many SRUs and security updates. The testing period in proposed should mitigate this risk.
[Originial Bug Text]
Summary:
Running gzip on WSL1 results in the following error:
$ gzip
-bash: /bin/gzip: cannot execute binary file: Exec format error
What I expect to happen:
gzip executes correctly on WSL1.
What happens instead:
gzip fails with an Exec format error.
Notes:
I suspect a change in how gzip is being built for Eoan is causing
issues with ELF parsing on the WSL1 translation layer. For example:
On Disco with gzip 1.9-3:
$ file /bin/gzip
/bin/gzip: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=efa859c26eaf8e035efe9a139361e2a60cd17b3e, stripped
On Eoan with gzip 1.10-0ubuntu3:
$ file /bin/gzip
/bin/gzip: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bc0f5994544c2a469d04c914bf4bf44b4ded6040, for GNU/Linux 3.2.0, stripped
Eoan ships with gzip 1.10, while Disco ships with gzip 1.9, but I do
not believe this is an issue in 1.10 because this error does not occur
when building gzip from GNU project source on Ubuntu Eoan.
Justifications:
WSL1 will need to be patched in future Windows builds for this change
in ELF. However that patch will likely not be backported to older
builds of Windows, including Windows Enterprise/Server 2019.
To ensure Eoan can run on current and older builds of Windows Ubuntu
should consider looking at how it's building gzip and see if it can be
made to 'play nice' until WSL1 can be updated.
This was originally reported here:
https://github.com/microsoft/WSL/issues/4461
Details:
Description: Ubuntu Eoan Ermine (development branch)
Release: 19.10
gzip:
Installed: 1.10-0ubuntu3
Candidate: 1.10-0ubuntu3
Version table:
*** 1.10-0ubuntu3 500
500 http://archive.ubuntu.com/ubuntu eoan/main amd64 Packages
100 /var/lib/dpkg/status
To manage notifications about this bug go to:
https://bugs.launchpad.net/binutils/+bug/1843479/+subscriptions
More information about the foundations-bugs
mailing list