-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Corrupted zend_mm_heap when using a closure in attribute #17851
Comments
|
Simple reproducer: dummy.php <?php
#[Attr(static function () {
return true;
})]
class Dummy {} test5.php <?php
spl_autoload_register(static function ($className) {
if ($className === 'Dummy') {
require(__DIR__ . '/dummy.php');
}
});
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
class Attr
{
public function __construct(public Closure $value) {}
}
(new ReflectionClass('Dummy'))->getAttributes()[0]->newInstance(); Results in:
|
I have same issue on PHP 8.4.4. It occurs not every time, but very frequently. There were no problems on PHP 8.4.3. |
@sartor The “zend_mm_heap corrupted” message is just a symptom of a large number of possible errors. Even though the message is the same, your issue has a different cause. Can you try to narrow down what triggers the message in your case and then file a separate issue? |
This error happens when i run specific test via phpunit that send small request using Symfony http client. I can't easily extract small amount of code to provide it here |
You can try the following:
The second step with running PHP in valgrind should (hopefully) point out some error details when the issue is reproducible. The first step is necessary for valgrind to correctly detect the issue. |
Thank you for suggestion!
|
@sartor It appears that you forgot the |
I run this command, but not correct, because i run test in docker. Now output changed from:
|
@sartor Thank you. Unfortunately it appears that valgrind did not detect an issue, which is surprising. This issue is not the right place for further analysis of your issue, since it clearly has a different cause. Would you mind filing a separate issue with the output above so that someone else can also have a look? Please link to our existing discussion and please also indicate if you are using any non-default extensions (e.g. Xdebug for code coverage). |
Description
When working on symfony/symfony#59800, I faced a crash in the engine. The CI crashes on the added test:
After a short investigation,
$loader->loadClassMetadata($metadata)
is the culprit. This happens when using closures in attributes, here is the fixtures that causes the crash:When running the test, the output is:
This can be reproduced by checking out this PR symfony/symfony#59800 and running with PHP 8.5:
I tried to make a simpler reproducer but I wasn't able to. I'd be happy to help setting up the reproducer described if needed. Thanks!
PHP Version
8.5
Operating System
macOS 15.3.1
The text was updated successfully, but these errors were encountered: