-
Notifications
You must be signed in to change notification settings - Fork 821
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
getdents64() EFAULT - possibly struct linux_dirent alignment related #1769
Comments
Just to verify -- this fails when the Unless I'm mistaken, isn't the above |
Also, to test the alignment theory -- is it possible to hit this error if you declare your array as an array of |
If you comment it out it passes. I.e. it fails as given above. In the real code that 'foo_' is a file descriptor. But yeah it looks like it is an alignment thing. I just updated the code with a (commented out) |
Thanks for reporting this issue @therealkenc! You're absolutely right about alignment, looks like we are enforcing too strict of an alignment requirement on the user buffer in the getdents syscalls. I suspect there's a handful of other places this is being done as well. Was there a scenario this was causing an issue for or just something you noticed when playing around? Trying to gauge the priority of this fix. Thanks again! |
The scenario is linked in the OP; it's in the chromium source. I've known about it since July (it is item one in "the list"), but didn't post because (a) "chrome" nuff said, (b) there is a trivial source work-around, and mostly (c) I hadn't done a test case to see what was going on. It turns out it isn't even a blocker for running Google branded Chrome releases, because it is just a debug check, and it turns out listing the directory in question (which is |
@therealkenc - sorry missed the link in the original post. Good to hear this is only required for debug builds. I've filed a task to look at all of our alignment related checks when reading or writing user buffers. To set expectations we're getting very close to Creator's Update release and this probably doesn't meet the bar, but we'll get this fixed for future builds. |
Thanks. Totally. Hence the pre-preemptive caveat "posting this only because..." in my OP. I've read the release strategy between the lines in other posts. #1692 is probably a one liner case statement fallthrough and still isn't worth doing for Creators. Being "that guy" who causes the BSOD after millions of people upgrade to Creators probably isn't great for career advancement. Plenty of time to break everything with a re-written memory manager and a win32-side CPL 0 filesystem driver starting in May. 🐱👓 |
A fix for this is now in code review. |
I've checked in a fix for this. The fix generically fixes the lxcore driver from enforcing alignment requirements on user buffers that are not enforced in the native Linux kernel. Look for this fix in an Insider build once vNext begins flighting. |
I am thinking this was because of Astoria's roots, which basically means running on ARM, and following the Linux ARM EABI, eh? So... Make sure the |
Confirmed fixed in 16184. Appreciated. For what it is worth, this brings chromium down to only two remaining blockers (notwithstanding udev, which is IMO Google's bug). |
Glad to hear it! Maybe this will fix a couple other obscure bugs too. |
Posting this only because it has been driving me batty for a while now. I think might be a bug in the code not WSL, but I can't identify the issue or I would finger Google. It causes a
DCHECK
in this line of code. The test case below works on Real Linux, fails on WSL. If you comment out theconst int foo_
line in theDirReaderLinux
struct it passes on WSL. Alignment maybe??? Nah... Stumped. 🤷g++ test-getdents64.cc -o test-getdents64 && ./test-getdents64
strace
like the title says.The text was updated successfully, but these errors were encountered: