-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gzip from Ubuntu Eoan doesn't execute #4461
Comments
I can reproduce your issue in latest Windows 10 Pro insider build 18970. Here are some points that I found:
|
The interesting thing is they are all PIE (f.e. Reasonable enough WSL1 work around would be to install your own |
The difference here isn’t related to a change in |
For what it's worth,
|
Does this need to be reported upstream to Ubuntu? |
Nope. Because WSL2 works. |
Some of us luddites still use WSL1 on our production machines. 😉 I was able to reproduce on Ubuntu Eoan with gzip 1.10. I cannot reproduce on Debian testing (Pengwin) or unstable which are shipping gzip 1.9-3. I built gzip 1.10 from source tar from FSF on Debian unstable and Ubuntu Eoan and there was no issue. |
The issue is in LxCore driver which is part of WSL1 not WSL2, see my first comment, KD output. Hence the issue is from WSL side. PIE is a good security feature. See these two wiki: |
The problem doesn't appear to be PIC per se, as skitt points out (thanks skitt). Something is weird about the build. It would take a dive to find out what.
Production machine with a unreleased Ubuntu build. Okay. That said, finding problems like this early is a Good Thing, naturally. Just yanking your chain. #3023 is still on the books for what it is worth. Which was also caught "early". It might be worthwhile for someone motivated to report the problem upstream and see if the Canonical peeps have any idea what changed. Also trying bleeding edge Debian binaries (Bookworm?) might be worthwhile to see if Canonical just inherited the change. This is a completely legit WSL1 bug, obviously; but in parallel, making
It is. On the other hand... |
If ntoskrnl allows to patch kernel mode driver then it would be possible to take a dive. |
I meant dive the Ubuntu |
They updated it from gzip 1.9 to 1.10. I .diff'd Ubuntu source packages for both and nothing jumped out at me. I .diff'd the binary packages in a Hex editor and noted some changes in the headers in the gzip binary. |
Reported to Ubuntu here. |
From upstream:
|
That section is "new" alright. I blindly stripped the The only other new section in there (Disco Which is all a long description of things that don't work. Next thing to try would be to grab the |
Thanks for filing this issue, I identified where this is blowing up in our elf loader and will submit a fix. |
I have updated the bug report filed on gzip in Launchpad accordingly. |
@benhillis could you please backport the fix to non-insider versions? |
@benhillis we already publish 19.10 tarballs for WSL and with this bug users can't really use them with WSL1 :-( |
@rbalint - Yes, I will see about getting this backported. |
Despite the WSL1 elf loader being the actual problem, is "Build gzip from source" the correct workaround for WSL1/eoan until the fix is released? If so, could the "most correct" procedure for doing this be posted to this thread? (I landed here via a Google search.) |
I locally rebuilt the gzip package in eoan, and the problem persists. @benhillis Are you able to share any details about the nature of the ELF loader bug, which might suggest tweaks to compiler or linker options that might avoid it? @BobCu The simplest short term workaround might be to just downgrade to the gzip package from Ubuntu disco. |
@maxb - Sure. The issue is that our loader was not correctly handling program headers that would exceed the size of the file itself. The offending program header file size of zero but an offset that was greater than the size of the binary. |
@maxb - I got a working build via the sources at https://ftp.gnu.org/gnu/gzip/gzip-1.10.zip (note the suffix - .tar.xz also works). |
The bizarre/frustrating thing about this one is there is nothing obvious in the |
FWIW, I attempted to build the My gzip is generic (without Ubuntu/Debian patches), and is installed in Are there any patches that should be applied to gzip as part of the temporary workaround? Edit: Decided to go with Disco's gzip (see below), so did |
Given the Ubuntu/Debian patches to gzip, it may be safest to follow @maxb's recommendation to downgrade to Disco's gzip:
When this issue has been resolved:
|
I just encountered the same issue again with ubuntu 22.04 in wsl1. Temporary solution proposed above did work for me as well. |
if you install remote:wsl or development in vscode ,conflict will been happend |
I am also affected by this bug again in Ubuntu 22.04. Weirdly enough, the rest of the binaries work fine. Only gzip seems to fail. |
use this command may help echo -en '\x10' | sudo dd of=/usr/bin/gzip count=1 bs=1 conv=notrunc seek=$((0x189)) |
Huh what does this do? I mean, I get it inserts a 0x10 byte at offset 0x189, but I'm curious what structure are you patching for it to get fixed.
|
I got the same error under Ubuntu 22.04, gzip 1.10, WSL1.
|
@nsynecs, thank you, fixed right now. |
@nsynecs it works well,thanks!! my WSL1 version is Ubuntu 22.04 LTS.
|
@nsynecs Thank you very much. It worked very well! |
@as17501 's solution works for WSL 1, Ubuntu 22.04. eg:
That being said - I'm surprised this bug to a core piece of Ubuntu software (gzip) used in a distribution somehow made it into production. Am I missing something and there's very little testing of WSL, or is this a separation of concerns issue where "WSL works" from a Microsoft standpoint, but the Ubuntu distribution doesn't; eg it's Canonical's issue. Should we be raising it with Canonical as the issue has been around since 2019. Cheers |
@as17501 in your example you wget |
The current issue with GZip on Ubuntu is better described in #8219 and it's cause is different from this thread. It's caused by the WSL 1 ELF loader. While there might be ways to fix that distro side, it's quite unpredictable when and which binary will be the next affected by such problem. Anyone willing to confirm what's been reported in the referred issue can try the following command to patch the gzip binary and clarify whether that's accurate or a new issue arose:
|
I can confirm that this works! I had the same problem as the people above. With WSL 1 Ubuntu 22.04 installing Visual Studio Code would throw the following error: $ code .
Updating VS Code Server to version b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a
Removing previous installation...
Installing VS Code Server for x64 (b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a)
Downloading: 100%
@����@@@�������������������: Permission denied
/usr/bin/gzip: 3: ���: not found
/usr/bin/gzip: 4: Syntax error: "(" unexpected
tar: Child returned status 2
tar: Error is not recoverable: exiting now
tar is unable to read /home/alange/.vscode-server/bin/b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a-1658171981.tar.gz. Either the file is corrupt or tar has an issue.
There's a known WSL issue with tar on Ubuntu 19.10.
See workaround in https://github.com/microsoft/vscode-remote-release/issues/1856.
Reload the window to initiate a new server download. After running your magic line it immediately worked: $ code .
Updating VS Code Server to version b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a
Removing previous installation...
Installing VS Code Server for x64 (b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a)
Downloading: 100%
Unpacking: 100%
Unpacked 2799 files and folders to /home/<user>/.vscode-server/bin/b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a. |
Fixed it for me as well. |
Thanks for the workarounds, though I don't see a core fix to the actual
underlying issue I'm afraid. It also seems somewhat bizarre that a change
was made to WSL that fundamentally broke a core part of the system, yet
somehow that made it through the testing processes and was released to
production.
|
I thought the gzip patch fixed my issue on WSL 2, but as it turned out, I was using WSL 1 and didn't realize it! run |
gzip_1.12-1_amd64.deb can also resolve this problem |
My question is twofold:
1. How was WSL 2 released with such a significant bug present in one of
the supported platforms ?
2. Is there an automated testing strategy as per normal DevSecOps
processes ? If so, where is this documented
|
It works! |
This command fixed the issue for me: |
It's work! yeah! Thanks!!! |
gzip package version |
@ScarletFlash |
Actually, Idk. I'm using a different OS right now. |
Your Windows build number: 1903 (18362.295)
What you're doing and what's happening:
What's wrong / what should be happening instead:
gzip
from Ubuntu Eoan gives the above unexpected error. The same binary behaves perfectly well on a native Linux box (tested on Ubuntu Bionic / Disco and Debian Stretch / Buster).Strace of the failing command, if applicable: No strace because the binary doesn't run at all :(
For WSL launch issues, please collect detailed logs.
See our contributing instructions for assistance.
The text was updated successfully, but these errors were encountered: