-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
IR JIT: too long jmp distance in ir_add_veneer, ir_aarch64.dasc:6495. #17858
Comments
Ping @dstogov |
Thanks for the report. |
@danog could you please check the patch. diff --git a/ext/opcache/jit/ir/ir_aarch64.dasc b/ext/opcache/jit/ir/ir_aarch64.dasc
index 772eea7a5d7..67bb0cdaea1 100644
--- a/ext/opcache/jit/ir/ir_aarch64.dasc
+++ b/ext/opcache/jit/ir/ir_aarch64.dasc
@@ -6441,6 +6441,8 @@ static int ir_add_veneer(dasm_State *Dst, void *buffer, uint32_t ins, int *b, ui
if (ctx->get_veneer) {
veneer = ctx->get_veneer(ctx, addr);
}
+ } else if ((ins >> 16) == DASM_REL_PC) {
+ addr = (char*)cp - 4 + offset;
} else {
IR_ASSERT(0 && "too long jmp distance");
return 0;
@@ -6525,7 +6527,9 @@ static int ir_add_veneer(dasm_State *Dst, void *buffer, uint32_t ins, int *b, ui
return 0;
}
- if (!ctx->set_veneer || !ctx->set_veneer(ctx, addr, veneer)) {
+ if ((ins >> 16) == DASM_REL_PC) {
+ *DASM_POS2PTR(Dst, *(b - 1)) = (int)((char*)addr - (char*)buffer);
+ } else if (!ctx->set_veneer || !ctx->set_veneer(ctx, addr, veneer)) {
IR_ASSERT(0 && "too long jmp distance");
return 0;
}
''' |
@dstogov your patch doesn't fix the issue when applied on PHP-8.4:
|
It seems you have a different problem, that I can't reproduce (I don't have Mac). |
https://github.com/sickcodes/Docker-OSX might help |
@danog FWIW I tried that in the past and couldn't get it working. |
Description
Running
./psalm --no-cache
in https://github.com/vimeo/psalm/tree/preload_all_classes_tmp on aarch64 (mac OS 15.3.1, not reproducible on linux aarch64 on a KVM in the same machine) triggers the following assertion:On 3b23de3, the following assertion is triggered instead:
The issue is triggered by the large number of class_exists statements in
src/Psalm/Internal/Preloader.php
, reducing the number to < ~1020 fixes the issue.PHP Version
PHP 8.4.4 or 3b23de3
Operating System
Mac OS 15.3.1
The text was updated successfully, but these errors were encountered: