krakjoe / pcov

PCOV - CodeCoverage compatible driver for PHP
Other
698 stars 28 forks source link

pcov core dump issue in php 8.1 with phpunit @runInSeparateProcess #84

Open ostrolucky opened 2 years ago

ostrolucky commented 2 years ago

We have issue in DoctrineBundle with following test in PHP 8.1

https://github.com/doctrine/DoctrineBundle/blob/4fd840eb3c6469619be34d473af3dbc3a6b2a957/Tests/DependencyInjection/ConfigurationTest.php, see https://github.com/doctrine/DoctrineBundle/commits/test-failure-experiment and one of its CI failures

Above is reduced version of the file after troubleshooting it to shrink down the reproducer, original version was https://github.com/doctrine/DoctrineBundle/blob/2.5.x/Tests/DependencyInjection/ConfigurationTest.php

This issue happens most of the times, but not always. When it doesn't result in failure, I just rerun the build and then it fails.

As you can see in commit history, looks like issue doesn't happen if I remove other dependecies that we use (I've ensured that's the case by rerunning this successful build several times), so it's probably also related to number of files that's loaded?

After experimentation, what I can say is that it looks like all 3 things you can see in file: assertFalse() class_exists() loading class in separate file (new Configuration()) - inlining the class via anonymous class doesn't reproduce the issue

are required to reproduce issue.