-
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
Wrong offset key is reported in E_WARNING message with function JIT #12672
Comments
I guess the bug is related to code generated by Could you please run You may also try to trace it in debugger (I'm not sure if GDBJIT interface works on Mac).
|
Somehow the third argument to |
Right! Thanks for your analysis.
Unfortunately, there is no GDB available on AArch64 Mac. I tried with LLDB but it can not break at
The problem is at passing arguments to I see my colleague has fixed the same issue (#7023) in the old JIT before. But this becomes harder to fix as the IR level is introduced. Perhaps we need to add some new IRs for |
@pfustc thanks for for the analyses and the references to the doc and the old patch. I suspected something like this. It would be great, if you could try to build https://github.com/dstogov/ir on Mac/AArch64, run make test and post the list of the failed tests. |
I just tried building and running the tests on both Linux/AArch64 and MacOS/AArch64 with a few All tests pass on Linux/AArch64. There are 20 failures on MacOS/AArch64. (see below)
Some of the failed tests have function calls (calling convention related). Some seem to be caused by the difference between GCC and LLVM. And there may be other bugs. I just created a PR (#12740) of adding code-generation for IR_TRAP on AArch64. This may help debugging the JIT-ed code on MacOS/AArch64 where GDB is not available. Could you help integrate that? BTW: I'm seeing a typo in above test name (compariosn vs. comparison) |
I have run above 20 failed IR testes on MacOS/AArch64 again one by one and looked into the
The assertion failure is caused by static int ir_add_veneer(dasm_State *Dst, void *buffer, uint32_t ins, int *b, uint32_t *cp, ptrdiff_t offset)
{
ir_ctx *ctx = ir_current_ctx;
const void *addr, *veneer = NULL;
ptrdiff_t na;
int n, m;
IR_ASSERT(ctx && ctx->code_buffer); |
Thanks for checking this. |
This should be fixed in PHP JIT via fc1b467 |
Description
Hi @dstogov, below bug is found with CALL VM, function JIT and release build on my Mac (M1, AArch64). So far, I haven't reproduced it on Linux AArch64.
The following code:
with php.ini:
Resulted in this output:
But I expected this output instead:
Wrong offset key is reported in the warning message when using function JIT. Tracing JIT is OK based on my test.
PHP Version
master @ 2ca142e
Operating System
MacOS 14.1.1
The text was updated successfully, but these errors were encountered: