[php-src] Issue #12099: phpdbg abort/segfault (php 8.1.21)
| From: | particleflux | Date: | Thu, 31 Aug 2023 22:26:33 +0000 |
| Subject: | [php-src] Issue #12099: phpdbg abort/segfault (php 8.1.21) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245307@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12099
Author: particleflux
### Description
Running phpdbg for coverage reporting results in an abort.
On the following example project:
[phpdbg-crash.zip](https://github.com/php/php-src/files/12490863/phpdbg-crash.zip)
The command
```
phpdbg -qrr vendor/bin/phpunit
```
crashes with
```
PHPUnit 9.6.11 by Sebastian Bergmann and contributors.
Runtime: PHPDBG 8.1.21
Configuration: /home/stefan/tmp/phpdbg/phpunit.xml
. 1 / 1 (100%)
Time: 00:00.240, Memory: 40.00 MB
OK (1 test, 1 assertion)
Generating code coverage report in Clover XML format ... done [00:00.008]
phpdbg:
/var/tmp/portage/dev-lang/php-8.1.21/work/sapis-build/phpdbg/ext/standard/basic_functions.c:1711:
user_shutdown_function_call: Assertion `call_status == SUCCESS' failed.
Aborted (core dumped)
```
PHP version:
```
PHP 8.1.21 (cli) (built: Aug 31 2023 23:15:42) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.1.21, Copyright (c) Zend Technologies
with Zend OPcache v8.1.21, Copyright (c), by Zend Technologies
```
GDB backtrace
```
Core was generated by `phpdbg -qrr vendor/bin/phpunit'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007f79acba068c in ?? () from /lib64/libc.so.6
(gdb) bt
#0 0x00007f79acba068c in ?? () from /lib64/libc.so.6
#1 0x00007f79acb50952 in raise () from /lib64/libc.so.6
#2 0x00007f79acb3a4b2 in abort () from /lib64/libc.so.6
#3 0x00007f79acb3a3d5 in ?? () from /lib64/libc.so.6
#4 0x00007f79acb49642 in __assert_fail () from /lib64/libc.so.6
#5 0x000055625ae4aa36 in user_shutdown_function_call (zv=0x7f79aa97f508) at
/usr/src/debug/dev-lang/php-8.1.21/sapis-build/phpdbg/ext/standard/basic_functions.c:1711
#6 0x000055625b062d4c in zend_hash_apply (ht=0x7f79aa938780, apply_func=0x55625ae4a9bc
<user_shutdown_function_call>) at
/usr/src/debug/dev-lang/php-8.1.21/sapis-build/phpdbg/Zend/zend_hash.c:1875
#7 0x000055625ae4acba in php_call_shutdown_functions () at
/usr/src/debug/dev-lang/php-8.1.21/sapis-build/phpdbg/ext/standard/basic_functions.c:1771
#8 0x000055625af9adb5 in php_request_shutdown (dummy=0x0) at
/usr/src/debug/dev-lang/php-8.1.21/sapis-build/phpdbg/main/main.c:1805
#9 0x000055625b1c3c47 in main (argc=3, argv=0x7ffe1a31aaa8) at
/usr/src/debug/dev-lang/php-8.1.21/sapis-build/phpdbg/sapi/phpdbg/phpdbg.c:1720
```
(This example is a cut down version of this project, which generates an ABORT, the "full"
project randomly gives an ABORT or a SEGFAULT instead. Happened on PHP 8.0.30 and 8.1.21, on gentoo
and on ubuntu.)
### PHP Version
PHP 8.1.21
### Operating System
Gentoo (but also on ubuntu docker cimg/php:8.1 and 8.0)