[php-src] Issue #8250: Apache 2.4.53 & PHP 8.1.4 & Laravel 9 access violation in emalloc (Windows/10)

From: Date: Fri, 25 Mar 2022 14:19:43 +0000
Subject: [php-src] Issue #8250: Apache 2.4.53 & PHP 8.1.4 & Laravel 9 access violation in emalloc (Windows/10)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-240497@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8250 Author: MircoBabin ### Description I have on my development system an access violation in php8ts.dll. And I don't know where to look for. Loading a simple PHP page works. But loading a page via the Laravel 9 framework crashes. I have attached the Apache conf and php.ini in [Configs.zip](https://github.com/php/php-src/files/8351239/Configs.zip). Summary: * I'm upgrading from Laravel 7 & PHP 7.2.31 to Laravel 9 & PHP 8.1.4. * I'm using the 32bit thread safe version. * I'm running a local development Apache webserver. With the settings: ``` D:\Projects\bin\apache\bin>httpd -v Server version: Apache/2.4.53 (Win32) Apache Lounge VS16 Server built: Mar 16 2022 10:58:29 ``` ``` AddHandler application/x-httpd-php .php AddType application/x-httpd-php .php .html LoadModule php_module "d:/projects/bin/php-8.1.4/php8apache2_4.dll" PHPIniDir "C:/Users/Mirco/AppData/Local/Temp/GitNoob/project-TripPortals/directory-WorkInProgress/php.ini" ``` ``` <IfModule mpm_winnt_module> ThreadStackSize 8388608 </IfModule> ``` * When loading the first page from Laravel (which should be the login page) with http://localhost:6001 Apache crashes with: ``` [Fri Mar 25 14:20:44.318029 2022] [mpm_winnt:notice] [pid 10396:tid 516] AH00428: Parent: child process 11936 exited with status 3221225477 -- Restarting. ``` * I attached a VS2015 debugger to the Apache crashing child httpd.exe process. The crash occurs in php8ts.dll function [emalloc() line 2541](https://github.com/php/php-src/blob/964f494ad13c3cc9b4a17704ca1e5ba3cdb3e0c5/Zend/zend_alloc.c#L2541). ``` Registers EAX = 00E6EFC0 EBX = 00000004 ECX = 00000001 EDX = 24800040 ESI = 24800040 EDI = 256E8990 EIP = 61104453 ESP = 0491D750 EBP = 0491D758 EFL = 00010202 0x00000001 = 00000000 Stacktrace > php8ts.dll!emalloc(unsigned int size) Line 2541 C php8ts.dll!zend_compile_if(_zend_ast * ast) Line 5381 C php8ts.dll!zend_compile_stmt(_zend_ast * ast) Line 10006 C php8ts.dll!zend_compile_stmt_list(_zend_ast * ast) Line 6150 C php8ts.dll!zend_compile_stmt(_zend_ast * ast) Line 9966 C php8ts.dll!zend_compile_func_decl(_znode * result, _zend_ast * ast, bool toplevel) Line 7270 C php8ts.dll!zend_compile_stmt(_zend_ast * ast) Line 10018 C php8ts.dll!zend_compile_stmt_list(_zend_ast * ast) Line 6150 C php8ts.dll!zend_compile_stmt(_zend_ast * ast) Line 9966 C php8ts.dll!zend_compile_class_decl(_znode * result, _zend_ast * ast, bool toplevel) Line 7747 C php8ts.dll!zend_compile_top_stmt(_zend_ast * ast) Line 9940 C php8ts.dll!zend_compile_top_stmt(_zend_ast * ast) Line 9929 C php8ts.dll!zend_compile(int type) Line 620 C php8ts.dll!compile_file(_zend_file_handle * file_handle, int type) Line 655 C php8ts.dll!phar_compile_file(_zend_file_handle * file_handle, int type) Line 3351 C php8ts.dll!compile_filename(int type, _zend_string * filename) Line 706 C php8ts.dll!zend_include_or_eval(_zval_struct * inc_filename_zv, int type) Line 4617 C php8ts.dll!ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(_zend_execute_data * execute_data) Line 38538 C php8ts.dll!execute_ex(_zend_execute_data * ex) Line 55210 C php8ts.dll!zend_call_function(_zend_fcall_info * fci, _zend_fcall_info_cache * fci_cache) Line 897 C php8ts.dll!zend_call_known_function(_zend_function * fn, _zend_object * object, _zend_class_entry * called_scope, _zval_struct * retval_ptr, unsigned int param_count, _zval_struct * params, _zend_array * named_params) Line 985 C php8ts.dll!spl_perform_autoload(_zend_string * class_name, _zend_string * lc_name) Line 434 C php8ts.dll!zend_lookup_class_ex(_zend_string * name, _zend_string * key, unsigned int flags) Line 1129 C php8ts.dll!zend_fetch_class_by_name(_zend_string * class_name, _zend_string * key, int fetch_type) Line 1589 C php8ts.dll!ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(_zend_execute_data * execute_data) Line 6778 C php8ts.dll!execute_ex(_zend_execute_data * ex) Line 55210 C php8ts.dll!zend_execute(_zend_op_array * op_array, _zval_struct * return_value) Line 59773 C php8ts.dll!zend_execute_scripts(int type, _zval_struct * retval, int file_count, ...) Line 1759 C php8ts.dll!php_execute_script(_zend_file_handle * primary_file) Line 2538 C php8apache2_4.dll!php_handler(request_rec * r) Line 705 C libhttpd.dll!6243ccf5() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for libhttpd.dll] libhttpd.dll!6243bf05() Unknown libhttpd.dll!62438ee5() Unknown mod_rewrite.so!737f4997() Unknown libhttpd.dll!6243ccf5() Unknown libhttpd.dll!6243bf05() Unknown libhttpd.dll!624390e4() Unknown libhttpd.dll!62439160() Unknown libhttpd.dll!624335ab() Unknown libhttpd.dll!6243efc5() Unknown libhttpd.dll!6243ee62() Unknown libhttpd.dll!6244bcd2() Unknown [External Code] ``` ![image](https://user-images.githubusercontent.com/8981285/160135567-fba9c63f-3d2d-41d7-8845-656d8b7011e0.png) ### PHP Version PHP 8.1.4 ### Operating System Windows/10

« previous php.bugs (#240497) next »