Uh oh!
There was an error while loading. Please reload this page.
Return NULL for mmap fail case on Unix - #78069
Conversation
If mmap failed, "MAP_FAILED" is returned not "NULL". The windows implememtation of GetRWMapping returns "NULL" for fail case, and the caller function is also checking "NULL". So, change Unix implementation to return "NULL" for fail case.
ghost
commented
Nov 8, 2022
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Wraith2
commented
Nov 8, 2022
This is the second use of nmap that needed changing recently, |
wscho77
commented
Nov 8, 2022
I checked all mmap return value and add missing one. |
janvorli
left a comment
There was a problem hiding this comment.
LGTM, thank you! Sigh, I wonder how I could get it wrong at that many places.
Uh oh!
There was an error while loading. Please reload this page.
janvorli
left a comment
There was a problem hiding this comment.
Ah, I've approved it accidentally, we will need to fix the thing I've commented on in around the memset.
Uh oh!
There was an error while loading. Please reload this page.
janvorli
commented
Nov 9, 2022
Hmm, some CI legs are failing with the newly added fatal error. |
Co-authored-by: Jan Vorlicek <jan.vorlicek@volny.cz>
wscho77
commented
Nov 9, 2022
Oops. I fixed condition check. Thank you. |
If mmap failed, "MAP_FAILED" is returned not "NULL".
The windows implememtation of GetRWMapping returns "NULL" for fail case, and the caller function is also checking "NULL".
So, change Unix implementation to return "NULL" for fail case.