-
Notifications
You must be signed in to change notification settings - Fork 123
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
Retroarch stops working when I try to run Chou Jikuu Yousai Macross - Ai Oboete Imasu ka from PS1 using PCSX from retroarch #868
Comments
@pcercuei another one for you, SLPS02005. This one is harder as it only crashes on Windows, in generated code it seems. |
I don't have a Windows PC to try with. But could you try adding this commit? pcercuei/lightrec@9572b6e |
Doesn't help, sadly. You can use wine-staging for testing, RetroArch first complains about dx11 but on retry it falls back to gl automatically and works. Also you need several tries to reproduce the crash as sometimes it seems the game just works under wine. |
@pcercuei Will it take long to fix this problem? |
It will take long to debug it. Having a savestate that reliably triggers the bug would help. |
Thank You @pcercuei |
From some more testing under wine it works if I run retroarch through the command line ( |
You commented out a bunch of MAP_FIXED_NOREPLACE in libpcsxcore/lightrec/mem.c, are you sure that's safe? Could you restore the fprintf() in lightrec_plugin_init()? |
For this case it doesn't matter since windows has fprintf under wine, crashing case:
working case:
I guess when loading through the menu RetroArch allocs more stuff and things move around in heap. |
Could you try: pcercuei@35df0bc |
Same crash with the usual
|
Does running it with the interpreter work fine? |
Yes. Maybe you could look for the repeating pattern after the crash to find the affected block (wine's disassembler's output below):
So r10 is within PSX RAM, but r11 is calculated from r15 which is some unknown heap stuff which unhappily ends up after some reserved area:
|
The 0x22 shift is what looks strange, could you print the "mask" variable as hex in rec_and_mask() in deps/lightrec/emitter.c? |
Ok, I think I see what's going on. It's related to the Could you try this patch? diff --git a/deps/lightning/lib/jit_x86-cpu.c b/deps/lightning/lib/jit_x86-cpu.c
index 6957adf36f9..09b6515c93f 100644
--- a/deps/lightning/lib/jit_x86-cpu.c
+++ b/deps/lightning/lib/jit_x86-cpu.c
@@ -870,10 +870,17 @@ static void _patch_at(jit_state_t*, jit_word_t, jit_word_t);
# define ffsl(l) __builtin_ffsl(l)
# endif
# endif
+# if __WORDSIZE == 64
+# define __popcnt(x) __builtin_popcountll(x)
+# define __ctz(x) __builtin_ctzll(x)
+# else
+# define __popcnt(x) __builtin_popcount(x)
+# define __ctz(x) __builtin_ctz(x)
+# endif
# define jit_cmov_p() jit_cpu.cmov
-# define is_low_mask(im) (((im) & 1) ? (__builtin_popcountl((im) + 1) <= 1) : 0)
-# define is_high_mask(im) ((im) ? (__builtin_popcountl((im) + (1 << __builtin_ctzl(im))) == 0) : 0)
-# define unmasked_bits_count(im) (__WORDSIZE - __builtin_popcountl(im))
+# define is_low_mask(im) (((im) & 1) ? (__popcnt((im) + 1) <= 1) : 0)
+# define is_high_mask(im) ((im) ? (__popcnt((im) + (1 << __ctz(im))) == 0) : 0)
+# define unmasked_bits_count(im) (__WORDSIZE - __popcnt(im))
#endif
#if CODE |
This works. Should also apply to Doesn't matter in practice, but supposedly leading 1 or 2 underscores in names are reserved for the compiler and system libraries according to some standard. Just a note. |
PCSX-ReARMed Version
r24I c5d1f1d
Your device
PC
Operating System of your device
Windows
CPU architecture
x86-64 (64bit Intel, AMD, etc.)
Issue description
When I go to play Chou Jikuu Yousai Macross - Ai Oboete Imasu ka from PS1 using retroarch pcsx, retroarch stops working
Step-by-step reproduction and logs
This happens after I run the game, the game screen appears for a few seconds, then retroarch stops working, could you fix this problem please?
The text was updated successfully, but these errors were encountered: