-
Notifications
You must be signed in to change notification settings - Fork 822
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
binfmt_misc flags: 'OC' not working #2620
Comments
Same issue here. |
And here |
Same here under version 10.0.16299.192 |
Windows Version: Installed debootstrap: Prepare a Debian armel root: Try to run the armel bash prompt:
Resulting strace files: https://gist.github.com/Froosh/142d0da5dddd15fdc65f66e52a2d644d |
From strace.102:
File descriptor 3 is nowhere to be found in the two files you posted though. Need the contents of There is still no repro here though; which is the place to start. Those three commands aren't going to fly on Real Linux either, naturally. [You'll get This almost certainly isn't going to fly; or someone would have showed off a long time ago. But I can at least give you the first blocker, in return for a repro or/and a complete |
Hehe, yeah, this was a bit rushed in the middle of doing other work, will try and get some better data later today/tonight. Full repro steps on a fresh wsl ubuntu instance, with some comparison strace between relying on binfmt and explicitly calling qemu-arm-static. I might also try the ETL logs to see if they show anything, and perhaps a native ubuntu comparison if I have time. You've absolutely identified the missing element though: When calling qemu-arm-static explicitly, there is a call to open("/bin/bash", O_RDONLY) which returns FD 3 that doesn't happen through the binfmt assisted call. |
Windows version: WSL App 'Ubuntu' version: Steps to reproduce on a fresh WSL Ubuntu instance:
Result (doesn't work): Strace log: https://gist.github.com/Froosh/dc472dc953dd534806d68a1040e4c10e Alternate explicit qemu-arm-static invocation: Result (works): Strace log: https://gist.github.com/Froosh/267e1c2db65e0359e56034610cf328f0 The main difference (apart from memory addresses/times/etc) is a missing call to open() which returns FD 3. Implict invocation:
Explicit invocation:
|
Thanks for the repro. Possibly I haven't looked at the problem in detail yet, but at your first The fact
Whatever the problem, I strongly suspect it is going to be generic to [edit,aside: I suspect the |
Okay -- @benhillis, here is a repro that is a little easier to eat than a full blown
The
I don't think the fact that |
WSL's builtin binfmt support doesn't seem to like the fancy
And, after doing the second stage and installing a few packages with the armel I'm getting |
Awesome work! Agreed, some experimentation shows it doesn't work with flag 'O' or flag 'C' separately, but does work without either (no flags). ARMel appears to be working nicely, though MIPSel segfaults with access errors after running a command (e.g. ls) successfully. That's a matter for a separate issue though, when I've got more time to test and document the various architectures ;) Fulfilling the law of WSL issues: now if only we could load loop devices and/or other filesystems (FUSE!) … Love the idea of using qemu to get 32-bit compatibility running, inspired! |
That makes #2103 really weird. 🤷
Yep.
If qemu is in your wheelhouse (it isn't especially in mine) a cookbook on how to get x86 emulation working in situ would be valuable to a number of people. Clearly it is doable, even if not necessarily out of the box. With a little more work, maybe even some other software that still depends a lot on x86 legacy code. |
Your workaround of removing and readding ARM binfmt suport works for me! Thanks for your great work on this! [edit] now no longer working-- I get: Not clear to me what this means but this has broken the package for sure-- can't remove and reinstall it. |
This was never enough of a showstopper to get grease since 2017. The binfmt flags support is complete in WSL2. |
Your Windows build number: (Type
ver
at a Windows Command Prompt)OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.16299 N/A Build 16299
What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
"~/wheezy/" is arm rootfs.
I have installed qemu-user-static.
For a simple test qemu-arm-static executable, ~/wheezy/bin/ls, expected results would be:
$ ~/wheezy/bin/ls
/lib/ld-linux.so.3: No such file or directory
While actual results are:
$ ~/wheezy/bin/ls
prepare_binprm: Bad file descriptor
Explicit invocation of qemu-arm-static, however, works:
$ qemu-arm-static ~/wheezy/bin/ls
/lib/ld-linux.so.3: No such file or directory
Show the binfmts list, it is OK:
`update-binfmts --display qemu-arm
qemu-arm (enabled):
package = qemu-user-static
type = magic
offset = 0
magic = \x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00
mask = \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
interpreter = /usr/bin/qemu-arm-static
detector =
`
The text was updated successfully, but these errors were encountered: