ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices

Home Page:https://box86.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`BOX64_DYNAREC_TEST` on RISC-V is Failing

Coekjan opened this issue · comments

Description

I used BOX64_DYNAREC_TEST to test box64. And I saw that box64 must have some issues about this flag on RISC-V (it is good on ARM though). Many crashes I met, seems that RISC-V BOX64_DYNAREC_TEST cannot correctly handle the programs with PLT Callings. A hello-world program can reproduce the issue.

$ cat hello.c
#include <stdio.h>

int main() {
    puts("Hello World");
    return 0;
}
$ x86_64-linux-gnu-gcc hello.c -o hello
$ BOX64_DYNAREC_TEST=1 box64 ./hello  # here `box64` is running on risc-v.
(( !crash! ))

Due to this issue, I cannot move my work forward nearly at all. Hope we can solve this issue as soon as possible...

Maybe this is a regression. I haven't used BOX64_DYNAREC_TEST for a while now. Busy with other things for now, I can check this later if no one fixes it by then.

So I found the issue, submitted a PR above.

By the way, currently for RISC-V we don't run tests with cosim in CI, otherwise, this should be caught... The reason for that is some features of x87 are incomplete on RISC-V so cosim complains. And I totally forgot about this... Anyway will do it maybe tomorrow.

Thanks very very much!! You really save my life.

lol, happy to hear that. Out of curiosity, you're doing some research projects related to box64?

Out of curiosity, you're doing some research projects related to box64?

Yes. Something about dynamic binary translation.

Honestly, I have investigated this issue for 2 days. I saw something wrong about test pc, but could not find out how to solve it. Thanks again, you save my life!!