8000 Assertion failure in Zend/zend_exceptions.c:630 · Issue #16188 · php/php-src · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure in Zend/zend_exceptions.c:630 #16188

Closed
YuanchengJiang opened this issue Oct 3, 2024 · 2 comments
Closed

Assertion failure in Zend/zend_exceptions.c:630 #16188

YuanchengJiang opened this issue Oct 3, 2024 · 2 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
function foo($vars) {
foreach ($vars as $i => $v1) {
foreach ($vars as $j => $v2) {
try {
$reflection = new ReflectionFunction('strripos');
$result[$randomFunction][] = $reflection->invokeArgs($vars);
} catch (\Throwable $e) {
}
}
}
}
try {
new ReflectionProperty();
} catch (TypeError $re) {
}
$fusion = $re;
function apply_dumb($item, $key) {};
array_walk_recursive($fusion, 'apply_dumb');
$vars = [$re,$re,$re];
foo($vars);

Resulted in this output:

/php-src/Zend/zend_exceptions.c:630: void zim_Exception_getTraceAsString(zend_execute_data *, zval *): Assertion `zval_get_type(&(*(trace))) == 7' failed.
Aborted (core dumped)

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

@DanielEScherzer
Copy link
Contributor

Minimal reproduction:

<?php
$re = new TypeError();
function apply_dumb($item, $key) {};
array_walk_recursive($re, 'apply_dumb');
strripos( '', $re, 0 );

produces

root@3acd01cef279:/usr/src/php# php /var/www/html/test.php 
php: /usr/src/php/Zend/zend_exceptions.c:630: zim_Exception_getTraceAsString: Assertion `zval_get_type(&(*(trace))) == 7' failed.
Aborted

@arnaud-lb arnaud-lb self-assigned this Oct 3, 2024
@arnaud-lb
Copy link
Member

getTraceAsString() assumes that $re->trace is an array because of its type hint. However it may also be a reference to an array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0