Skip to content

8.4 function JIT memory corruption #16913

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

Closed
danog opened this issue Nov 24, 2024 · 4 comments
Closed

8.4 function JIT memory corruption #16913

danog opened this issue Nov 24, 2024 · 4 comments

Comments

@danog
Copy link
Contributor

danog commented Nov 24, 2024

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

@danog
Copy link
Contributor Author

danog commented Nov 24, 2024

@dstogov
Copy link
Member

dstogov commented Nov 25, 2024

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.

@danog
Copy link
Contributor Author

danog commented Nov 25, 2024

@danog
Copy link
Contributor Author

danog commented Nov 25, 2024

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

dstogov added a commit to dstogov/php-src that referenced this issue Nov 26, 2024
 with '#' will be ignored, and an empty message aborts the commit.
dstogov added a commit that referenced this issue Nov 26, 2024
* PHP-8.4:
  Fix GH-16913: 8.4 function JIT memory corruption (#16943)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants