|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-02-21 19:48 UTC] mberchtold at gmail dot com
Description:
------------
With preloading (preloading of zend framework 3, others) enabled, visiting certain urls of the website crashes php-cgi.exe
When preloading is disabled, or when no classes are preloaded it does not crash.
php master: r82d6759
> php8.dll!zend_mm_shutdown(_zend_mm_heap * heap, int full, int silent) Line 2269 C
[Inline Frame] php8.dll!shutdown_memory_manager(int) C
php8.dll!php_module_startup(_sapi_module_struct * sf, _zend_module_entry * additional_modules, unsigned int num_additional_modules) Line 2405 C
php-cgi.exe!php_cgi_startup(_sapi_module_struct * sapi_module) Line 973 C
php-cgi.exe!main(int argc, char * * argv) Line 1921 C
[Inline Frame] php-cgi.exe!invoke_main() Line 78 C++
php-cgi.exe!__scrt_common_main_seh() Line 288 C++
kernel32.dll!00007ff81f3b81f4() Unknown
ntdll.dll!00007ff82174a251() Unknown
zend_mm_shutdown
...
Code:
/* move all chunks except of the first one into the cache */
p = heap->main_chunk->next;
while (p != heap->main_chunk) {
---> zend_mm_chunk *q = p->next;
// p is null
p->next = heap->cached_chunks;
heap->cached_chunks = p;
p = q;
heap->chunks_count--;
heap->cached_chunks_count++;
}
Locals:
+ heap 0x0000026899200040 {use_custom_heap=0x00000000 storage=0x0000000000000000 <NULL> size=0x0000000000000000 ...} _zend_mm_heap *
+ heap->main_chunk 0x0000026899200000 {heap=0x0000026899200040 {use_custom_heap=0x00000000 storage=0x0000000000000000 <NULL> ...} ...} _zend_mm_chunk *
+ heap->main_chunk->next 0x0000000000000000 <NULL> _zend_mm_chunk *
+ p 0x0000000000000000 <NULL> _zend_mm_chunk *
For some reason, heap->main_chunk->next is NULL which looks unexpected (heap corruption?).
Test script:
---------------
I don't have a reproducible case other than that it always crashes when accessing a certain url on an internal website.
Expected result:
----------------
no crash
Actual result:
--------------
Unhandled exception thrown: read access violation.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 09:00:02 2025 UTC |
With opcache.protect_memory=1 and the latest snapshot, I get the following crash now: [Inline Frame] php_opcache.dll!accel_interned_strings_save_state() Line 416 C php_opcache.dll!accel_use_shm_interned_strings() Line 749 C php_opcache.dll!accel_post_startup() Line 2986 C [Inline Frame] php8.dll!zend_post_startup() Line 992 C php8.dll!php_module_startup(_sapi_module_struct * sf, _zend_module_entry * additional_modules, unsigned int num_additional_modules) Line 2337 C php-cgi.exe!php_cgi_startup(_sapi_module_struct * sapi_module) Line 969 C php-cgi.exe!main(int argc, char * * argv) Line 1916 C > [Inline Frame] php-cgi.exe!invoke_main() Line 78 C++ php-cgi.exe!__scrt_common_main_seh() Line 288 C++ kernel32.dll!BaseThreadInitThunk() Unknown ntdll.dll!RtlUserThreadStart() Unknown code: static void accel_interned_strings_save_state(void) { ZCSG(interned_strings).saved_top = ZCSG(interned_strings).top; } debug out: Unhandled exception thrown: write access violation. **accel_shared_globals** was 0x100000000080.