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

Newrelic causes error handlers loop to get stuck, tests run out of memory #5808

Open
janfejtek opened this issue Apr 10, 2024 · 3 comments
Open
Labels
status/waiting-for-feedback Waiting for feedback from original reporter type/bug Something is broken

Comments

@janfejtek
Copy link

janfejtek commented Apr 10, 2024

Q A
PHPUnit version 11.1.0
PHP version 8.2
Installation Method Composer

Summary

Library does not work on php with newrelic extension

Current behavior

When running test with php that contains newrelic extension, we get out of memory error. Loop here gets stuck

private function getActiveErrorHandlers(): array
{
$res = [];
while (true) {
$previousHandler = set_error_handler(static fn () => false);
restore_error_handler();
if ($previousHandler === null) {
break;
}
$res[] = $previousHandler;
restore_error_handler();
}
$res = array_reverse($res);
foreach ($res as $handler) {
set_error_handler($handler);
}
return $res;
}

How to reproduce

Expected behavior

There was similar issue in Symfony - symfony/symfony#25774 . Used fix is here https://github.com/symfony/symfony/pull/25755/files

@janfejtek janfejtek added the type/bug Something is broken label Apr 10, 2024
@sebastianbergmann
Copy link
Owner

Thank you for your report.

Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting.

Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.

@sebastianbergmann sebastianbergmann added the status/waiting-for-feedback Waiting for feedback from original reporter label Apr 10, 2024
@sebastianbergmann
Copy link
Owner

@mvorisek What do you think?

@mvorisek
Copy link
Contributor

mvorisek commented Apr 10, 2024

OP needs to provide minimal repro.

(also note the mentioned Symfony issue is from 2018, ie. quite unreleated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/waiting-for-feedback Waiting for feedback from original reporter type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants