ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.31k stars 227 forks source link

Some games not running anymore with master branch #815

Open ectorhga opened 1 year ago

ectorhga commented 1 year ago

Hi, I'm using Box86 for wine gaming on a Raspberry Pi 4 (32bit buster). I usually compile Box86 from the master branch to see if there are new games running. I'm using wine 7.0 if that makes a difference. Lately (Idk, maybe around the time of v0.3.0), there are some games that don't work anymore. As I have around 100 wine games, I only noticed that by chance.

I noticed that there are usually three instances of page faults coming from wine at different times at startup, but I don't know if that's related to the problem. I can paste the errors later, but I'm at work atm.

Running the games with Box86 v0.2.8 is fine. No errors and no other problems. I can try to help finding the cause of this, but I usually only have some time in the evenings, so it might take some time. ;)

ptitSeb commented 1 year ago

Mmm, not some games I think I have. But I'll have to double check.

If you can do a git bisect that would be really helpfull! (unfortunatly, I'm pretty sure each games encounter a different issue and might need 3 bisect...)

ectorhga commented 1 year ago

Sure I can do this! But could you point me at how to do this?

Anyway, These pagefaults are (almost?) always popping up in the wine startup process before the games are loaded (I checked that with WINEDEBUG=+loaddll. There is also the notice of of some winedbg. Sorry to be so vague, but I'll post the actual errors later...

ptitSeb commented 1 year ago

Yeah, that means it's a segfault

I have made lot's of structural changes in box64 that I will backport to box86 soon'ish... I need to finish box64 changes and then will backport all that to box86. Lots of stuff, that will hopefully improve overall compatibility and stability of box86. That's why there have been very little changes to box86 lately, as I was focussing on box64, but I will go back to box86 soon.

ectorhga commented 1 year ago

Just to be sure: I read about git bisect and it seems easy enough. Should I do that, or should I wait until after you started with the backporting? It seems to me, that there will be a lot of changes in the foreseeable future, and I can always fall back to 0.2.8 for the time being.

ptitSeb commented 1 year ago

well, tbh, it would depend on what is the issue and it can wait of course.

ectorhga commented 1 year ago

So, first I'll drop the log file here. Maybe I'll start a bisect tonight, but I can't promise. ;)

Box86-master-wine7.0-WheelOfTime

Pipetto-crypto commented 1 year ago

I don't know if it's related to this problem but I also found a regression in a game that used to work. This happened after commit #54e13be.

Reproducing the issue is quite simple for me on my Android device proot environment at least:

Download the Witch's House, install rpgvx_rtp, boot the game. After that commit, the games crashes after a bunch of warning, access segment null. Don't know if it's helpful but I will leave a dump, just in case:

https://pastebin.com/fmyBtWbC

ptitSeb commented 1 year ago

Mmm, yeah, I suspected that commit to be the cause of some recent regression. I need a program to test on my side.

I'll check with downloading witch's house and install rpgvx_rtp on my side, see if I can reproduce the issue.

ectorhga commented 1 year ago

I did the git bisect and here is the result:

a4752afacfc51d6005a6fc0cf313fd5cbd2f99c2 is the first bad commit
commit a4752afacfc51d6005a6fc0cf313fd5cbd2f99c2
Author: ptitSeb <sebastien.chev@gmail.com>
Date:   Tue Mar 7 22:02:59 2023 +0100

    [DYNAREC] Added BOX86_DYNAREC_FORWARD parameter, with a default value to 128                                                                            (unfortunatly, it doesn't seems to help performances much on box86)

:040000 040000 2788e11a80274351cd3c12148c00bd1f3b608ac3 c5b1241e01f69a1109b3f76e8171bbdeb61ea933 M      docs
:040000 040000 b2c8a893a64f71eafbec2ce6b011e8449df14457 7b869e93d4e4a778d604cff46460b8a8810b7ac2 M      src
:040000 040000 ec0b68c46e78cff2caebbdfd2b10cebae35bd690 183e160ceae28fe82a647d64e9202c89feb3aaf0 M      system

I hope this helps. At least I had fun doing that! Before the bad commit I'm able to calibrate the joystick in Privateer 2 and the videos of Wheel of Time are playing!

ptitSeb commented 1 year ago

Oh, so you can use BOX64_DYNAREC_FORWARD=0 to get previous behaviour. It helps, but it's not an easy fix, and no easy way for me to debug.

ectorhga commented 1 year ago

I tried both BOX86_DYNAREC_FORWARD=0 and BOX64_DYNAREC_FORWARD=0 but neither helped... 😞

ptitSeb commented 1 year ago

Ah yes the box86 one. And it didn't help? Hmmm, that's strange. I need to revisit this commit then.

ptitSeb commented 1 year ago

Witch's House should be fixed now with latest box86, can you try again?

Pipetto-crypto commented 1 year ago

Can confirm Witch's House is fixed with the latest commit

ectorhga commented 1 year ago

I also tried the problematic games again, and now it seems to work (not always? I'm not yet sure).

But I have to set BOX86_DYNAREC_FORWARD=0. Then the debug messages of wine also disappear.

Is there a way to set this variable globally in the .box86rc file? It seems to me that this is meant only for specific processes?

mntmn commented 1 year ago

Not sure if it is the same issue, but just to add another data point. I'm trying to play Fallout New Vegas on MNT Reform with Amlogic A311D processor. It is playable (on a 64-bit multiarch Debian) with Box86 0.2.9 2b247838 and wine:i386 7.0.1, but it crashes with illegal memory accesses to 0xFFFFFFFF or 0x00000000 on current weekly Box86 0.3.1+20230727 from itai-nelken.github.io. With BOX86_DYNAREC_FORWARD=0 it just hangs on startup.

Edit: forgot to mention that I am also using gallium nine.