Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.54',
'v8_embedder_string': '-node.55',

##### V8 defaults for Node.js #####

Expand Down
27 changes: 1 addition & 26 deletions deps/v8/src/base/platform/platform-aix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,34 +171,9 @@ bool OS::DecommitPages(void* address, size_t size) {
// with MAP_FIXED will fail and return -1 unless the application has requested
// SPEC1170 compliant behaviour:
// https://www.ibm.com/docs/en/aix/7.3?topic=m-mmap-mmap64-subroutine
// Therefore in case if failure we need to unmap the address before trying to
// map it again. The downside is another thread could place another mapping at
// the same address after the munmap but before the mmap, therefore a CHECK is
// also added to assure the address is mapped successfully. Refer to the
// comments under https://crrev.com/c/3010195 for more details.
#define MMAP() \
mmap(address, size, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)
DCHECK_EQ(0, reinterpret_cast<uintptr_t>(address) % CommitPageSize());
DCHECK_EQ(0, size % CommitPageSize());
void* ptr;
// Try without mapping first.
ptr = MMAP();
if (ptr != address) {
DCHECK_EQ(ptr, MAP_FAILED);
// Returns 0 when successful.
if (munmap(address, size)) {
return false;
}
// Try again after unmap.
ptr = MMAP();
// If this check fails it's most likely due to a racing condition where
// another thread has mapped the same address right before we do.
// Since this could cause hard-to-debug issues, potentially with security
// impact, and we can't recover from this, the best we can do is abort the
// process.
CHECK_EQ(ptr, address);
}
#undef MMAP
if (mprotect(address, size, PROT_NONE) != 0) return false;
return true;
}

Expand Down
Loading