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

Invalid pointer due to race condition between mutex/thread/sema during exit #1455

Open
Enverex opened this issue Jul 10, 2016 · 17 comments

Comments

@Enverex
Copy link

Enverex commented Jul 10, 2016

With MESA 11.2, PCSX2 would open, but would crash upon loading any ISO files with the error "Assertion failed: Unhandled page fault @ 0x0000000".

Updating to MESA 12.1 fixed that crash on start and games work great, but upon trying to exit PCSX2, I get the same error I used to get when trying to start a game (which seems odd).

I've compiled PCSX2 with debugging but not MESA yet (trying to avoid that as it's messy). Here's the output from PCSX2 itself and then the backtrace. Let me know if it's still not sufficient and I'll rebuild MESA with debugging enabled.

PCSX2:

/home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Linux/LnxHostSys.cpp(70) : assertion failed:
   Function:  void SysPageFaultSignalFilter(int, siginfo_t*, void*)
   Thread:    Unknown
   Condition: false
   Message:   Unhandled page fault @ 0x00000000

Stacktrace:
[00] SysPageFaultSignalFilter(int, siginfo_t*, void*) /build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Linux/LnxHostSys.cpp:70
[01] __kernel_rt_sigreturn                       
[02] 0x0xf6050cc0                                
[03] 0x0xf6048d58                                
[04] Threading::pxThread::_try_virtual_invoke(void (Threading::pxThread::*)()) /build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:583
[05] Threading::pxThread::_ThreadCleanup()        /build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:598
[06] Threading::pxThread::_pt_callback_cleanup(void*) /build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:169
[07] 0x0xf6045301                                
[08] clone

GDB:

GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) attach 2799
Attaching to process 2799
[New LWP 2800]
[New LWP 2801]
[New LWP 2802]
[New LWP 2805]
[New LWP 2807]
[New LWP 2808]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
0xf76dcd49 in __kernel_vsyscall ()
(gdb) thread apply all bt

Thread 7 (Thread 0xedfd2b40 (LWP 2808)):
#0  0xf76dcd49 in __kernel_vsyscall ()
#1  0xf5f5f1a6 in do_futex_wait.constprop () from /usr/lib32/libpthread.so.0
#2  0xf5f5f297 in __new_sem_wait_slow.constprop.1 () from /usr/lib32/libpthread.so.0
#3  0x083b3691 in Threading::Semaphore::Wait (this=0xedfd1894) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Semaphore.cpp:87
#4  0x083b36d9 in Threading::Semaphore::WaitNoCancel (this=0xedfd1894) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Semaphore.cpp:157
#5  0x083a6831 in SynchronousActionState::WaitForResult (this=0xedfd188c) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/wxAppWithHelpers.cpp:86
#6  0x082834b0 in Msgbox::ShowModal (evt=...) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/MessageBoxes.cpp:163
#7  0x082838b1 in Msgbox::Assertion (text=..., stacktrace=...) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/MessageBoxes.cpp:196
#8  0x081b9051 in AppDoAssert (origin=..., msg=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppAssert.cpp:139
#9  0x0838853e in pxOnAssert (origin=..., msg=0xea6693d0 L"Unhandled page fault @ 0x00000000") at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Exceptions.cpp:132
#10 0x08393520 in SysPageFaultSignalFilter (signal=11, siginfo=0xedfd1b0c) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Linux/LnxHostSys.cpp:70
#11 <signal handler called>
#12 0xf5f62cc0 in __lll_unlock_elision () from /usr/lib32/libpthread.so.0
#13 0xf5f5ad58 in __pthread_mutex_unlock_usercnt () from /usr/lib32/libpthread.so.0
#14 0x083a1f53 in Threading::pxThread::_try_virtual_invoke (this=0x9ea3800 <mtgsThread>, method=&virtual Threading::pxThread::OnCleanupInThread()) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:545
#15 0x083a220b in Threading::pxThread::_ThreadCleanup (this=0x9ea3800 <mtgsThread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:597
#16 0x083a4027 in Threading::pxThread::_pt_callback_cleanup (handle=0x9ea3800 <mtgsThread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:169
#17 __pthread_cleanup_class::~__pthread_cleanup_class (this=<synthetic pointer>, __in_chrg=<optimized out>) at /usr/include/pthread.h:561
#18 Threading::pxThread::_internal_callback (itsme=0x9ea3800 <mtgsThread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:683
#19 0xf5f57301 in start_thread () from /usr/lib32/libpthread.so.0
#20 0xf5e8290e in clone () from /usr/lib32/libc.so.6

Thread 6 (Thread 0xf109ab40 (LWP 2807)):
#0  0xf76dcd49 in __kernel_vsyscall ()
#1  0xf5f5fed2 in __lll_timedlock_wait () from /usr/lib32/libpthread.so.0
#2  0xf5f62d10 in __lll_timedlock_elision () from /usr/lib32/libpthread.so.0
#3  0xf5f5a308 in pthread_mutex_timedlock () from /usr/lib32/libpthread.so.0
#4  0x08393719 in Threading::Mutex::AcquireWithoutYield (this=0x9ea3858 <mtgsThread+88>, timeout=...) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Mutex.cpp:179
#5  0x08393913 in Threading::Mutex::WaitWithoutYield (this=0x9ea3858 <mtgsThread+88>, timeout=...) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Mutex.cpp:287
#6  0x083a1c53 in Threading::pxThread::WaitOnSelf (this=0x9ea3800 <mtgsThread>, mutex=...) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:492
#7  0x083a37d6 in Threading::pxThread::Cancel (this=0x9ea3800 <mtgsThread>, isBlocking=true) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:338
#8  0x080a8b61 in SysCorePlugins::Shutdown (this=0x9ea35d0 <CorePlugins>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/PluginManager.cpp:1531
#9  0x081c5edd in AppCorePlugins::Shutdown (this=0x9ea35d0 <CorePlugins>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppCorePlugins.cpp:320
#10 0x082d2b12 in SysCoreThread::OnCleanupInThread (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/System/SysCoreThread.cpp:298
#11 0x083a1f53 in Threading::pxThread::_try_virtual_invoke (this=0x9ea3660 <CoreThread>, method=&virtual Threading::pxThread::OnCleanupInThread()) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:545
#12 0x083a220b in Threading::pxThread::_ThreadCleanup (this=0x9ea3660 <CoreThread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:597
#13 0x083a4027 in Threading::pxThread::_pt_callback_cleanup (handle=0x9ea3660 <CoreThread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:169
#14 __pthread_cleanup_class::~__pthread_cleanup_class (this=<synthetic pointer>, __in_chrg=<optimized out>) at /usr/include/pthread.h:561
#15 Threading::pxThread::_internal_callback (itsme=0x9ea3660 <CoreThread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:683
#16 0xf5f57301 in start_thread () from /usr/lib32/libpthread.so.0
#17 0xf5e8290e in clone () from /usr/lib32/libc.so.6

Thread 5 (Thread 0xf1aabb40 (LWP 2805)):
#0  0xf76dcd49 in __kernel_vsyscall ()
#1  0xf5f5f1a6 in do_futex_wait.constprop () from /usr/lib32/libpthread.so.0
#2  0xf5f5f297 in __new_sem_wait_slow.constprop.1 () from /usr/lib32/libpthread.so.0
#3  0x0809c3eb in VU_Thread::ExecuteRingBuffer (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/MTVU.cpp:98
#4  0x0809ca7c in VU_Thread::ExecuteTaskInThread (this=0x8da9070 <vu1Thread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/MTVU.cpp:91
#5  0x083a1f53 in Threading::pxThread::_try_virtual_invoke (this=0x8da9070 <vu1Thread>, method=&virtual Threading::pxThread::ExecuteTaskInThread()) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:545
#6  0x083a39e4 in Threading::pxThread::_internal_execute (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:644
#7  0x083a4005 in Threading::pxThread::_internal_callback (itsme=0x8da9070 <vu1Thread>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:684
#8  0xf5f57301 in start_thread () from /usr/lib32/libpthread.so.0
#9  0xf5e8290e in clone () from /usr/lib32/libc.so.6

Thread 4 (Thread 0xf24ffb40 (LWP 2802)):
#0  0xf76dcd49 in __kernel_vsyscall ()
#1  0xf5f601ff in read () from /usr/lib32/libpthread.so.0
#2  0x083813ec in read (__nbytes=2048, __buf=0xf24fe73c, __fd=<optimized out>) at /usr/include/bits/unistd.h:44
#3  LinuxPipeThread::ExecuteTaskInThread (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/Linux/LnxConsolePipe.cpp:110
#4  0x083a1f53 in Threading::pxThread::_try_virtual_invoke (this=0xa474ffc, method=&virtual Threading::pxThread::ExecuteTaskInThread()) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:545
#5  0x083a39e4 in Threading::pxThread::_internal_execute (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:644
#6  0x083a4005 in Threading::pxThread::_internal_callback (itsme=0xa474ffc) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:684
#7  0xf5f57301 in start_thread () from /usr/lib32/libpthread.so.0
#8  0xf5e8290e in clone () from /usr/lib32/libc.so.6

Thread 3 (Thread 0xf2effb40 (LWP 2801)):
#0  0xf76dcd49 in __kernel_vsyscall ()
#1  0xf5f601ff in read () from /usr/lib32/libpthread.so.0
#2  0x083813ec in read (__nbytes=2048, __buf=0xf2efe73c, __fd=<optimized out>) at /usr/include/bits/unistd.h:44
#3  LinuxPipeThread::ExecuteTaskInThread (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/Linux/LnxConsolePipe.cpp:110
#4  0x083a1f53 in Threading::pxThread::_try_virtual_invoke (this=0xa488c0c, method=&virtual Threading::pxThread::ExecuteTaskInThread()) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:545
#5  0x083a39e4 in Threading::pxThread::_internal_execute (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:644
#6  0x083a4005 in Threading::pxThread::_internal_callback (itsme=0xa488c0c) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:684
#7  0xf5f57301 in start_thread () from /usr/lib32/libpthread.so.0
#8  0xf5e8290e in clone () from /usr/lib32/libc.so.6

Thread 2 (Thread 0xf3884b40 (LWP 2800)):
#0  0xf76dcd49 in __kernel_vsyscall ()
#1  0xf5f5f1a6 in do_futex_wait.constprop () from /usr/lib32/libpthread.so.0
#2  0xf5f5f297 in __new_sem_wait_slow.constprop.1 () from /usr/lib32/libpthread.so.0
#3  0x0824b591 in ExecutorThread::ExecuteTaskInThread (this=0xa440858) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/ExecutorThread.cpp:542
---Type <return> to continue, or q <return> to quit---
#4  0x083a1f53 in Threading::pxThread::_try_virtual_invoke (this=0xa440858, method=&virtual Threading::pxThread::ExecuteTaskInThread()) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:545
#5  0x083a39e4 in Threading::pxThread::_internal_execute (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:644
#6  0x083a4005 in Threading::pxThread::_internal_callback (itsme=0xa440858) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:684
#7  0xf5f57301 in start_thread () from /usr/lib32/libpthread.so.0
#8  0xf5e8290e in clone () from /usr/lib32/libc.so.6

Thread 1 (Thread 0xf559c980 (LWP 2799)):
#0  0xf76dcd49 in __kernel_vsyscall ()
#1  0xf5e7890f in poll () from /usr/lib32/libc.so.6
#2  0xf6be5270 in g_poll () from /usr/lib32/libglib-2.0.so.0
#3  0xf6bd6d7c in ?? () from /usr/lib32/libglib-2.0.so.0
#4  0xf6bd7199 in g_main_loop_run () from /usr/lib32/libglib-2.0.so.0
#5  0xf62a58b5 in gtk_main () from /usr/lib32/libgtk-x11-2.0.so.0
#6  0xf6fd3095 in wxGUIEventLoop::DoRun() () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#7  0xf7492829 in wxEventLoopBase::Run() () from /usr/lib32/libwx_baseu-3.0.so.0
#8  0xf705c13f in wxDialog::ShowModal() () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#9  0x083af5cd in wxDialogWithHelpers::ShowModal (this=0xffe34690) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/wxHelpers.cpp:258
#10 0x0828278a in pxAssertionEvent::_DoDialog (this=0xea6f1740) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/MessageBoxes.cpp:143
#11 0x0828273e in BaseMessageBoxEvent::InvokeEvent (this=0xea6f1740) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/MessageBoxes.cpp:71
#12 0x083a6dce in pxActionEvent::_DoInvokeEvent (this=0xea6f1740) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/wxAppWithHelpers.cpp:446
#13 0x081e03c9 in Pcsx2App::HandleEvent (this=0xa43fe40, handler=0xa43fe40, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x83a6490 <wxAppWithHelpers::OnInvokeAction(pxActionEvent&)>, event=...)
   at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppMain.cpp:614
#14 0xf744cfbf in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib32/libwx_baseu-3.0.so.0
#15 0xf75e81f5 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#16 0xf75e86b0 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#17 0xf75e874e in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#18 0xf75e881a in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#19 0xf75e8883 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#20 0xf75e9437 in wxEvtHandler::ProcessPendingEvents() () from /usr/lib32/libwx_baseu-3.0.so.0
#21 0xf744f260 in wxAppConsoleBase::ProcessPendingEvents() () from /usr/lib32/libwx_baseu-3.0.so.0
#22 0xf6fd3352 in wxGUIEventLoop::YieldFor(long) () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#23 0xf74928ec in wxEventLoopBase::Yield(bool) () from /usr/lib32/libwx_baseu-3.0.so.0
#24 0xf7454380 in wxAppConsoleBase::Yield(bool) () from /usr/lib32/libwx_baseu-3.0.so.0
#25 0x0839fc77 in Threading::YieldToMain () at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/ThreadTools.cpp:423
#26 0x083b3655 in Threading::Semaphore::Wait (this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Semaphore.cpp:98
#27 0x083b36d9 in Threading::Semaphore::WaitNoCancel (this=0xffe34e04) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/Semaphore.cpp:157
#28 0x083a6831 in SynchronousActionState::WaitForResult (this=0xffe34dfc) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/wxAppWithHelpers.cpp:86
#29 0x0824bc71 in pxEvtQueue::Rpc_TryInvoke (this=0xa440a68, method=0x81c6c90 <_Cancel()>, traceName=0x83ecdcc L"AppCoreThread::Cancel") at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/ExecutorThread.cpp:368
#30 0x081c6e4a in ExecutorThread::Rpc_TryInvoke (traceName=0x83ecdcc L"AppCoreThread::Cancel", evt=0x81c6c90 <_Cancel()>, this=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/pxEventThread.h:297
#31 AppCoreThread::Cancel (this=0x9ea3660 <CoreThread>, isBlocking=true) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppCoreThread.cpp:105
#32 0x081dab61 in Pcsx2App::PrepForExit (this=0xa43fe40) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppInit.cpp:585
#33 0x083a6dce in pxActionEvent::_DoInvokeEvent (this=0xa5a56e8) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/wxAppWithHelpers.cpp:446
#34 0x081e03c9 in Pcsx2App::HandleEvent (this=0xa43fe40, handler=0xa43fe40, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x83a6490 <wxAppWithHelpers::OnInvokeAction(pxActionEvent&)>, event=...)
   at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppMain.cpp:614
#35 0xf744cfbf in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib32/libwx_baseu-3.0.so.0
#36 0xf75e81f5 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#37 0xf75e86b0 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#38 0xf75e874e in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#39 0xf75e881a in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#40 0xf75e8883 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#41 0x083abcd5 in wxAppWithHelpers::IdleEventDispatcher (this=<optimized out>, action=<optimized out>) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/common/src/Utilities/wxAppWithHelpers.cpp:532
#42 0x081e03c9 in Pcsx2App::HandleEvent (this=0xa43fe40, handler=0xa43fe40, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x83ac440 <wxAppWithHelpers::OnIdleEvent(wxIdleEvent&)>, event=...)
   at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppMain.cpp:614
#43 0xf744cfbf in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib32/libwx_baseu-3.0.so.0
#44 0xf75e81f5 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#45 0xf75e86b0 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#46 0xf75e874e in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#47 0xf75e881a in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#48 0xf75e8883 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib32/libwx_baseu-3.0.so.0
#49 0xf744d3c1 in wxAppConsoleBase::ProcessIdle() () from /usr/lib32/libwx_baseu-3.0.so.0
#50 0xf70b1337 in wxAppBase::ProcessIdle() () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#51 0xf6fb1d07 in wxApp::DoIdle() () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#52 0xf6fb1e1c in ?? () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#53 0xf6bd69fb in g_main_context_dispatch () from /usr/lib32/libglib-2.0.so.0
#54 0xf6bd6de9 in ?? () from /usr/lib32/libglib-2.0.so.0
#55 0xf6bd7199 in g_main_loop_run () from /usr/lib32/libglib-2.0.so.0
#56 0xf62a58b5 in gtk_main () from /usr/lib32/libgtk-x11-2.0.so.0
#57 0xf6fd3095 in wxGUIEventLoop::DoRun() () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#58 0xf7492829 in wxEventLoopBase::Run() () from /usr/lib32/libwx_baseu-3.0.so.0
#59 0xf74542bf in wxAppConsoleBase::MainLoop() () from /usr/lib32/libwx_baseu-3.0.so.0
#60 0xf744ca00 in wxAppConsoleBase::OnRun() () from /usr/lib32/libwx_baseu-3.0.so.0
#61 0xf70b12df in wxAppBase::OnRun() () from /usr/lib32/libwx_gtk2u_core-3.0.so.0
#62 0xf74e84c8 in wxEntry(int&, wchar_t**) () from /usr/lib32/libwx_baseu-3.0.so.0
#63 0xf74e8593 in wxEntry(int&, char**) () from /usr/lib32/libwx_baseu-3.0.so.0
#64 0x0806776f in main (argc=<optimized out>, argv=0xffe35844) at /home/arcade/build/pkg-autobuild/pcsx2-git/src/pcsx2/pcsx2/gui/AppMain.cpp:62
(gdb)

@gregory38 - Moved here as requested.

@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Jul 10, 2016

Going to compile an older version of PCSX2 to see if it's a regression or not.

@refractionpcsx2

This comment has been minimized.

Copy link
Member

refractionpcsx2 commented Jul 11, 2016

I believe he asked for @turtleli to be tagged, he is now :P

@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Jul 11, 2016

Still happens on 16th June build. Going back further.

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 commented Jul 11, 2016

Don't tell me you test all releases => git help bisect

@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Jul 11, 2016

God no, I'm just jumping back massive steps as I'm not sure it's actually a regression at this point. Once I hit one that works, I'll have something better to work with. I didn't want to bisect without a rough idea of times.

1st May also crashes.

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 commented Jul 11, 2016

Try 1.4 release. June is very recent. Then 1.2.
Anyway you could likely bisect the full project with less than 15 build.

@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Jul 11, 2016

Hrm, 1.4 and 1.2 don't built. 1.4 kinda just stops...

[ 23%] Built target Utilities_NO_TLS
[ 24%] Linking CXX static library libUtilities.a
[ 24%] Built target Utilities
make: *** [Makefile:128: all] Error 2
==> ERROR: A failure occurred in build().

and 1.2 doesn't like my toolchain...

CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:104 (message):
  Could not find toolchain file: cmake/linux-compiler-i386-multilib.cmake
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 commented Jul 11, 2016

Oh yes, I forgot this detail. Sorry. Recent gcc was added recently.

@gregory38 gregory38 changed the title Assertion failed: Unhandled page fault @ 0x0000000 on Intel GPU Invalid pointer due to race condition between mutex/thread/sema during exit Jul 13, 2016
@turtleli

This comment has been minimized.

Copy link
Member

turtleli commented Jul 27, 2016

@Enverex What CPU do you have? Is it a Broadwell/Skylake CPU?

@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Jul 28, 2016

Broadwell i7-5775C.

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 commented Jul 28, 2016

To be sure, I don't think it is related to mesa or GPU stuff. @kust2708 seems to have a similar issue.

I think it would worth to test the commit that change TLS (on console?) maybe on linux it was helpful for sync

@turtleli

This comment has been minimized.

Copy link
Member

turtleli commented Jul 28, 2016

Could you also copypaste the CPU flags from /proc/cpuinfo? And do you know whether glibc on your system was compiled with --enable-lock-elision?

I'm currently wondering whether it's TSX related - I asked for the CPU because the interesting part to me is:

#11 <signal handler called>
#12 0xf5f62cc0 in __lll_unlock_elision () from /usr/lib32/libpthread.so.0
#13 0xf5f5ad58 in __pthread_mutex_unlock_usercnt () from /usr/lib32/libpthread.so.0

If --enable-lock-elision is enabled in glibc and the processor has TSX instruction sets enabled (hle/rtm) then unlocking a unlocked mutex can cause a crash.

__lll_unlock_elision(int *lock, int private)
{
  /* When the lock was free we're in a transaction.
     When you crash here you unlocked a free lock.  */
  if (*lock == 0)
    _xend();
  else
    lll_unlock ((*lock), private);
  return 0;
}

That's my current hypothesis. EDIT: It would mean we need to make sure we're not unlocking when the lock is free.

@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Jul 28, 2016

That's likely what it is. We resolved an issue in RetroArch recently where the same thing was happening (crash on Broadwell/Haswell due to unlocking an already unlocked mutex).

This CPU is TSX enabled (hle and rtm in proc flags) and lock elision is enabled.

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 commented Jul 28, 2016

OoO could explain why it is fine on my system. It would also be possible that PCSX2 unlocks an unlocked mutex.

@turtleli

This comment has been minimized.

Copy link
Member

turtleli commented Mar 9, 2018

@Enverex Is this issue still present?

@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Mar 9, 2018

I believe it was actually a GCC or GLIBC bug. Either way, I've not seen it for a long time. Probably safe to close.

@turtleli turtleli closed this Mar 9, 2018
@Enverex

This comment has been minimized.

Copy link
Author

Enverex commented Mar 9, 2018

Sorry, I misread this issue as being the one in the first sentence (about crashing when loading an ISO). Whilst that issue doesn't exist anymore, the "crashes on exit if a game is loaded" issue still exists:

/var/tmp/makepkg/pcsx2-git/src/pcsx2/common/src/Utilities/Linux/LnxHostSys.cpp(70) : assertion failed:
    Function:  void SysPageFaultSignalFilter(int, siginfo_t*, void*)
    Thread:    Unknown
    Condition: false
    Message:   Unhandled page fault @ 0x00000000

Stacktrace:
[00] 0x0x5695516c                                
[01] __kernel_rt_sigreturn                       
[02] 0x0xf6c936e0                                
[03] 0x0xf6c8a218                                
[04] 0x0x569555dc                                
[05] 0x0x568737c5                                
[06] 0x0x56608962                                
[07] 0x0x56966d4a                                
[08] 0x0x569670b7                                
[09] 0x0x56969467                                
[10] 0x0xf6c86346                                
[11] clone                                       
@turtleli turtleli reopened this Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.