You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The phar isn't actually used in the segfaulting code, but when I don't load it it works fine. The initialization of the phar probably causes some internal state change revealing this bug.
Since I built the phar I've attempted to track down the internal cause of the issue. Locally I've reduced it to these files:
Removing the call to Utils::composerSkipFlags from init.php:64 will stop the segfault. It's not caused by loading the class, since calling another Utils method instead works fine.
This occurs even when the entirety of Utils is stubbed to:
Thanks for the very clear report. I can reproduce this on 8.2+.
It's a variant of GH-10200. I applied the same concept for the fix here and it works.
I'm submitting a PR soon.
nielsdos
added a commit
to nielsdos/php-src
that referenced
this issue
Mar 30, 2023
…perties
This is a variant of phpGH-10200, but in a different place.
Basically, simplexml may create a properties table that's packed instead
of associative. But the macro that was used to loop over the properties
table assumed that it was always associative. Replace it by the macro
that figures it out automatically which one of the two it is.
* PHP-8.2:
FixGH-10983: State-dependant segfault in ReflectionObject::getProperties
FixGH-10990: mail() throws TypeError after iterating over $additional_headers array by reference
FixGH-8841: php-cli core dump calling a badly formed function
Description
The following code:
Resulted in this output:
But I expected this output instead:
The phar isn't actually used in the segfaulting code, but when I don't load it it works fine. The initialization of the phar probably causes some internal state change revealing this bug.
Since I built the phar I've attempted to track down the internal cause of the issue. Locally I've reduced it to these files:
Removing the call to
Utils::composerSkipFlags
frominit.php:64
will stop the segfault. It's not caused by loading the class, since calling anotherUtils
method instead works fine.This occurs even when the entirety of
Utils
is stubbed to:Meanwhile, removing most of the methods from the
Kint
class suddenly makes calling the other methods fromUtils
cause the segfault again.Removing or changing the return type of any of the following
Kint
methods will fix the segfault:So long story short something strange is happening internally and I don't have the tools to debug it further.
GDB backtrace:
Full version info:
Debian sid package
php8.2-cli
version8.2.4-1
PHP Version
PHP 8.2.4
Operating System
Debian Sid
The text was updated successfully, but these errors were encountered: