https://bugs.kde.org/show_bug.cgi?id=334640

Andreas Messer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #11 from Andreas Messer <[email protected]> ---
The microcode update just hides the problem. I suppose it disabled the TSX
feature for your CPU. As far as I know there have been some bugs in the early
implementations. On my new Skylake Xeon TSX is available and for me on almost
every login a Bunch of KDE application crashes. They run properly after
restarting them manually.
I have looked a little bit into the KShareDataCache code. It looks to me that
there are a lot of places for exceptions or error returns which might leave the
mutex in some locked or unlocked state when it is recreated afterwards. TSX
seems to be very sensitive against wrong usage of mutexes.
For tests I have disabled TSX mutexes by setting the mutex type to "Error
Checking Mutex". I did not observe any crashes since then. Here is the change I
made:
--- a/kdecore/util/kshareddatacache_p.h
+++ b/kdecore/util/kshareddatacache_p.h
@@ -199,6 +199,9 @@
         // Initialize attributes, enable process-shared primitives, and setup
         // the mutex.
         if (::sysconf(_SC_THREAD_PROCESS_SHARED) >= 200112L &&
pthread_mutexattr_init(&mutexAttr) == 0) {
+            // Use error check mutex to disable TSX mutex
+            pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_ERRORCHECK);
+
             if (pthread_mutexattr_setpshared(&mutexAttr,
PTHREAD_PROCESS_SHARED) == 0 &&
                 pthread_mutex_init(&m_mutex, &mutexAttr) == 0)
             {

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to