Bug 282027 - KDE-Applications won't start -> intCeil(0,0)
Summary: KDE-Applications won't start -> intCeil(0,0)
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kshareddatacache (show other bugs)
Version: 4.7
Platform: FreeBSD Ports FreeBSD
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-14 16:25 UTC by Tobias C. Berner
Modified: 2012-05-21 03:22 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias C. Berner 2011-09-14 16:25:29 UTC
Version:           4.7 (using KDE 4.7.1) 
OS:                FreeBSD

Trying to run any kde applications (or at least the ones I tried) end in a Floating Exception.

Eg. for kate:
0x0000000803fb9698 in intCeil<unsigned int> (a=0, b=0) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdecore/util/kshareddatacache.cpp:240
240         return (a + b - 1) / b;

Backtrace:
#0  0x0000000803fb9698 in intCeil<unsigned int> (a=0, b=0) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdecore/util/kshareddatacache.cpp:240
#1  0x0000000803fb9ce9 in SharedMemory::totalSize (cacheSize=0, effectivePageSize=0) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdecore/util/kshareddatacache.cpp:868
#2  0x0000000803fbcb74 in CacheLocker (this=0x7fffffffa740, _d=0x80c38be80) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdecore/util/kshareddatacache.cpp:1174
#3  0x0000000803fb83a4 in KSharedDataCache::find (this=0x80c019920, key=@0x7fffffffa9b0, destination=0x7fffffffa850)
    at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdecore/util/kshareddatacache.cpp:1492
#4  0x0000000802335fa1 in KIconLoaderPrivate::findCachedPixmapWithPath (this=0x80c3fbf00, key=@0x7fffffffa9b0, data=@0x7fffffffa990, path=@0x7fffffffa920)
    at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdeui/icons/kiconloader.cpp:860
#5  0x000000080233b826 in KIconLoader::loadIcon (this=0x80c386160, _name=@0x80c3caeb8, group=KIconLoader::Desktop, size=16, state=0, overlays=@0x80c3caec0, path_store=0x0, 
    canReturnNull=false) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdeui/icons/kiconloader.cpp:1222
#6  0x0000000802333ef3 in KIconEngine::pixmap (this=0x80c3caeb0, size=@0x7fffffffade0, mode=QIcon::Normal, state=QIcon::Off)
    at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdeui/icons/kiconengine.cpp:104
#7  0x0000000802cadee5 in QIcon::pixmap () from /usr/local/lib/qt4/libQtGui.so.4
#8  0x0000000802c9be3d in QWidgetPrivate::setWindowIcon_sys () from /usr/local/lib/qt4/libQtGui.so.4
#9  0x0000000802c55c25 in QWidget::event () from /usr/local/lib/qt4/libQtGui.so.4
#10 0x0000000802bf776f in QApplicationPrivate::notify_helper () from /usr/local/lib/qt4/libQtGui.so.4
#11 0x0000000802bfeb6e in QApplication::notify () from /usr/local/lib/qt4/libQtGui.so.4
#12 0x00000008023b4ef2 in KApplication::notify (this=0x7fffffffc000, receiver=0x80c201400, event=0x7fffffffb580)
    at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdeui/kernel/kapplication.cpp:311
#13 0x0000000804700b94 in QCoreApplication::notifyInternal () from /usr/local/lib/qt4/libQtCore.so.4
#14 0x0000000802bf7e59 in QApplication::setWindowIcon () from /usr/local/lib/qt4/libQtGui.so.4
#15 0x00000008023b2538 in KApplicationPrivate::parseCommandLine (this=0x80c204350) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdeui/kernel/kapplication.cpp:839
#16 0x00000008023b3327 in KApplicationPrivate::init (this=0x80c204350, GUIenabled=true) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdeui/kernel/kapplication.cpp:478
#17 0x00000008023b6050 in KApplication (this=0x7fffffffc000, GUIenabled=true) at /usr/ports/x11/kdelibs4/work/kdelibs-4.7.1/kdeui/kernel/kapplication.cpp:352
#18 0x0000000800a9184f in KateApp (this=0x7fffffffc000, args=0x80c0193b8) at /usr/ports/editors/kate/work/kate-4.7.1/kate/app/kateapp.cpp:52
#19 0x0000000800853481 in kdemain (argc=1, argv=0x7fffffffd568) at /usr/ports/editors/kate/work/kate-4.7.1/kate/app/katemain.cpp:373
#20 0x000000000040087b in main (argc=1, argv=0x7fffffffd568) at /usr/ports/editors/kate/work/kate-4.7.1/build/kate/app/kate_dummy.cpp:3

Reproducible: Always

Steps to Reproduce:
Start kate, dolphin, amarok...

Actual Results:  
Floatingpoint Exception 

Expected Results:  
No exception.




Operatingsystem version: FreeBSD 9.0-BETA2 r225539, amd64
Comment 1 Raphael Kubo da Costa 2011-09-14 16:27:58 UTC
Changing product to kdelibs/shareddatacache.
Comment 2 Michael Pyne 2011-09-15 01:42:10 UTC
It seems the cache (on-disk) is corrupt somehow. I'm looking at modifying the affected code path to add more sanity checks. But until then, you may want to try removing the cached information to remove the corrupt data.

You can do this by deleting the file /var/tmp/kdecache-$USER/icon-cache.kcache in this case (it's probably the icon cache which is corrupted since every KDE application is affected).
Comment 3 Tobias C. Berner 2011-09-15 07:25:38 UTC
Yes, removing /var/tmp/kdecache-${USER} solved the problem. Thanks.
Comment 4 Christoph Feck 2011-09-19 12:14:34 UTC
Please keep this bug open until those sanity checks are added.
Comment 5 Michael Pyne 2012-05-21 03:22:30 UTC
Git commit 7f0aaa22dfd26d1e0aa4582dd67b835beb97571e by Michael Pyne.
Committed on 21/05/2012 at 03:36.
Pushed by mpyne into branch 'KDE/4.8'.

kshareddatacache: Sanity checking for intCeil.

intCeil is only ever used with unsigned int, so remove the template.
This allows for proper validation of the denominator, a corrupted-cache
exception will be thrown if intCeil is called incorrectly.

Passes the kshareddatacache and kiconloader_unittest tests, and my
limited fuzz testing of kpat and plasma themes.

Should fix bug 282027 and any duplicates mentioning "intCeil(0, 0)" in
the backtrace.
FIXED-IN:4.8.4

M  +5    -2    kdecore/util/kshareddatacache.cpp

http://commits.kde.org/kdelibs/7f0aaa22dfd26d1e0aa4582dd67b835beb97571e