-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Assertion with function/tracing JIT #12428
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
Comments
Full output:
|
Same assertion occurs when using function JIT, not when JIT is disabled. |
Backtraces:
|
Minimal reproducer: <?php
function validate($value)
{
foreach ([0] as $_) {
$a = &$value->a;
$value->a ?? null;
}
}
validate((object) []);
validate((object) []);
validate((object) ['b' => 0]); |
* PHP-8.1: Fixed GH-12428: Assertion with function/tracing JIT
* PHP-8.2: Fixed GH-12428: Assertion with function/tracing JIT
* PHP-8.3: Fixed GH-12428: Assertion with function/tracing JIT
Thanks for the small test case. It's fixed now. |
Hi @dstogov, no problem, but it seems another similar assertion is still being emitted when running the testsuite, will try to isolate again but maybe there's another similar place in the code that can trigger the issue?
Regarding the testsuite improvements PRs, #12425 is ready to merge, as is #12406. Will submit a new PR with a nightly test for infection, and another PR that further improves JIT coverage by running all unit tests 3x times in a php-fpm daemon, or by using the file cache this weekend. |
I can't reproduce the bug with infection |
Hi @dstogov, I can reproduce with this slightly reduced testcase using commit 745a346 of php-src: <?php
require 'vendor/autoload.php';
use Infection\Configuration\Entry\Logs;
use Infection\Configuration\Entry\PhpUnit;
use Infection\Configuration\Entry\Source;
use Infection\Configuration\Schema\SchemaConfiguration;
use Infection\Configuration\Schema\SchemaConfigurationFactory;
use JsonSchema\Validator;
function test_it_can_create_a_config(
string $json,
): void {
$rawConfig = json_decode($json);
$validator = new Validator();
$validator->validate($rawConfig, json_decode('{
"$schema": "https://json-schema.org/draft-07/schema#",
"properties": {
"source": {"type": "string"}
}
}'));
$actual = (new SchemaConfigurationFactory())->create(
'/path/to/config',
$rawConfig
);
}
function provideRawConfig(): iterable
{
yield '[timeout] nominal' => [
<<<'JSON'
{
"timeout": 100,
"source": {
"directories": ["src"]
}
}
JSON
,
];
yield '[logs][text] nominal' => [
<<<'JSON'
{
"source": {
"directories": ["src"]
},
"logs": {
"text": "text.log"
}
}
JSON
,
];
yield '[logs][html] nominal' => [
<<<'JSON'
{
"source": {
"directories": ["src"]
},
"logs": {
"html": "report.html"
}
}
JSON
,
];
}
for ($x = 0; $x < 10000; $x++) {
foreach (provideRawConfig() as [$a]) {
test_it_can_create_a_config($a);
}
} The same assertion also occurs when running phpunit. Same config as usual:
|
I still can't reproduce this |
Indeed, can't reproduce anymore with https://github.com/danog/jit_bugs, quite strange, closing this then. |
Description
Description
Running the infection phpunit testsuite, commit 2789fdd689689b0c85f2c0ae9db50c8d2b39fb92 throws an assertion:
php.ini:
Command:
Result:
patch.php from https://github.com/php/php-src/pull/12425/files:
Ping @dstogov
PHP Version
3a41dc8
Operating System
No response
The text was updated successfully, but these errors were encountered: