Skip to content
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

Segmentation Fault with dynarec and UT2004 #145

Closed
Mashintime opened this issue Jul 8, 2020 · 2 comments
Closed

Segmentation Fault with dynarec and UT2004 #145

Mashintime opened this issue Jul 8, 2020 · 2 comments

Comments

@Mashintime
Copy link
Contributor

Mashintime commented Jul 8, 2020

Trying to get box86 running on a Raspberry Pi 4, updated 32 bit raspbian, no mods other than Kernel 5.4.50

I can run UT2004 with the tagged 0.1.0 version w/dynarec without issue.

Using the latest version I get a seg fault with dynarec, but works fine with dynarec disabled. I tried debugging it but it's beyond my capabilities (not familiar enough with c++ and/or gdb). If I can provide more info please let me know, and thanks for this great emulator.

Some gdb output is below:

`Start x86emu on Main
Run X86 (0x375868), EIP=0x804a970, Stack=0xb3f28008
... =>PltResolver: Addr=0x376870, Slot=704 Return=0x804a991: elf is ./ucc-bin
PltReolver: Apply Global R_386_JMP_SLOT @0x8e01730 with sym=__libc_start_main (0x804a53e -> 0x3d68c0 / (noelf))
return 0x00000003
30059|0x804a991: Calling __libc_start_main (0804ADA0, 00000003, B4727684...) =>Calling init(0x8049f78) from __libc_start_main
... =>PltResolver: Addr=0x376870, Slot=1208 Return=0x8049f96: elf is ./ucc-bin
PltReolver: Apply Global R_386_JMP_SLOT @0x8e0182c with sym=gmon_start (0x804a92e -> 0x38f578 / (noelf))
return 0x00000003
30059|0x8049f96: Calling gmon_start (00373AC0, 00000000, 0036DD60...) =>gmon_start called (dummy call)
return 0x00000003

Program received signal SIGSEGV, Segmentation fault.
dynarec000 (dyn=dyn@entry=0xbeffeed0, addr=134523480, addr@entry=134523475, ip=ip@entry=134523475, ninst=ninst@entry=22, ok=0xbeffee88, need_epilog=0xbeffee8c)
at /home/pi/box86/src/dynarec/dynarec_arm_00.c:2023
2023 } else if ((PK(i32+0)==0x8B) && (((PK(i32+1))&0xC7)==0x04) && (PK(i32+2)==0x24) && (PK(i32+3)==0xC3)) {

(gdb) print i32
$1 = -134523480

(gdb) bt
#0 dynarec000 (dyn=dyn@entry=0xbeffeed0, addr=134523480, addr@entry=134523475, ip=ip@entry=134523475, ninst=ninst@entry=22, ok=0xbeffee88, need_epilog=0xbeffee8c)
at /home/pi/box86/src/dynarec/dynarec_arm_00.c:2023
#1 0x00105c3c in arm_pass0 (dyn=0xbeffeed0, dyn@entry=0xbeffeec8, addr=134523475, addr@entry=134523392) at /home/pi/box86/src/dynarec/dynarec_arm_pass.c:64
#2 0x001055e0 in FillBlock (block=block@entry=0x3f98d8) at /home/pi/box86/src/dynarec/dynarec_arm.c:170
#3 0x001047dc in internalDBGetBlock (addr=addr@entry=134523392, create=create@entry=1, current=, emu=) at /home/pi/box86/src/dynarec/dynablock.c:462
#4 0x0010496c in DBGetBlock (emu=0x375868, addr=addr@entry=134523392, create=create@entry=1, current=0xbefff0c4, current@entry=0xbefff0bc) at /home/pi/box86/src/dynarec/dynablock.c:473
#5 0x0009c910 in UpdateLinkTable (emu=, table=0x3f76e8, addr=134523392) at /home/pi/box86/src/dynarec/dynarec.c:57
#6 0x00105b20 in arm_linker () at /home/pi/box86/src/dynarec/arm_linker.S:20`

ptitSeb added a commit that referenced this issue Jul 8, 2020
@ptitSeb
Copy link
Owner

ptitSeb commented Jul 8, 2020

Ok, I have pushed something based on the backtrace. Can you check if it helps?

@Mashintime
Copy link
Contributor Author

That seems to have fixed it, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants