1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From: Jason Duerstock <jason.duerstock@gmail.com>
Date: Sun, 29 Apr 2018 09:16:20 -0400
Subject: On ia64, retry failed mmap without address hint
[smcv: Move the #endif so we still return a defined value on non-ia64]
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897178
Last-Updated: 2018-07-10
---
js/src/jit/ProcessExecutableMemory.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp
index 0c00b17..86c9d76 100644
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -521,12 +521,24 @@ static void* ReserveProcessExecutableMemory(size_t bytes) {
# endif
void* p = MozTaggedAnonymousMmap(randomAddr, bytes, protection, flags, -1, 0,
"js-executable-memory");
+
+#ifndef __ia64__
if (p == MAP_FAILED) {
return nullptr;
}
# if defined(XP_DARWIN)
DecommitPages(p, bytes);
# endif
+#else
+ if (p == MAP_FAILED) {
+ // the comment above appears to be incorrect on ia64, so retry without the hint
+ p = MozTaggedAnonymousMmap(NULL, bytes, PROT_NONE, MAP_PRIVATE | MAP_ANON,
+ -1, 0, "js-executable-memory");
+ if (p == MAP_FAILED) {
+ return nullptr;
+ }
+ }
+#endif
return p;
}
|