Bug 305654 - Crash in KSharedDataCache::Private::mapSharedMemory
Summary: Crash in KSharedDataCache::Private::mapSharedMemory
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kshareddatacache (show other bugs)
Version: 4.11.3
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
: 324465 325102 327618 327632 327642 329231 329548 329552 329626 329868 330055 330874 332634 335791 335959 (view as bug list)
Depends on:
Reported: 2012-08-23 10:07 UTC by Jon Flowers
Modified: 2018-11-01 23:52 UTC (History)
20 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Jon Flowers 2012-08-23 10:07:16 UTC
Application: kpat (3.6)
KDE Platform Version: 4.8.4 (4.8.4)
Qt Version: 4.8.1
Operating System: Linux 3.2.0-29-generic x86_64
Distribution: Ubuntu 12.04.1 LTS

-- Information about the crash:
- What I was doing when the application crashed:
I was playing Yukon
I used control+z to undo a move when I noticed the size of the cards increase. I think I may have touched the trackpad while still holding the control key down. I then tried to decrease the size of the cards which were now too big for my screen so I held down control+z and zoomed out using the trackpad. That was when the crash occurred. The program restarts but when I choose a game it instantly crashes. It makes no difference which game I choose.

The crash can be reproduced every time.

-- Backtrace:
Application: KPatience (kpat), signal: Bus error
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f6a610d4780 (LWP 13235))]

Thread 2 (Thread 0x7f6a4ce6f700 (LWP 13238)):
#0  0x00007f6a5a330fc0 in __pthread_mutex_lock (mutex=0x7f6a48000a60) at pthread_mutex_lock.c:113
#1  0x00007f6a59aa55a1 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6a59a691df in g_main_context_acquire () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6a59a69f04 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6a59a6a164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f6a5f1bf426 in QEventDispatcherGlib::processEvents (this=0x7f6a480008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0x00007f6a5f18ec82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007f6a5f18eed7 in QEventLoop::exec (this=0x7f6a4ce6edd0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007f6a5f08dfa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#9  0x00007f6a5f16e9ff in QInotifyFileSystemWatcherEngine::run (this=0x1feb960) at io/qfilesystemwatcher_inotify.cpp:248
#10 0x00007f6a5f090fcb in QThreadPrivate::start (arg=0x1feb960) at thread/qthread_unix.cpp:298
#11 0x00007f6a5a32ee9a in start_thread (arg=0x7f6a4ce6f700) at pthread_create.c:308
#12 0x00007f6a5da824bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#13 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f6a610d4780 (LWP 13235)):
[KCrash Handler]
#6  0x00007f6a5f722804 in testAndSetOrdered (newValue=1, expectedValue=0, this=0x7f6a472d8000) at /usr/include/qt4/QtCore/qatomic_x86_64.h:145
#7  testAndSetAcquire (newValue=1, expectedValue=0, this=0x7f6a472d8000) at /usr/include/qt4/QtCore/qatomic_x86_64.h:267
#8  KSharedDataCache::Private::mapSharedMemory (this=0x1edc5f0) at ../../kdecore/util/kshareddatacache.cpp:1158
#9  0x00007f6a5f71ed43 in Private (expectedItemSize=0, defaultCacheSize=3145728, name=..., this=0x1edc5f0) at ../../kdecore/util/kshareddatacache.cpp:1003
#10 KSharedDataCache::KSharedDataCache (this=0x1ff9e30, cacheName=..., defaultCacheSize=3145728, expectedItemSize=0) at ../../kdecore/util/kshareddatacache.cpp:1428
#11 0x00007f6a5fc5bbde in KImageCache::KImageCache (this=0x1ff9e30, cacheName=..., defaultCacheSize=3145728, expectedItemSize=<optimized out>) at ../../kdeui/util/kimagecache.cpp:86
#12 0x00007f6a60ccd8d5 in KAbstractCardDeck::setTheme(KCardTheme const&) () from /usr/lib/libkcardgame.so
#13 0x00007f6a60cd1d89 in KCardDeck::KCardDeck(KCardTheme const&, QObject*) () from /usr/lib/libkcardgame.so
#14 0x000000000042e9b7 in _start ()

Reported using DrKonqi
Comment 1 Thomas Lübking 2013-09-03 18:47:45 UTC
*** Bug 324465 has been marked as a duplicate of this bug. ***
Comment 2 Thomas Lübking 2013-09-03 18:49:44 UTC
bug #324465 suggest that kwin (this backtrace) and plasma-desktop (just mentioned) crashed at the same time and plasma desktop required double clicks after the auto restart.
Comment 3 Christoph Feck 2013-11-16 13:23:25 UTC
*** Bug 325102 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Feck 2013-11-16 13:24:00 UTC
*** Bug 327618 has been marked as a duplicate of this bug. ***
Comment 5 Christoph Feck 2013-11-16 13:24:19 UTC
*** Bug 327632 has been marked as a duplicate of this bug. ***
Comment 6 Christoph Feck 2013-11-16 13:24:36 UTC
*** Bug 327642 has been marked as a duplicate of this bug. ***
Comment 7 Christoph Feck 2013-11-16 13:34:59 UTC
If you can reproduce this crash (starting system settings/kmix/amarok), please check:

- does removing /var/tmp/kdecache-USERNAME/plasma-*.kcache files prevent the crash? (Please save files for later inspection)

- did you customize the Workspace theme with "Theme Details" in system settings?

- is there a plasma-*.kcache file for the Workspace theme you use (or used in Theme Details)?

- if unsure, add the output of command "dir /var/tmp/kdecache-USERNAME/plasma-*" and the file "~/.kde/share/config/plasmarc".

Also, did you use the "bleachbit" cleaning tool?
Comment 8 E. Hakan Duran 2013-11-16 20:28:05 UTC
Please disregard my bug report. I realized that this happened in my case due to a lack of virtual hard drive space. I apologize for the inconvenience my bug report caused.

Comment 9 Christoph Feck 2013-12-26 15:06:49 UTC
*** Bug 329231 has been marked as a duplicate of this bug. ***
Comment 10 Zetok 2013-12-30 20:58:31 UTC
After update to 4.12 I can't reproduce it.

I don't remember customizing Workspace theme, but I'm unsure what is exact meaning of 'customize'. AFAIR only thing I did, was switching to other theme, which is Caledonia.

