com php-src: fix x64 opcache, still uses fugly fixed addresses, see TODO entry for explanaton: ext/opcache/shared_alloc_win32. c
| From: | Pierre Joye | Date: | Sat, 20 Apr 2013 16:22:39 +0000 |
| Subject: | com php-src: fix x64 opcache, still uses fugly fixed addresses, see TODO entry for explanaton: ext/opcache/shared_alloc_win32. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71959@lists.php.net to get a copy of this message | ||
Commit: 14d9f3450b8e9cb41240e2403fdb812782ee7ee6
Author: Pierre Joye <pierre.php@gmail.com> Sat, 20 Apr 2013 18:22:39 +0200
Parents: 0704e4badb3abdfbdd5efc2b6d51c8abd6e5629a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=14d9f3450b8e9cb41240e2403fdb812782ee7ee6
Log:
fix x64 opcache, still uses fugly fixed addresses, see TODO entry for explanaton
Changed paths:
M ext/opcache/shared_alloc_win32.c
Diff:
diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c
index 2c32184..fb84857 100644
--- a/ext/opcache/shared_alloc_win32.c
+++ b/ext/opcache/shared_alloc_win32.c
@@ -177,7 +177,16 @@ static int create_segments(size_t requested_size, zend_shared_segment
***shared_
zend_shared_segment *shared_segment;
int map_retries = 0;
void *default_mapping_base_set[] = { 0, 0 };
- void *vista_mapping_base_set[] = { (void *)0x20000000, (void *)0x21000000, (void *)0x30000000,
(void *)0x31000000, (void *)0x50000000, 0 };
+ /* TODO:
+ improve fixed addresses on x64. It still makes no sense to do it as Windows addresses are
virtual per se and can or should be randomized anyway
+ through Address Space Layout Radomization (ASLR). We can still let the OS do its job and be sure
that each process gets the same address if
+ desired. Not done yet, @zend refused but did not remember the exact reason, pls add info here if
one of you know why :)
+ */
+#if defined(_WIN64)
+ void *vista_mapping_base_set[] = { (void *) 0x0000100000000000, (void *) 0x0000200000000000, (void
*) 0x0000300000000000, (void *) 0x0000700000000000, 0 };
+#else
+ void *vista_mapping_base_set[] = { (void *) 0x20000000, (void *) 0x21000000, (void *) 0x30000000,
(void *) 0x31000000, (void *) 0x50000000, 0 };
+#endif
void **wanted_mapping_base = default_mapping_base_set;
TSRMLS_FETCH();
@@ -258,11 +267,6 @@ static int create_segments(size_t requested_size, zend_shared_segment
***shared_
/* Are we running Vista ? */
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 6) {
- /* Assert that platform is 32 bit (for 64 bit we need to test a different set */
- if (si.wProcessorArchitecture != PROCESSOR_ARCHITECTURE_INTEL) {
- DebugBreak();
- }
-
wanted_mapping_base = vista_mapping_base_set;
}
} while (0);