gzip in Ubuntu Eoan results in Exec format error on WSL1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
binutils |
Fix Released
|
Medium
|
|||
binutils (Ubuntu) |
Fix Released
|
Medium
|
Balint Reczey | ||
Eoan |
Fix Released
|
Medium
|
Unassigned | ||
gzip (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Eoan |
Fix Released
|
High
|
Unassigned |
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.
[Other Info]
* Binutils 2.33.1-6ubuntu1.1 was accidentally built in -proposed instead of in a PPA. I've rebuilt it in https:/
[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/
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/
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:/
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://
100 /var/lib/
summary: |
- gzip in Ubuntu Eoan results in Exec format error + gzip in Ubuntu Eoan results in Exec format error on WSL1 |
tags: | added: wsl |
Changed in gzip (Ubuntu): | |
importance: | Undecided → High |
Changed in binutils (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Balint Reczey (rbalint) |
Changed in gzip (Ubuntu): | |
status: | Invalid → In Progress |
Changed in binutils: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in binutils: | |
status: | New → Won't Fix |
Changed in binutils: | |
status: | Won't Fix → Confirmed |
description: | updated |
description: | updated |
description: | updated |
Changed in binutils (Ubuntu): | |
importance: | Undecided → Medium |
Changed in binutils (Ubuntu Eoan): | |
importance: | Undecided → Medium |
Changed in gzip (Ubuntu Eoan): | |
importance: | Undecided → High |
Changed in binutils: | |
status: | Confirmed → Fix Released |
Status changed to 'Confirmed' because the bug affects multiple users.