-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
check the right return value for mmap #77952
Conversation
Tagging subscribers to this area: @dotnet/gc Issue DetailsFIxes: #77477. mmap returns
|
the failures are all helix timeouts. But the musl arm outerloop failure is fixed after this change. |
We have some other usage of mmap, e.g. as part of MemoryMappedFiles. Do we need to fix anything there? |
I can take a look, but assuming its been that way for a while? This particular code was recently added to coreclr (was only included within standalone GC previously), hence we are noticing this issue now. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
Is it? SystemNative_MMap is just coercing MMAP_FAILED into NULL: runtime/src/native/libs/System.Native/pal_io.c Lines 948 to 951 in a4e98d4
But my understanding from this PR is that mmap returning NULL is actually a success case, not failure, and SystemNative_MMap is conflating the two such that Lines 114 to 117 in 264d739
Do we know in what situations null might be returned as a success case? |
When you map a page at address 0 (some Unix versions allow that). CoreCLR does not support that configuration. |
Ok, thanks.
Does mono? |
Actually, mmap is not allowed to return NULL by spec unless MAP_FIXED is passed to it.
|
Perfect. Thanks. |
FIxes: #77477. mmap returns
MAP_FAILED
rather thanNULL
on failures.