-
Bug
-
Resolution: Fixed
-
P5
-
15
-
b27
The gtest in runtime/test_os_linux.cpp tests for a failed MMAP using != NULL instead of MAP_FAILED (which is defined as
#define MAP_FAILED ((void *) -1)
) but the code uses NULL (twice):
char* const mapping = (char*) ::mmap(NULL, mapping_size,
PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,
-1, 0);
ASSERT_TRUE(mapping != NULL) << " mmap failed, mapping_size = " << mapping_size;
// Unmap the mapping, it will serve as a value for a "good" req_addr
::munmap(mapping, mapping_size);
All other mmap uses check for MAP_FAILED manual inspection via grep shows.
Fix this.
#define MAP_FAILED ((void *) -1)
) but the code uses NULL (twice):
char* const mapping = (char*) ::mmap(NULL, mapping_size,
PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,
-1, 0);
ASSERT_TRUE(mapping != NULL) << " mmap failed, mapping_size = " << mapping_size;
// Unmap the mapping, it will serve as a value for a "good" req_addr
::munmap(mapping, mapping_size);
All other mmap uses check for MAP_FAILED manual inspection via grep shows.
Fix this.
- relates to
-
JDK-8177708 Convert TestReserveMemorySpecial_test to Gtest
- Resolved