-
Notifications
You must be signed in to change notification settings - Fork 832
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(NULL, ...) on zero-length file fails with ENOEXEC #3451
Comments
I'm testing a fix for this now, but it looks like lmdb is hitting another error after this: I'm trying to determine if this is related to my "fix" or another issue. |
The major use case for "mmap's problems" is BerkeleyDB. Instead of deep diving
There is some information on running the individual tests here. If you get the BerkeleyDB tests to pass it will squash #3149 #2627 #2852 #2871 (and everything else in the BDB universe). The other |
I guess this is related to #902 ? It sure would be nice to see the mmap issues finally fixed... |
@drujd Vote on user voice, get your friends to vote. Right now, there's not exactly an outcry to get BerkeleyDB to work, or any other project relying on these mmap features. |
The issue has much broader implications, I have voted, but I do not think this is the right thing to vote on. The dysfunct mmap functionality breaks everything that depends on the correct mmap behavior, including bup or building Android from source. Personally I don't really care about BerkeleyDB. |
Also, I really think this should be considered a bug, not a feature request. |
Could be a combination of bugs and missing features. I don’t understand WSL even nearly well enough to have an informed opinion on that. I think it’s very likely that supporting Berkeley DB will also “knock down” a range of other related issues. Any DB with the same pedigree will work. For Android source development - does that still require 32-bit elf support? If so, the uservoice for that is here: https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/13377507-please-enable-wsl-to-run-32-bit-elf-binaries |
@yorickdowne - The distinction of bug vs feature request is fairly arbitrary, we call things bugs that are simple fixes and a feature request would take a lot longer to implement. I've looked into this and #902 and they share the commonality that both rely on functionality that the Windows kernel does not support which makes the scope of this fix a bit larger. |
At base the problem is stated in the
This has been The reason Lineage builds don't work is because no one does Lineage builds on Windows. Then someone does an upstream patch like this (which note has no
Alright. But by the chosen definition of not-dysfunct, it is a Windows bug contrast lack of Windows feature too. In extremis, ditto ha ha but serious. |
Wow. That rabbit hole went deep fast. Thanks, @therealkenc .
That'd be amazing. Your theory that WSL works because 23 years of Cygwin workarounds means not all code triggers #1529 is -- oddly compelling. You are saying that allowing SetEndOfFile with handles open would then lend itself to also allowing other actions with handles open, such as renaming, and deleting. Do I get that right? @benhillis , thanks for looking into it! From your perspective, are allowing SetEndOfFile/delete/rename while handles are open and allowing mapping of a zero-length-file things to be tackled in Windows, or through some form of layer in WSL? |
Nah I didn't mean to imply that in any narrow sense. Better to call the two issues (#1529 and mmap's problems) analogous. No magic bullet here. [ed] To illustrate the bigger picture, see #2915 (message) which doesn't conflate with Windows' "pinned handles" xplat problem. You could fix it in WSL, but that doesn't help win32 NodeJS being broken. How do you eat an elephant? One bite at a time. |
@benhillis Is it realistic to tackle this and #902 as part of 20H1? |
Edit: this statement is not correct. I can not reproduce this with https://github.com/WhitewaterFoundry/WLE. I'm going to try to do more bisecting here to see if we can figure out what the difference is between working RPM and not working RPM distributions are. My apologies (and thanks to @DarthSpock for pointing this out) Edit 2: we found that different versions of RHEL have problems. What is interesting is that we were originally trying on an older version, but the folks at WhitewaterFoundry/Pengwin-Enterprise#20 have reproduced it on a higher version. If I get some time i'll see if I can bisect out the OS versions to prove if it really is that (i.e. a change in RPM or one of its dependencies such as bdb), -- This behavior has the effect of preventing people running most RPM based distributions such as RHEL/Fedora/CentOS/Scientific Linux under WSL. |
I would be mildly curious to know whether #2852 ( |
It affects WLinux Enterprise distributions (RHEL, SL, CentOS) as well. See WhitewaterFoundry/Pengwin-Enterprise#20. |
Ben, at the time back in August 2018 did you manage to track that fail any? Understandable if you didn't, but whatever you found (if anything) might save Hayden some effort. |
Hey ! It’s starting to makes really long for not being able to update Fedora or install any other packages… |
Was hoping for some joy on the OP repro in 18890, but 'fraid not.
Didn't make it that far. If that initial Aug 2018 fix attempt is still in the can, and doesn't break anything obvious, it might be worth a |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
ver
at a Windows Command Prompt)April Update, 10.0.17134.191
Also tested on 19H1, build 18204
The package "liblmdb" does not work on WSL. This impacts any projects that use lmdb. I've narrowed this down to mmap(NULL,...) on a 0-length file failing with ENOEXEC. This is likely related to #658 , yet distinct enough that the @therealkenc suggested I file a new issue, to avoid confusion.
To reproduce with lmdb:
git clone https://github.com/LMDB/lmdb.git
cd lmdb/libraries/liblmdb
make test
mtest.c:50: mdb_env_open(env, "./testdb", MDB_FIXEDMAP , 0664): Exec format error
Aborted (core dumped)
Makefile:61: recipe for target 'test' failed
make: *** [test] Error 134
strace shows:
mmap(NULL, 10485760, PROT_READ, MAP_SHARED, 4, 0) = -1 ENOEXEC (Exec format error)
Just before it cores.
Sample code showing just the ENOEXEC, but not going on long enough after that to core:
strace of the sample code:
mmap-example.strace.txt
strace of liblmdb itself:
liblmdb.strace.txt
User voice for this issue lives here: https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/35053207-support-oracle-berkeley-db-and-lmdb
The text was updated successfully, but these errors were encountered: