microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.57k stars 823 forks source link

WSL1: mmap throws EOPNOTSUPP on unknown flags (should ignore it) #10102

Open Artoria2e5 opened 1 year ago

Artoria2e5 commented 1 year ago

While #10049 is still a thing, the qemu test case is becoming void because it's failing due to a different reason: mmap is throwing EOPNOTSUPP.

The specific call is

 mmap(0x1000, 4294963200, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE|MAP_FIXED_NOREPLACE, -1, 0)

On an old kernel (like the 4.4 WSL1 is emulating), per https://man7.org/linux/man-pages/man2/mmap.2.html, the expected behavior is instead to just ignore the flag.

Describe the solution you'd like Silently ignore. Sounds leaky and dangerous, but that's the expected way.

Additional context Linux [hostname] 4.4.0-22621-Microsoft https://github.com/microsoft/WSL/issues/1610-Microsoft Fri Jan 01 08:00:00 PST 2016 x86_64 GNU/Linux

MLXProjects commented 11 months ago

It's sad how ignored this got, quite an useful feature for WSL1 users that don't want to run a VM in the background every time they need to use a shell

Artoria2e5 commented 11 months ago

Writing a straight-to-the-point report is all I can do. I expect WSL1 to provide an old-but-complete-ish emulation of Linux syscalls, but with an easier way to go (wsl2 VM) I can see why it's being neglected.

At least most of my games no longer has the anticheat bail on Hyper-V, so I can leave it on. :(

https://github.com/microsoft/WSL/issues?q=label%3Awsl1+label%3Afixed-in-wsl2