There is plasma-*.kcache file for Workspace theme I use:
-rw-r--r--  1 zetok zetok  81M 12-28 10:26 plasma_theme_Caledonia.kcache
Comment 11 Christoph Feck 2014-01-03 13:13:06 UTC
Other possible causes (in addition to what is mentioned in comment #7):

- /var is not on an ext4 filesystem, so the cache could not be pre-allocated

- /var is full, so the cache could not be pre-allocated

Regarding bleachbit, I now found out, why people are still using it. Some privacy related web sites recommend using bleachbit, but unless their developers fix the issue with overwriting cache files while KDE runs, you _have_ to expect the crashes.
Comment 12 Christoph Feck 2014-01-03 13:13:22 UTC
*** Bug 329552 has been marked as a duplicate of this bug. ***
Comment 13 Christoph Feck 2014-01-03 13:19:23 UTC
*** Bug 329548 has been marked as a duplicate of this bug. ***
Comment 14 Christoph Feck 2014-01-03 13:21:49 UTC
The backtrace for bug 329548 is a little bit different, maybe it gives a hint, if/how a crash could be prevented.
Comment 15 Christian Esken 2014-01-05 19:47:14 UTC
*** Bug 329626 has been marked as a duplicate of this bug. ***
Comment 16 Christoph Feck 2014-01-12 19:21:57 UTC
*** Bug 329868 has been marked as a duplicate of this bug. ***
Comment 17 Christoph Feck 2014-01-18 01:00:06 UTC
*** Bug 330055 has been marked as a duplicate of this bug. ***
Comment 18 Thomas Lübking 2014-02-07 08:37:10 UTC
*** Bug 330874 has been marked as a duplicate of this bug. ***
Comment 19 Christoph Feck 2014-03-26 20:48:28 UTC
*** Bug 332634 has been marked as a duplicate of this bug. ***
Comment 20 Christoph Feck 2014-06-04 21:27:43 UTC
*** Bug 335791 has been marked as a duplicate of this bug. ***
Comment 21 Christoph Feck 2014-06-09 00:21:52 UTC
*** Bug 335959 has been marked as a duplicate of this bug. ***
Comment 22 kdebugs 2014-06-09 01:36:16 UTC
Is there a good reason for Bug 327618 to still be open (see comment 4 above)?  It appears to have been triggered by low disk space, as my crash and others' were.  Is there, besides that, a reliable way to reproduce?
Comment 23 Christoph Feck 2014-06-09 09:32:38 UTC
I already marked that bug as a duplicate. Please ask the reporter of bug 327618, why he reopened it.
Comment 24 Christoph Feck 2014-06-25 09:36:47 UTC
*** Bug 327618 has been marked as a duplicate of this bug. ***
Comment 25 Märt Bakhoff 2016-02-29 13:53:32 UTC
SDDM greeter started crashing on startup after upgrading to plasma-framework-5.19 on arch linux x86_64. Qt version 5.5.1, SDDM 0.13 with breeze theme. Reproduces every time. Downgrading to plasma-framework 5.18 helps. Is this the right bug or should I create a new one? 

Core was generated by `/usr/bin/sddm-greeter --socket /tmp/sddm-:0-VmMDWH --theme /usr/share/sddm/them'.
Program terminated with signal SIGBUS, Bus error.
#0  0x00007f3a10faa4be in QBasicAtomicOps<4>::testAndSetRelaxed<int> (newValue=1, expectedValue=0, 
    _q_value=@0x7f3a048b3000: <error reading variable>) at /usr/include/qt/QtCore/qatomic_x86.h:232
232                      : "memory");
[Current thread is 1 (Thread 0x7f3a274a77c0 (LWP 11680))]
(gdb) bt
#0  0x00007f3a10faa4be in QBasicAtomicOps<4>::testAndSetRelaxed<int> (newValue=1, expectedValue=0, 
    _q_value=@0x7f3a048b3000: <error reading variable>) at /usr/include/qt/QtCore/qatomic_x86.h:232
#1  QGenericAtomicOps<QBasicAtomicOps<4> >::testAndSetAcquire<int, int> (newValue=1, expectedValue=0, 
    _q_value=@0x7f3a048b3000: <error reading variable>) at /usr/include/qt/QtCore/qgenericatomic.h:144
#2  QBasicAtomicInteger<int>::testAndSetAcquire (newValue=1, expectedValue=0, this=0x7f3a048b3000) at /usr/include/qt/QtCore/qbasicatomic.h:138
#3  KSharedDataCache::Private::mapSharedMemory (this=this@entry=0xd52660)
    at /tmp/kcoreaddons/src/kcoreaddons-5.19.0/src/lib/caching/kshareddatacache.cpp:1144
#4  0x00007f3a10fa488a in KSharedDataCache::Private::Private (expectedItemSize=0, defaultCacheSize=16777216, name=..., this=0xd52660)
    at /tmp/kcoreaddons/src/kcoreaddons-5.19.0/src/lib/caching/kshareddatacache.cpp:987
#5  KSharedDataCache::KSharedDataCache (this=0xc05e60, cacheName=..., defaultCacheSize=16777216, expectedItemSize=0)
    at /tmp/kcoreaddons/src/kcoreaddons-5.19.0/src/lib/caching/kshareddatacache.cpp:1383
#6  0x00007f3a11b75058 in KSharedPixmapCacheMixin<KSharedDataCache>::KSharedPixmapCacheMixin (expectedItemSize=0, defaultCacheSize=16777216, 
    cacheName=..., this=0xc05e50) at /usr/include/KF5/KGuiAddons/kimagecache.h:89
Comment 26 Michael Pyne 2016-03-23 02:25:57 UTC
This might be the right bug ticket (the backtrace is at least similar), but have you checked whether some of the workarounds mentioned in previous comments work?

At the very least, is the hard disk that hosts the /var directory nearly full? If so, you'll need to free up enough space if you're using a file system that doesn't support the posix_fallocate() system call that KSharedDataCache uses to try to avoid this crash.

Have you been using Bleachbit? If so, stop (or at least configure it to stop trying to shred important system files like the various caches used by Plasma...).

Finally, you may want to remove any existing KSharedDataCache caches (*.kcache files, either under "$HOME/.cache" or /var/tmp/kdecache-$USER or wherever else your system is configured to store cached data). Removing the cache (without editing its contents in the process) is always safe to do even if the system is running. If SDDM works normally after this, then it *is* a bug but at least you'll have a workaround.
Comment 27 Andrew Crouthamel 2018-11-01 13:40:57 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 28 Andrew Crouthamel 2018-11-01 23:52:11 UTC
Per reporter via email:

Sorry, I can't re-test it.
I don't remember for what hardware it was.
And as it was so long, and no fresh reports - than it can closed.