-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix Nightly workflow Symfony assertion (ir_ra.c:326: ir_fix_live_range: Assertion `ival && p->start == old_start' failed) #19458
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
Conversation
…e: Assertion `ival && p->start == old_start' failed)
Is there a minimal reproduction from Symfony? If not, I can try to identify one |
I didn't try to separate the test case.
If you can provide a small test case, it would be great. |
Here is the smallest I could make (I spent way too much time on this) <?php
class CacheItem {
public string $key;
protected mixed $value = null;
public function get(): mixed {
return $this->value;
}
public function set($value): void {
$this->value = $value;
}
}
class FilesystemTagAwareAdapter {
public function __construct() {
$directory = sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'symfony-cache';
$directory .= \DIRECTORY_SEPARATOR . '@';
if (!is_dir($directory)) {
@mkdir($directory, 0777, true);
}
$directory .= \DIRECTORY_SEPARATOR;
$this->directory = $directory;
$this->tmpSuffix = str_replace('/', '-', base64_encode(random_bytes(6)));
}
private string $directory;
private string $tmpSuffix;
private function getFile(string $id): string {
return $this->directory . str_replace('/', '-', base64_encode(hash('xxh128', $id, true)));
}
public function __destruct() {
if (is_file($this->directory . $this->tmpSuffix)) {
unlink($this->directory . $this->tmpSuffix);
}
}
public function getItem(string $key): CacheItem {
$createCacheItem = \Closure::bind(
static function ($key, $value) {
$item = new CacheItem();
$item->key = $key;
if (\is_array($value) && \array_key_exists('value', $value)) {
$item->value = $value['value'];
}
return $item;
},
null,
CacheItem::class
);
$file = $this->getFile($key);
if (!is_file($file) || !$h = @fopen($file, 'r')) {
return ($createCacheItem)($key, null);
}
fgets($h);
$i = rawurldecode(rtrim(fgets($h)));
$value = stream_get_contents($h);
fclose($h);
if ($i === $key) {
return ($createCacheItem)($key, unserialize($value));
}
return ($createCacheItem)($key, null);
}
public function save(CacheItem $item) {
foreach ([$item] as $item) {
$tmp = $this->directory . $this->tmpSuffix;
$h = fopen($tmp, 'x');
fwrite($h, (0)."\n".rawurlencode($item->key)."\n".serialize(['value' => $item->get()]));
fclose($h);
rename($tmp, $this->getFile($item->key));
}
}
}
$cache = new FilesystemTagAwareAdapter();
$item = $cache->getItem('key');
$item->set('5');
$cache->save($item);
$item = $cache->getItem('key');
$item->get();
$cache = new FilesystemTagAwareAdapter();
$item = $cache->getItem('key');
$item->set(5);
$cache->save($item);
$item = $cache->getItem('key');
$item->get(); triggered with But I was running this with master rather than 8.4 |
* PHP-8.4: Fix Nightly workflow Symfony assertion (ir_ra.c:326: ir_fix_live_range: Assertion `ival && p->start == old_start' failed) (#19458)
@DanielEScherzer thaks! The test case definitely reproduces the problem (if I revert the fix). |
* PHP-8.4: Added test for PR #19458
The problem occurred because the usage of SSA variable wasn't dominated by its definition.
PHP-JIT decided to use register for variable
#5
, but loaded the value to register (d_66
) too late.Fix just moves the load at start of jit code for ASSIGN_OBJ.
It seems like SPILL_STORE code is useless, because we perform STORE into the same location as previous LOAD.