[php-src] Issue #14305: Seeing seg fault while using zend_disable_functions during shutdown
| From: | aswingit | Date: | Thu, 23 May 2024 14:36:33 +0000 |
| Subject: | [php-src] Issue #14305: Seeing seg fault while using zend_disable_functions during shutdown | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246951@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14305
Author: aswingit
### Description
The following code:
I have a custom extension function that calls "zend_disable_functions" based on specific
conditions. I've observed that it causes a segmentation fault during the shutdown phase with
the following stack trace in PHP 8.3.6. This issue did not occur in PHP 8.1. Any suggestions? The
issue occurs when destroying the function table hash.
Extension
```
ZEND_DLEXPORT PHP_FUNCTION(my_custom_function)
{
// There is some additional logic here
zend_disable_functions("dl");
}
```
Resulted in this error:
```
#zend_free_internal_arg_info at /Zend/zend_opcode.c:137
#zend_function_dtor at Zend/zend_opcode.c:158
#zend_hash_destroy at Zend/zend_hash.c:1764
#zend_shutdown () at Zend/zend.c:1130
#php_module_shutdown () at main/main.c:2382
```
### PHP Version
PHP 8.3.6
### Operating System
_No response_