Skip to content

8.4 function JIT memory corruption #16913

Closed

Description

@danog

Description

Multiple tests in the psalm testsuite (master branch) fail with function JIT enabled on 8.4:

  • tests/LanguageServer/CompletionTest.php
  • tests/FileUpdates/ErrorAfterUpdateTest.php

PHP Version

8.4

Operating System

No response

Activity

  1. danog commented on Nov 24, 2024

    @danog
    ContributorAuthor
  2. self-assigned this
    on Nov 25, 2024
  3. dstogov commented on Nov 25, 2024

    @dstogov
    Member

    I can't reproduce this:

    $ ../../php8.4/CGI-DEBUG-64/sapi/cli/php -d opcache.jit=function vendor/bin/phpunit tests/LanguageServer/CompletionTest.php
    PHPUnit 9.6.21 by Sebastian Bergmann and contributors.
    
    Random Seed:   1732546680
    
    ..............................................                    46 / 46 (100%)
    
    Time: 01:55.105, Memory: 690.00 MB
    
    OK (46 tests, 102 assertions)
    
    $ ../../php8.4/CGI-DEBUG-64/sapi/cli/php -d opcache.jit=function vendor/bin/phpunit tests/FileUpdates/ErrorAfterUpdateTest.php 
    PHPUnit 9.6.21 by Sebastian Bergmann and contributors.
    
    Random Seed:   1732546964
    
    ......................                                            22 / 22 (100%)
    
    Time: 00:05.661, Memory: 116.00 MB
    
    OK (22 tests, 44 assertions
    
    $ ../../php8.4/CGI-DEBUG-64/sapi/cli/php -d opcache.jit=function vendor/bin/phpunit -v tests/UnusedVariableTest.php 
    PHPUnit 9.6.21 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.4.1-dev
    Configuration: /home/dmitry/php/community_tests/psalm/phpunit.xml.dist
    Random Seed:   1732544955
    
    ....................................................S....S.....  63 / 293 ( 21%)
    ..S......S...........S.........................S............... 126 / 293 ( 43%)
    ............................................................... 189 / 293 ( 64%)
    ............................................................... 252 / 293 ( 86%)
    .........................................                       293 / 293 (100%)
    
    Time: 09:21.384, Memory: 124.50 MB
    
    There were 6 skipped tests:
    
    1) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-warnAboutVariableUsedInNestedTryNotUsedInOuterTry" ('<?php\n                    $s...      ', 'UnusedVariable')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    2) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-unusedReferenceInDestructuredForeach" ('<?php\n                    fo...      ', 'UnusedForeachValue')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    3) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-byrefInForeachLoopWithoutReference" ('<?php\n                    $a...     }', 'UnusedVariable')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    4) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-unusedGlobalVariable" ('<?php\n                    $a...      ', 'UnusedVariable - src/somefile...1 - $a')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    5) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-unusedReferenceToSubsequentlyUsedVariable" ('<?php\n                    $a...      ', 'UnusedVariable - src/somefile...1 - $b')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    6) Psalm\Tests\UnusedVariableTest::testValidCode with data set "SKIPPED-referenceUsedInDestructuredForeach" ('<?php\n                    fo...      ')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/ValidCodeAnalysisTestTrait.php:62
    
    OK, but incomplete, skipped, or risky tests!
    Tests: 293, Assertions: 373, Skipped: 6.
    
    $ ../../php8.4/CGI-DEBUG-64/sapi/cli/php -d opcache.jit=0 vendor/bin/phpunit -v tests/UnusedVariableTest.php 
    PHPUnit 9.6.21 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.4.1-dev
    Configuration: /home/dmitry/php/community_tests/psalm/phpunit.xml.dist
    Random Seed:   1732545823
    
    ..............................................S................  63 / 293 ( 21%)
    ............................................................... 126 / 293 ( 43%)
    ............................................................... 189 / 293 ( 64%)
    ..............................S.............................S.. 252 / 293 ( 86%)
    ..S.................S.................S..                       293 / 293 (100%)
    
    Time: 13:16.966, Memory: 126.50 MB
    
    There were 6 skipped tests:
    
    1) Psalm\Tests\UnusedVariableTest::testValidCode with data set "SKIPPED-referenceUsedInDestructuredForeach" ('<?php\n                    fo...      ')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/ValidCodeAnalysisTestTrait.php:62
    
    2) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-unusedReferenceToSubsequentlyUsedVariable" ('<?php\n                    $a...      ', 'UnusedVariable - src/somefile...1 - $b')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    3) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-warnAboutVariableUsedInNestedTryNotUsedInOuterTry" ('<?php\n                    $s...      ', 'UnusedVariable')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    4) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-unusedGlobalVariable" ('<?php\n                    $a...      ', 'UnusedVariable - src/somefile...1 - $a')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    5) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-unusedReferenceInDestructuredForeach" ('<?php\n                    fo...      ', 'UnusedForeachValue')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    6) Psalm\Tests\UnusedVariableTest::testInvalidCode with data set "SKIPPED-byrefInForeachLoopWithoutReference" ('<?php\n                    $a...     }', 'UnusedVariable')
    Skipped due to a bug.
    
    /home/dmitry/php/community_tests/psalm/tests/Traits/InvalidCodeAnalysisTestTrait.php:63
    
    OK, but incomplete, skipped, or risky tests!
    Tests: 293, Assertions: 373, Skipped: 6.
    
  4. danog commented on Nov 25, 2024

    @danog
    ContributorAuthor
  5. danog commented on Nov 25, 2024

    @danog
    ContributorAuthor

    Just for context, running on an x86-64-v3 machine (no avx512, only avx2)

  6. added 2 commits that reference this issue on Nov 26, 2024
    f98f594
    7892a0e
  7. added a commit that references this issue on Nov 26, 2024
    7b17313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions