[php-src] Issue #14338: segmentation fault in spl_perform_autoload
| From: | apetrosyan1613 | Date: | Mon, 27 May 2024 11:20:53 +0000 |
| Subject: | [php-src] Issue #14338: segmentation fault in spl_perform_autoload | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246970@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14338
Author: apetrosyan1613
### Description
Sometimes php-fpm terminates with a segmentation fault error, which leads to 502 HTTP errors.
We use Laravel 10 and ubuntu:focal docker image
The issue is flaky.
Resulted in this output:
```
Reading symbols from /usr/sbin/php-fpm8.2...
Reading symbols from /usr/lib/debug/.build-id/9b/5727e8bc99ab2a6361bd4941f09d751e0d402c.debug...
[New LWP 47958]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php-fpm: pool www '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055b6b28e8fdc in zif_strpos (execute_data=0x7f0b54016ac0, return_value=0x7f0b54016aa0) at
./ext/standard/string.c:1798
1798 ./ext/standard/string.c: No such file or directory.
(gdb) bt
#0 0x000055b6b28e8fdc in zif_strpos (execute_data=0x7f0b54016ac0, return_value=0x7f0b54016aa0) at
./ext/standard/string.c:1798
#1 0x000055b6b29f60e3 in ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER () at
./Zend/zend_vm_execute.h:1637
#2 execute_ex (ex=0x7f0b54016ac0) at ./Zend/zend_vm_execute.h:56099
#3 0x000055b6b297790a in zend_call_function (fci_cache=<optimized out>, fci=<optimized
out>) at ./Zend/zend_execute_API.c:949
#4 zend_call_function (fci=<optimized out>, fci_cache=<optimized out>) at
./Zend/zend_execute_API.c:749
#5 0x000055b6b2977d7d in zend_call_known_function (fn=0x55b6b50c67b8, object=<optimized out>,
called_scope=<optimized out>, retval_ptr=retval_ptr@entry=0x0,
param_count=param_count@entry=1,
params=params@entry=0x7fff631831f0, named_params=0x0) at ./Zend/zend_execute_API.c:1043
#6 0x000055b6b28707c7 in spl_perform_autoload (class_name=0x55b6b4d50998, lc_name=0x7f0b5407c500)
at ./ext/spl/php_spl.c:445
#7 0x000055b6b2976b4d in zend_lookup_class_ex (name=<optimized out>, key=key@entry=0x0,
flags=flags@entry=0) at ./Zend/zend_execute_API.c:1213
#8 0x000055b6b2976d6d in zend_lookup_class (name=<optimized out>) at
./Zend/zend_execute_API.c:1236
#9 0x000055b6b29a220d in class_exists_impl (return_value=0x7f0b540167b0, skip_flags=0, flags=9,
execute_data=0x7f0b540167c0) at ./Zend/zend_builtin_functions.c:992
#10 zif_interface_exists (execute_data=0x7f0b540167c0, return_value=0x7f0b540167b0) at
./Zend/zend_builtin_functions.c:1013
#11 0x000055b6b29f60e3 in ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER () at
./Zend/zend_vm_execute.h:1637
#12 execute_ex (ex=0x7f0b54016ac0) at ./Zend/zend_vm_execute.h:56099
#13 0x000055b6b297790a in zend_call_function (fci_cache=<optimized out>, fci=<optimized
out>) at ./Zend/zend_execute_API.c:949
#14 zend_call_function (fci=<optimized out>, fci_cache=<optimized out>) at
./Zend/zend_execute_API.c:749
#15 0x000055b6b2977d7d in zend_call_known_function (fn=0x55b6b50c67b8, object=<optimized out>,
called_scope=<optimized out>, retval_ptr=retval_ptr@entry=0x0,
param_count=param_count@entry=1,
params=params@entry=0x7fff63183510, named_params=0x0) at ./Zend/zend_execute_API.c:1043
#16 0x000055b6b28707c7 in spl_perform_autoload (class_name=0x55b6b4b3fce8, lc_name=0x55b6b4d50728)
at ./ext/spl/php_spl.c:445
#17 0x000055b6b2976b4d in zend_lookup_class_ex (name=name@entry=0x55b6b4b3fce8, key=0x55b6b4d50728,
flags=flags@entry=6) at ./Zend/zend_execute_API.c:1213
#18 0x000055b6b2978136 in zend_fetch_class_by_name (class_name=0x55b6b4b3fce8, key=<optimized
out>, fetch_type=fetch_type@entry=6) at ./Zend/zend_execute_API.c:1716
#19 0x000055b6b2a20052 in zend_do_link_class (ce=ce@entry=0x55b6b5660220,
lc_parent_name=lc_parent_name@entry=0x0, key=0x55b6b4d46cb8) at ./Zend/zend_inheritance.c:2878
#20 0x000055b6b2961343 in zend_bind_class_in_slot (class_table_slot=<optimized out>,
lcname=0x55b6b5665d18, lc_parent_name=0x0) at ./Zend/zend_compile.c:1124
#21 0x000055b6b296143c in do_bind_class (lcname=0x55b6b5665d18, lc_parent_name=0x0) at
./Zend/zend_compile.c:1158
```
But I expected this output instead:
No errors returned by php-fpm
### PHP Version
PHP 8.2.18, PHP 8.2.19
### Operating System
Ubuntu 20.04 (docker), Amazon Linux 2 on EKS nodes