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
Segmentation fault @ PHP 8.1 #4844
Comments
You have found a problem in the PHP runtime that leads to a segmentation fault. An issue like this has to be reported here using a minimal, self-contained, reproducing test case. Please note that a test case that needs to be run through PHPUnit does not qualify as either "minimal" or "self-contained" when reporting bugs for the PHP runtime. Best practices for reporting bugs in PHP are documented here. |
I reported it here because I'm not sure that it's just a PHP issue. Mock creation is failing only in the data provider – creating it in a test works fine. Anyway, I've reported it to PHP – php/php-src#7809. Let's see how it goes. |
While there are cases where userland code can trigger a segfault due to stack overflow, a null pointer dereference is always a bug in PHP. However, I have to admit that this mockery stretches what PHP has to handle. :) |
Ran into a similar issue and spent the evening trying to understand what happened (PHP 8.2, PHPUnit 10.3). Turns out it was because I was mocking a class that had a __destruct method, which was calling a public method as last statement: https://dragoshmocrii.com/php-and-phpunit-process-finished-with-exit-code-139-interrupted-by-signal-11-sigsegv/ I believe that the cause of the segfault is null pointer dereferencing, but can't put my finger on it. |
@DragosMocrii please create a minimal reproduction and report to https://github.com/php/php-src/ |
@b1rdex just did! php/php-src#12373 |
Summary
We have some code that worked without any issues on PHP 8.0, but it's failing with a segmentation fault on 8.1.
I'm not sure whether it's a PHPUnit or PHP issue... So please see the code. Mock creation triggers the problem.
Current behavior
Segmentation fault.
How to reproduce
Test repo: https://github.com/b1rdex/php-8.1-segfault
Expected behavior
No problem :)
The text was updated successfully, but these errors were encountered: