In one of the unit tests in KDevelop I a "Bus Error" (SIGBUS). If I run it on valgrind, I get the following backtrace. Looks like a bug in KSharedDataCache...
==1917== Warning: set address range perms: large range [0x39446000, 0x86877000) (defined)
==1917== Process terminating with default action of signal 7 (SIGBUS)
==1917== Non-existent physical address at address 0x39446048
==1917== at 0x9D7594B: KSharedDataCache::Private::lock() const (kshareddatacache.cpp:1131)
==1917== by 0x9D75B0F: KSharedDataCache::Private::CacheLocker::cautiousLock() (kshareddatacache.cpp:1154)
==1917== by 0x9D75E8B: KSharedDataCache::Private::CacheLocker::CacheLocker(KSharedDataCache::Private const*) (kshareddatacache.cpp:1229)
==1917== by 0x9D72BA8: KSharedDataCache::find(QString const&, QByteArray*) const (kshareddatacache.cpp:1508)
==1917== by 0x86A6534: KIconLoaderPrivate::findCachedPixmapWithPath(QString const&, QPixmap&, QString&) (kiconloader.cpp:860)
==1917== by 0x86A7CF2: KIconLoader::loadIcon(QString const&, KIconLoader::Group, int, int, QStringList const&, QString*, bool) const (kiconloader.cpp:1222)
==1917== by 0x86A270C: KIconEngine::pixmap(QSize const&, QIcon::Mode, QIcon::State) (kiconengine.cpp:104)
==1917== by 0x8E6BEC4: QIcon::pixmap(QSize const&, QIcon::Mode, QIcon::State) const (in /usr/lib/libQtGui.so.4.8.1)
==1917== by 0x60AE372: Sublime::AreaTabButton::AreaTabButton(QString, QIcon, unsigned int, QWidget*, bool, QWidget*) (mainwindow_p.cpp:831)
==1917== by 0x60A7044: Sublime::AreaTabBar::addCustomTab(QString, QIcon, bool, QString, QWidget*) (mainwindow_p.h:97)
==1917== by 0x60A429F: Sublime::MainWindow::setupAreaSelector() (mainwindow.cpp:104)
==1917== by 0x63498A8: KDevelop::MainWindow::loadSettings() (mainwindow.cpp:208)
Steps to Reproduce:
1. compile kdevelop
2. run <builddir>/languages/cpp/tests/buddiestest
The testsuite passes here without issue. :-/
KSharedDataCache does probably need better error-checking though, no excuse for a corrupted cache to induce SIGBUS.
Yes, I've discussed with Milian (also from kdevelop) and he can't reproduce it either.
Do you have any idea of how can I figure out what's going on?
Specifically what's going on, probably not. It's undoubtedly a corrupted cache file somehow so a quick fix would be to delete the icon cache (normally /var/tmp/kdecache-$USER/icon-cache.kcache).
There's a debug area for KSharedDataCache and KIconLoader which you can enable as well, might tell you which icon ended up corrupted.
I don't have this directory for this user (the kde-devel user), the other one does, though. Could that be a problem?
I added those debug areas and they're not adding any output :/
Well, it's possible that the missing directory is the issue, but then KSharedDataCache should fail much earlier in the process... the exact setting for the directory is returned by "kde4-config --path cache", which should return /something/ even for your kde-devel user, I would hope!
kde-devel@thinktatil:~/build-kdevelop/languages/cpp$ kde4-config --path cache
So I removed the icon cache, I keep having this problem, the SIGBUS... :/
Created attachment 71175 [details]
More error-handling for KSharedDataCache
Aleix, if you're still experiencing the crash then please test this patch. It adds more error checking against invalid data page access, valid cache page sizes, etc. I've tried replacing some caches with random data here without leading to crashes so hopefully it makes it a bit more resilient for you at least.
Haven't had it for a while, and not really using that codebase anymore. Closing.