Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Corrupted zend_mm_heap when using a closure in attribute #17851

Closed
Assignees
TimWolla
@alexandre-daubois

Description

@alexandre-daubois

Description

When working onsymfony/symfony#59800, I faced a crash in the engine. TheCI crashes on the added test:

/** * @requires PHP 8.5 */publicfunctiontestAttributesWithClosure(){$loader =newAttributeLoader();$metadata =newClassMetadata(WhenTestWithClosure::class);self::assertTrue($loader->loadClassMetadata($metadata));    [$classConstraint] =$metadata->getConstraints();// ...}

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:

useSymfony\Component\Validator\Constraints\NotBlank;useSymfony\Component\Validator\Constraints\NotNull;useSymfony\Component\Validator\Constraints\When;#[When(expression:staticfunction () {returntrue;    }, constraints:newNotNull())]class WhenTestWithClosure{    #[When(expression:staticfunction () {returntrue;    }, constraints: [newNotNull(),newNotBlank(),    ])]private$foo;}

When running the test, the output is:

............................................................. 4758 / 5217 ( 91%).................................zend_mm_heap corruptedzsh: abort      ./phpunit src/Symfony/Component/Validator/Test

This can be reproduced by checking out this PRsymfony/symfony#59800 and running with PHP 8.5:

./phpunit src/Symfony/Component/Validator/Tests/Constraints/WhenTest.php

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp