ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.7k stars 263 forks source link

Game on Lua Segmentation fault #891

Open xboxones1 opened 1 year ago

xboxones1 commented 1 year ago

Launch on RPI4

Dynarec for ARM64, with extension: ASIMD CRC32 PageSize:4096 Running on Unknown CPU with 4 Cores
Params database has 24 entries
Using bash "/usr/lib/x86_64-linux-gnu/bash"
Box64 with Dynarec v0.2.3 27d8911d built on Jul 18 2023 15:10:24
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 53 Env var
Looking for ./AppRun
Rename process to "AppRun"
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) librt.so.1
Dynarec for ARM64, with extension: ASIMD CRC32 PageSize:4096 Running on Unknown CPU with 4 Cores
Params database has 24 entries
Using bash "/usr/lib/x86_64-linux-gnu/bash"
Box64 with Dynarec v0.2.3 27d8911d built on Jul 18 2023 15:10:24
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 64 Env var
Looking for /home/books/game/bin/GravityCircuit
Rename process to "GravityCircuit"
Using emulated /home/books/game/bin/../lib/liblove-11.4.so
Using emulated /home/books/game/bin/../lib/libluajit-5.1.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) librt.so.1
Using native(wrapped) libSDL2-2.0.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libm.so.6
Using native(wrapped) libfreetype.so.6
Using native(wrapped) libopenal.so.1
Using native(wrapped) libz.so.1
Using emulated /home/books/game/lib/../lib/libmodplug.so.1
Using native(wrapped) libvorbisfile.so.3
Using emulated /home/books/game/lib/../lib/libtheoradec.so.1
Using native(wrapped) libogg.so.0
Using native(wrapped) libmpg123.so.0
Using emulated /lib/x86_64-linux-gnu/libstdc++.so.6
Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1
[BUILD] Not forcing demo mode.
[Load Thread] Failure:  userconfig/playerSettings.lua
Using native(wrapped) libGL.so.1
Segmentation fault
ptitSeb commented 1 year ago

I don't have the game, so I will not be able to debug it myself.

you can try to get more meaningfull logs by creating (or updating) ~/.box64rc and add in the text file:

[GravityCircuit]
BOX64_LOG=1
BOX64_ROLLING_LOG=1
BOX64_SHOWSEGV=1
BOX64_SHOWBT=1
BOX64_DLSYM_ERROR=1
ptitSeb commented 1 year ago

I see nothing wrong with log. There is just an untrapped segfault at the end. Maybe it's an infinite recursive error. I don't see how to debug that further. If you are confortable with gdb, you can try to run that with gdb, and see th backtrace at the end. You can also try to run with BOX64_DYNAREC=0 to be sure it's not a dynarec issue.

ptitSeb commented 1 year ago

I don't think this is the correct segfault. Add BOX64_DYNAREC=0 in the [GravityCircuit] section of ~/.box64rc to disable dynarec (and all the segfault it generate on purpose) to get the real one.

ptitSeb commented 1 year ago

Thanks. But I don't see what's going wrong with this game with those logs. I'll try some other lua-jit based game, or maybe I'll get a copy of this game to test myself.

xboxones1 commented 1 year ago

There are free and demo games on this engine (love2d). For example, this one, you can immediately download the appimage for Linux

ptitSeb commented 1 year ago

But this game works right (thermomorph)? I tried on my side and it just booted and wored fine with box64.

xboxones1 commented 1 year ago

I haven't been able to test this particular game. I hoped that she would have such mistakes

ptitSeb commented 1 year ago

Is the issue still present with latest box64?

xboxones1 commented 1 year ago

Yes the problem persists

ptitSeb commented 1 year ago

Can you try with software rendering, to rule out mesa driver issue? use LIBGL_ALWAYS_SOFTWARE=1 for that.

xboxones1 commented 1 year ago

unsupported LIBGL_ALWAYS_SOFTWARE=1 Launch log log.txt I'm sure the problem is not with the drivers. Many other games work without problems

ptitSeb commented 1 year ago

It's not a parameter for box64. It's a mesa env. var. (mesa is the graphic driver). Use it like this:

LIBGL_ALWAYS_SOFTWARE=1 ./GravityCircuit
xboxones1 commented 1 year ago

Segmentation fault

ptitSeb commented 1 year ago

To to add

BOX64_RESERVE_HIGH=1

in the ~/.box64rc section for GravityCircuit (you can remove the other stuffs). Else, you'll have to try run it uder gdb, because the Segmentation fault seems to a stack overflow. so running something like

BOX64_DYNAREC=0 gdb --args box64 ./GravityCircuit

and then type r to run. It should segfault there, inside gdb. Type bt and copy me the whole stuff. you can then use q to build gdb.

xboxones1 commented 1 year ago

Writes that it is not supported BOX64_RESERVE_HIGH=1 We already tried with gdb, but then you wrote that there was nothing there. But here's the log gdb_log.txt