[php-src] Issue #11233: php under apache crashes on shutdown child process
| From: | ZigzagAK | Date: | Fri, 12 May 2023 07:44:09 +0000 |
| Subject: | [php-src] Issue #11233: php under apache crashes on shutdown child process | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244432@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11233
Author: ZigzagAK
### Description
Sometimes php crashes on shutdown apache worker.
Apache/2.4.57 + PHP 8.0.28
Locally I can't reproduce this bug. Valgrind also can't see any issue, but our customer
have this issue. Crashes always happens with same stacktrace.
```
#7 0x00007fee63cec3d7 in raise () from /lib64/libc.so.6
#8 0x00007fee63cedac8 in abort () from /lib64/libc.so.6
#9 0x00007fee63d2ef67 in __libc_message () from /lib64/libc.so.6
#10 0x00007fee63d36824 in malloc_consolidate () from /lib64/libc.so.6
#11 0x00007fee63d3720e in _int_free () from /lib64/libc.so.6
#12 0x00007fee5a907dd1 in zend_shutdown () at
/opt/teamcity-agent/work/939250ae46785581/User_Part/Source/apache_24/build/php-8.0.28/Zend/zend.c:1099
#13 0x00007fee5a8904f5 in php_module_shutdown () at
/opt/teamcity-agent/work/939250ae46785581/User_Part/Source/apache_24/build/php-8.0.28/main/main.c:2417
#14 0x00007fee5a890569 in php_module_shutdown_wrapper (sapi_globals=<optimized out>) at
/opt/teamcity-agent/work/939250ae46785581/User_Part/Source/apache_24/build/php-8.0.28/main/main.c:2388
#15 0x00007fee5a9a9721 in php_apache_child_shutdown (tmp=<optimized out>) at
/opt/teamcity-agent/work/939250ae46785581/User_Part/Source/apache_24/build/php-8.0.28/sapi/apache2handler/sapi_apache2.c:426
#16 0x00007fee644bd1ce in apr_pool_destroy () from /lib64/libapr-1.so.0
#17 0x00000000004779af in clean_child_exit (code=0) at worker.c:442
#18 0x00000000004782ab in child_main (child_num_arg=child_num_arg@entry=1,
child_bucket=child_bucket@entry=0) at worker.c:1289
#19 0x00000000004786de in make_child (s=0x26466d8, slot=slot@entry=1, bucket=0) at worker.c:1349
#20 0x000000000047a0f0 in startup_children (number_to_start=3) at worker.c:1376
#21 worker_run (_pconf=<optimized out>, plog=0x264a458, s=0x26466d8) at worker.c:1784
#22 0x0000000000434a4e in ap_run_mpm (pconf=pconf@entry=0x261b138, plog=0x264a458, s=0x26466d8) at
mpm_common.c:95
#23 0x000000000042bb84 in main (argc=5, argv=0x7ffcc7cbdfb8) at main.c:842
```
```
*** Error in `./httpd': corrupted size vs. prev_size: 0x00000000030d7ca0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x80824)[0x7fee63d36824]
/lib64/libc.so.6(+0x8120e)[0x7fee63d3720e]
/data/sbms/apache-app/versions/20230503-145105/modules/libphp.so(+0x490dd1)[0x7fee5a907dd1]
/data/sbms/apache-app/versions/20230503-145105/modules/libphp.so(php_module_shutdown+0x35)[0x7fee5a8904f5]
/data/sbms/apache-app/versions/20230503-145105/modules/libphp.so(php_module_shutdown_wrapper+0x9)[0x7fee5a890569]
/data/sbms/apache-app/versions/20230503-145105/modules/libphp.so(+0x532721)[0x7fee5a9a9721]
/lib64/libapr-1.so.0(apr_pool_destroy+0x7e)[0x7fee644bd1ce]
./httpd[0x4779af]
./httpd[0x4782ab]
./httpd[0x4786de]
./httpd[0x47a0f0]
./httpd(ap_run_mpm+0x4e)[0x434a4e]
./httpd(main+0xb74)[0x42bb84]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fee63cd8555]
./httpd[0x42bd0b]
```
### PHP Version
PHP 8.0.28
### Operating System
RHEL 7