Uh oh!
There was an error while loading. Please reload this page.
check the right return value for mmap - #77952
Conversation
ghost
commented
Nov 6, 2022
Tagging subscribers to this area: @dotnet/gc Issue DetailsFIxes: #77477. mmap returns
|
mangod9
commented
Nov 7, 2022
the failures are all helix timeouts. But the musl arm outerloop failure is fixed after this change. |
stephentoub
commented
Nov 7, 2022
We have some other usage of mmap, e.g. as part of MemoryMappedFiles. Do we need to fix anything there? |
mangod9
commented
Nov 7, 2022
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. |
mangod9
commented
Nov 7, 2022
|
stephentoub
commented
Nov 7, 2022
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
then treats both as failure. Do we know in what situations null might be returned as a success case? |
jkotas
commented
Nov 7, 2022
When you map a page at address 0 (some Unix versions allow that). CoreCLR does not support that configuration. |
stephentoub
commented
Nov 7, 2022
Ok, thanks.
Does mono? |
janvorli
commented
Nov 7, 2022
Actually, mmap is not allowed to return NULL by spec unless MAP_FIXED is passed to it.
|
stephentoub
commented
Nov 7, 2022
Perfect. Thanks. |
FIxes: #77477. mmap returns
MAP_FAILEDrather thanNULLon failures.