gzip exec format error under WSL1

Bug #1966849 reported by Bruno Pitrus
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
gzip
New
Unknown
gzip (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
High
Unassigned
Kinetic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Optimization features included in jammy cause atypical alignment of LOAD ELF sections. This in turn causes failure to execute binaries on WSL1. Upstream have since integrated the optimization features included in jammy, but also reverted alignment to a previously used one. This also results in working binary under WSL1.

 * Cherry-pick upstream applied revert to alignment to resolve running gzip under WSL1.

[Test Plan]

 * Use powershell to set default WSL version to 1

 * Deploy WSL1, unpack and use updated gzip package

 * gzip --version should execute correctly under WSL 1

[Where problems could occur]

 * I cannot tell why performance improvement patches introduced alignment change, and if revert of the alignment change affects the performance. Note that this change aligns the codebase closer to what kinetic & upstream now are.

[Other Info]

 * This bug fix is upstream commit https://git.savannah.gnu.org/cgit/gzip.git/commit/gzip.c?id=23a870d14a49803c6d2579071886c1acf497c9d1

---

gzip version 1.10-4ubuntu3 fails to run under WSL1 on Windows 19044.1620, making WSL pretty much unusable.

bash: /usr/bin/gzip: cannot execute binary file: Exec format error

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: gzip 1.10-4ubuntu3
ProcVersionSignature: Microsoft 4.4.0-19041.1237-Microsoft 4.4.35
Uname: Linux 4.4.0-19041-Microsoft x86_64
ApportVersion: 2.20.11-0ubuntu79
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Tue Mar 29 06:40:33 2022
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=pl_PL.UTF-8
 SHELL=/usr/bin/fish
SourcePackage: gzip
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Bruno Pitrus (wistful-woodpecker) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gzip (Ubuntu):
status: New → Confirmed
Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

I am seeing the same error when I update Ubuntu 22.04 under WSL1:

Processing triggers for install-info (6.8-4build1) ...
sh: 1: gzip: Exec format error
install-info: warning: no info dir entry in `/usr/share/info/coreutils.info.gz'
sh: 1: gzip: Exec format error
install-info: warning: no info dir entry in `/usr/share/info/diffutils.info.gz'
...

Revision history for this message
iBug (ibugone) wrote :
Revision history for this message
iBug (ibugone) wrote :

Note that only 1.10-4ubuntu3 is affected, so users can install gzip 1.10-4ubuntu1 and set the package on hold for the time being, until the issue is resolved.

Changed in gzip:
status: Unknown → New
Revision history for this message
iBug (ibugone) wrote :

Also affects: gzip (=1.10-4ubuntu4)

Revision history for this message
Xavier Rodriguez Bores Hardy (xbores) wrote :

I download the file https://ftp.gnu.org/gnu/gzip/gzip-1.12.tar.gz
I Untar it tar xvzf with ubuntu 20
I copy all the files to Ubuntu 22
I run the ./configure
I run make
I run sudo make install
I exit the terminal
I log in again
and the new gzip 1.12 work very good

Revision history for this message
Joerg-k (joerg-k) wrote :

Just realized that my 22.04 installation was still running in WSL1... No more error after switching to WSL2.

summary: - gzip exec format error under WSL
+ gzip exec format error under WSL1
Revision history for this message
Robert Giles (rgiles) wrote :

Chiming in that it'd be great if this (gzip-1.10-4ubuntu4) continued to work in WSL1.

Revision history for this message
Sean Whalen (seanthegeek) wrote (last edit ):

FWIW, gzip 1.10-4+deb11u1 on Debian Bullseye and 1.12-1 on Debian Bookworm do not have this issue.

description: updated
Changed in gzip (Ubuntu Jammy):
status: New → In Progress
Changed in gzip (Ubuntu Kinetic):
status: Confirmed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Bruno, or anyone else affected,

Accepted gzip into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gzip/1.10-4ubuntu4.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, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 gzip (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
NotTheDr01ds (notthedr01ds) wrote (last edit ):

Tested and verified. Note that there is no original TEST CASE, but the original issue is clearly reproducible. Used the following TEST CASE to verify:

1. Installed 22.04 in WSL2 (for performance reasons until everything is updated)
2. sudo apt update && sudo apt upgrade -y
3. Installed my normal working environment (Fish shell, httpie, exa, etc. etc.)
4. Downloaded https://gnu.askapache.com/gzip/gzip-1.12.tar.gz (as a test gzip'd file)
5. tar xvzf gzip-1.12.tar.gz: Succeeded (this is still WSL2)
6. Removed resulting directory
7. Exited Ubuntu/WSL
8. Converted to WSL1 with "wsl --set-version Ubuntu-22.04 1"
9. Restarted Ubuntu-22.04 under WSL1
10. tar xvzf gzip-1.12.tar.gz: Failed with "/usr/bin/gzip: 1: ELF: not found"
11. gunzip gzip-1.12.tar.gz: Failed with "/usr/bin/gunzip: 57: exec: gzip: Exec format error"
12. sudo apt update && sudo apt upgrade -y: No updates
13. Added jammy-proposed to sources (as root) with:

cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF

14. Set selective-install of gzip via (as root):

cat <<EOF >/etc/apt/preferences.d/proposed-updates
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 400
EOF

15. "sudo apt update"
16. Verified selective install is set via "sudo apt upgrade -s"
17. sudo apt install gzip/jammy-proposed
18. tar tvzf gzip-1.4.tar.gz: Succeeded
19. gunzip gzip-1.4.tar.gz: Succeeded
20. tar tvf gzip-1.4.tar: Succeeded (confirms successful gunzip)
21. tar xvf gzip-1.4.tar: Succeeded (Confirms successful gunzip)
22. gzip ~/.profile: Succeeded
23. gunzip ~/.profile.gz: Succeeded

apt info gzip

Package: gzip
Version: 1.10-4ubuntu4.1

tags: added: verification-done-jammy
removed: jammy verification-needed-jammy
Changed in gzip (Ubuntu Jammy):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gzip - 1.10-4ubuntu4.1

---------------
gzip (1.10-4ubuntu4.1) jammy; urgency=medium

  * Cherry-pick upstream patch to use more portable alignment to resolve
    failure to execute on
    WSL1. https://github.com/microsoft/WSL/issues/8219 LP: #1966849

 -- Dimitri John Ledkov <email address hidden> Mon, 05 Sep 2022 14:33:59 +0100

Changed in gzip (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gzip has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Robert Giles (rgiles) wrote :

Thanks for fixing this - 1.10-4ubuntu4.1 works!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.