-
Notifications
You must be signed in to change notification settings - Fork 860
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
mmap's problem #658
Comments
Thanks for providing the detailed repro. If you add error checking to the sample above, you will see the mmap call is failing on WSL. This is a known issue where NT has different semantics around mapping a file of size 0. So we can prioritize appropriately, is this impacting a specific application or is it just something you noticed in the test above? |
FWIW, Cygwin has the same behavior as WSL here, so there's that defense. |
I did not notice that NT has different semantics around mapping a file of size 0. Mmm, That is another problem.
Native linux work, but WSL segmentation fault. |
The feature test in the berkeleydb source is here. |
Yes, there are additional different semantics between NT memory mappings. For example, today truncating a file with an outstanding memory mapping will not behave the same. Thanks for the pointer to the source, we can take a look. We are tracking these issues but to help us prioritize, please give feedback on the uservoice page - https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo. |
I was looking forward to working "natively" on windows/wsl with my mmap based code without the horrible remapping cludges for windows file mappings but after testing it the argument could be made that the wsl function syscalls doesn't even follow specs (or atleast common conventions of the function) since the mapping is truncated to file size rather than growing as being able to access more of the file as the file becomes longer. This code works on linux and freebsd but fails when mmaping(0 sized file) or even worse segfaults once past the silently truncated mapping on wsl even if the file has been enlarged later.
|
Remember that it's a 2 part bug (possibly connected though) 1: the failure to map a nil sized file For correct behaviour the mapping should be of the requested size (16kb) directly and the memory pages should become available as the file is enlarged. |
Thanks @whizzter, yes those are both known issues that we are tracking. To help us prioritize, please give feedback on the uservoice page - https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo. |
This has been fixed but is not in Creator's update. Look for this to be fixed in the first post-Creator's Update Insider build. |
Maybe update the tag on this one if it is not in Creators to avoid confusion. |
Any update? I've read the lastest release notes of wsl, this issue is not mentioned. |
Happy to see the mmap being atleast partially fixed in the Fall Creator Update. (MMap'ing a 0 sized file still doesn't seem to work!!! :( ) , but atleast the silent failure is fixed. |
@imReker on 16299 I still can't run android builds without your ijar modification so I'm guessing it wasn't fully fixed |
@therealkenc Maybe, it doesn't affect me personally too much (just caught by running my small test code above the first time). @stehufntdev said they already track it (internally?) and i guess he and @bitcrazed knows how much of it is related to or a separate issue from this one and #902 |
@yorickdowne The WSL maintainers may be particularly good and see updates on closed issues, but experience in various repos taught me that opening a new issue and referencing the closed one is more likely to get attention. |
WSL's mmap behavior different from native Linux.
Native Linux work, but WSL(14388) segmentation fault.
Here is sample code:
The text was updated successfully, but these errors were encountered: