Closed Kelvfimer closed 2 years ago
As the one that I told in Fighting Vipers https://github.com/devmiyax/yabause/issues/795 I think there is a deadlock because of the futex in this case in Coton2 could be because of thread 69 or 71
THREAD 69 (gdb) thread 69 [Switching to thread 69 (Thread 0x7f8d7de130 (LWP 5710))]
at ../sysdeps/nptl/futex-internal.h:183
183 ../sysdeps/nptl/futex-internal.h: No such file or directory. (gdb) bt
at ../sysdeps/nptl/futex-internal.h:183
cond=0x381cf8c8) at pthread_cond_wait.c:508
mutex=mutex@entry=0x381cf898) at pthread_cond_wait.c:638
evcode=evcode@entry=0)
at /home/kelv/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/build/yabasanshiroSA-f6f41dd6485c638ab661f3acd2951c9522f34450/yabause/src/thr-linux.cpp:208
at /home/kelv/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/build/yabasanshiroSA-f6f41dd6485c638ab661f3acd2951c9522f34450/yabause/src/vdp2.cpp:1311
at /home/kelv/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/build/yabasanshiroSA-f6f41dd6485c638ab661f3acd2951c9522f34450/yabause/src/vdp2.cpp:524
at /home/kelv/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/build/yabasanshiroSA-f6f41dd6485c638ab661f3acd2951c9522f34450/yabause/src/vdp2.cpp:500
at pthread_create.c:463
at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
THREAD 71 (gdb) thread 71 [Switching to thread 71 (Thread 0x7f8cfdd130 (LWP 5712))]
at lowlevellock.c:52
52 lowlevellock.c: No such file or directory. (gdb) bt
at lowlevellock.c:52
at pthread_mutex_lock.c:80
at /home/kelv/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/build/yabasanshiroSA-f6f41dd6485c638ab661f3acd2951c9522f34450/yabause/src/vidogl.c:3536
at pthread_create.c:463
at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
(gdb)
As spoken in Fighter vipers one https://github.com/devmiyax/yabause/issues/795
Reading further it seems that the lock is done in thread 71 on /yabause/src/vidogl.c:3536 YabThreadLock(g_rotate_mtx);
use thread [New Thread 0x7f7fd9b130 (LWP 6369)] [Thread 0x7f7fd9b130 (LWP 6369) exited] [New Thread 0x7f7fd9b130 (LWP 6370)] Vdp2DrawRotationThread ^C Thread 1 "yabasanshiro" received signal SIGINT, Interrupt. futex_wait_cancelable (private=0, expected=0, futex_word=0xc0c4894) at ../sysdeps/nptl/futex-internal.h:183 183 ../sysdeps/nptl/futex-internal.h: No such file or directory. (gdb) info threads Id Target Id Frame
(gdb) thread 71 [Switching to thread 71 (Thread 0x7f7fd9b130 (LWP 6370))]
52 lowlevellock.c: No such file or directory. (gdb) bt
at /home/kelv/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/build/yabasanshiroSA-f6f41dd6485c638ab661f3acd2951c9522f34450/yabause/src/vidogl.c:3536
(gdb) x /3d 0x7f78163a50 0x7f78163a50: 2 0 6368 (gdb)
Hello
New news, if compiled as relwithdebinfo the game starts and I can get into the first stage but it gets hung again because of the FUTEX issue :(
I hope it helps
thx
Solved in the latest pi 1.9.0 banch. thx @devmiyax for your work!!!
Hello
When executing Cotton 2 on Yabasanshiro stand alone for Emuelec on Odroid n2+ seems to be locked in a FUTEX and the emulator gets hung.
it seems to be a problem with Vdp2VBlankIN() (yabause/src/yabause.c:791) when waiting for an event on YabWaitEventQueue (yabause/src/vdp2.cpp:836). I set a breakpoint and I see that is called a lot of times until the moment it gets hung waiting in the futex at line value = queue->buffer[queue->out] (yabause/src/thr-linux.cpp:235) on and the emulator gets unresponsive and the music keeps playing.
Please, can you help on find the root cause of the issue and potential fix?
thx so much
GDB Call Stack and Info Threads
(gdb) bt
0 futex_wait_cancelable (private=0, expected=0, futex_word=0x2f4ccaf4)
1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x2f4cca68,
2 __pthread_cond_wait (cond=cond@entry=0x2f4ccac8,
3 0x000000000067b8c8 in YabWaitEventQueue (queue_t=0x2f4cca50)
4 0x000000000060243c in YabauseEmulate ()
5 0x0000000000601f00 in YabauseExec ()
6 0x000000000053fde8 in main (argc=, argv=)
(gdb) info threads Id Target Id Frame