WSL: binfmt_misc flags: 'OC' not working
-
Your Windows build number: (Type
verat a Windows Command Prompt)OS Name: Microsoft Windows 10 ProOS 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 = `
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 10
- Comments: 15
WSL’s builtin binfmt support doesn’t seem to like the fancy
flags: OC. Or that’s how it looks. So from the top with repetition from Froosh:And, after doing the second stage and installing a few packages with the armel
aptbinary, would you look at that:I’m getting
Unsupported syscall: 384(notably onlsb_release, shrug) but otherwise it is working surprisingly well. Performance seems alright to the naked eye.Okay – @benhillis, here is a repro that is a little easier to eat than a full blown
debootstrap:The
strace -f -o file.strace ./file ./filelooks the same as reported, including the absent[edit: wait, maybe it’s not anopen()open()].I don’t think the fact that
qemu-arm-staticis the registered interpreter matters here. That much appears to be working fine.Windows version:
Microsoft Windows [Version 10.0.17120.1]WSL App ‘Ubuntu’ version:
1604.2017.922.0Steps to reproduce on a fresh WSL Ubuntu instance:
Result (doesn’t work):
prepare_binprm: Bad file descriptorStrace log: https://gist.github.com/Froosh/dc472dc953dd534806d68a1040e4c10e
Alternate explicit qemu-arm-static invocation:
sudo strace -vff -o explicit.strace chroot debian-armel/ /usr/bin/qemu-arm-static /bin/bashResult (works):
I have no name!@Froosh-Book:/#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: