[php-src] Issue #19226: Segfault when spawning new thread in soap extension
| From: | realFlowControl | Date: | Wed, 23 Jul 2025 20:04:55 +0000 |
| Subject: | [php-src] Issue #19226: Segfault when spawning new thread in soap extension | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250482@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/19226
Author: realFlowControl
### Description
The following code:
```php
<?php
```
When served with Apache with mod_event and PHP ZTS and requested with
curl http://127.0.0.1:80/index.php`
Resulted in this output:
```
curl: (52) Empty reply from server
```
But I expected this output instead:
```
```
Crash site is
https://github.com/php/php-src/blob/2645663d9b27b7f5c0dd3ebdbe7e152cbf18a1ad/ext/opcache/ZendAccelerator.c#L614
triggered by this change in PHP 8.5 in https://github.com/php/php-src/commit/9859d837caa4dd3baf055b27de069bc9b9cc7f49
https://github.com/php/php-src/blob/2645663d9b27b7f5c0dd3ebdbe7e152cbf18a1ad/ext/soap/soap.c#L456
This only crashes if the soap extension and the opcache extension are loaded. I assume that opcache
is not propery init
```
(gdb) bt
#0 0x0000ffff94ae3264 in accel_init_interned_string_for_php (str=0xffff99a855c0 "en",
size=2, permanent=true)
at /usr/src/php-8.5.0alpha2/ext/opcache/ZendAccelerator.c:614
#1 0x0000ffff97be23f8 in php_soap_init_globals (soap_globals=0xffff9a60b940) at
/usr/src/php-8.5.0alpha2/ext/soap/soap.c:456
#2 0x0000ffff98155be4 in allocate_new_resource (thread_resources_ptr=0xffff9be028b8,
thread_id=281472896336240)
at /usr/src/php-8.5.0alpha2/TSRM/TSRM.c:406
#3 0x0000ffff98155ed0 in ts_resource_ex (id=0, th_id=0x0) at
/usr/src/php-8.5.0alpha2/TSRM/TSRM.c:451
#4 0x0000ffff98d0e124 in php_handler (r=0xffff7c8281a0) at
/usr/src/php-8.5.0alpha2/sapi/apache2handler/sapi_apache2.c:594
#5 0x0000aaaac3b0ac94 in ap_run_handler (r=0xffff7c8281a0) at config.c:169
#6 0x0000aaaac3b0c764 in ap_invoke_handler (r=0xffff7c8281a0) at config.c:443
#7 0x0000aaaac3b69338 in ap_process_async_request (r=0xffff7c8281a0) at http_request.c:452
#8 0x0000aaaac3b5d92c in ap_process_http_async_connection (c=0xffff7c823450) at http_core.c:155
#9 0x0000aaaac3b5e060 in ap_process_http_connection (c=0xffff7c823450) at http_core.c:246
#10 0x0000aaaac3b37960 in ap_run_process_connection (c=0xffff7c823450) at connection.c:42
#11 0x0000ffff9fb85858 in process_socket (thd=0xffff9bcdd350, p=0xffff7c823128, sock=0xffff7c8231a0,
cs=0xffff7c8233a0, my_child_num=2,
my_thread_num=0) at event.c:1098
#12 0x0000ffff9fb8fc68 in worker_thread (thd=0xffff9bcdd350, dummy=0xffff9b812670) at event.c:2252
#13 0x0000aaaac3a80d5c in thread_start (thread=0xffff9bcdd350, data=0xffff9bcdd340) at util.c:3198
#14 0x0000ffffa00b47ec in dummy_worker (opaque=0xffff9bcdd350) at threadproc/unix/thread.c:142
#15 0x0000ffff9ff88624 in start_thread (arg=0xffffa023c918 <asan_thread_start(void*)>) at
pthread_create.c:477
#16 0x0000ffff9fecb66c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
```
### PHP Version
```plain
PHP 8.5.0alpha2 (cli) (built: Jul 23 2025 19:30:13) (ZTS)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.5.0alpha2, Copyright (c), by Zend Technologies
```
### Operating System
Debian Bullseye