Bug 321870

Summary: crash in nepomuk or kdirwatch(kdelibs)
Product: [Unmaintained] kdelibs Reporter: Jaime Torres <jtamate>
Component: kdecoreAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: cfeck, nepomuk-bugs, szo
Priority: VHI Keywords: drkonqi
Version: Git   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: the tar with the file
Proposed fix

Description Jaime Torres 2013-07-02 18:53:07 UTC
Application: nepomukfilewatch (0.1.0)
KDE Platform Version: 4.10.90 (Compiled from sources)
Qt Version: 4.8.5
Operating System: Linux 3.9.3-10.g06ad9d8-desktop x86_64
Distribution: "openSUSE 13.1 Milestone 2 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:

Just closed a previous drkonki report. Nepomuk just restarted, and crash.
.xsession-error messages:
** (zeitgeist-datahub:20007): WARNING **: kde-recent-document-provider.vala:131: Couldn't process /home/jtorres/.kde/share/apps/RecentDocuments/nepomukfilewatch-20130
701-224005.kcrash.txt.desktop: Error when getting information for file '/home/jtorres/.kde/share/apps/RecentDocuments/nepomukfilewatch-20130701-224005.kcrash.txt.desk
top': No such file or directory
Application '/opt/kde4/bin/nepomukfilewatch ' crashed! 4 restarts left.
Fontconfig warning: "/etc/fonts/conf.d/56-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated.
Using Virtuoso Version: "6.1.6.3127-pthreads" 
Using Virtuoso Version: "6.1.6.3127-pthreads" 
Soprano::ODBC::ConnectionPool::ConnectionPool(const QString&, const QStringList&, QObject*) "host=localhost:1114;uid=dba;pwd=dba;driver=/opt/kde4/lib/virtuoso/plugins
/virtodbc_r.so" 
Soprano::ODBC::Connection::Connection() QThread(0x17a2310) 
virtual Soprano::ODBC::Connection::~Connection() QThread(0x17a2310) 
QStringList Solid::Backends::UDisks::UDisksManager::allDevicesInternal()  error:  "org.freedesktop.DBus.Error.Disconnected" 
*** Error in `/opt/kde4/bin/nepomukfilewatch': free(): invalid next size (normal): 0x0000000001c2e6a0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7af96)[0x7f6f65cd9f96]
/lib64/libc.so.6(+0x7bd13)[0x7f6f65cdad13]
/usr/lib/qt4.5/lib/libQtCore.so.4(_Z5qFreePv+0x9)[0x7f6f66ae2927]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN7QString4freeEPNS_4DataE+0xb0)[0x7f6f66b337ac]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN9QFileInfoD1Ev+0x112)[0x7f6f66b739de]
/usr/lib/qt4.5/lib/libQtCore.so.4(+0x11b9f9)[0x7f6f66b6c9f9]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN12QDirIterator4nextEv+0x34)[0x7f6f66b6cc82]
/opt/kde4/bin/nepomukfilewatch[0x41f1fb]
/opt/kde4/bin/nepomukfilewatch[0x41b129]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN14QMetaCallEvent13placeMetaCallEP7QObject+0x22)[0x7f6f66bf23e8]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN7QObject5eventEP6QEvent+0xb9)[0x7f6f66bfa3d1]
/usr/lib/qt4.5/lib/libQtGui.so.4(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x101)[0x7f6f67675c89]
/usr/lib/qt4.5/lib/libQtGui.so.4(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x258)[0x7f6f6767c440]
/opt/kde4/lib/libkdeui.so.5(_ZN12KApplication6notifyEP7QObjectP6QEvent+0x1b6)[0x7f6f6874c416]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x62)[0x7f6f66be20a4]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x460)[0x7f6f66be4f8c]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN16QCoreApplication16sendPostedEventsEP7QObjecti+0x1d)[0x7f6f66be5159]
/usr/lib/qt4.5/lib/libQtCore.so.4(+0x1bef58)[0x7f6f66c0ff58]
/usr/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x135)[0x7f6f6236eca5]
/usr/lib64/libglib-2.0.so.0(+0x4bfe8)[0x7f6f6236efe8]
/usr/lib64/libglib-2.0.so.0(g_main_context_iteration+0x34)[0x7f6f6236f0a4]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x6d)[0x7f6f66c0f8a1]
/usr/lib/qt4.5/lib/libQtGui.so.4(+0x2ec246)[0x7f6f67718246]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x46)[0x7f6f66be048a]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0x135)[0x7f6f66be06df]
/usr/lib/qt4.5/lib/libQtCore.so.4(_ZN16QCoreApplication4execEv+0xcf)[0x7f6f66be5de5]
/usr/lib/qt4.5/lib/libQtGui.so.4(_ZN12QApplication4execEv+0x18)[0x7f6f6767419a]
/opt/kde4/bin/nepomukfilewatch[0x40def8]
/opt/kde4/bin/nepomukfilewatch[0x4096ec]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f6f65c80a15]
/opt/kde4/bin/nepomukfilewatch[0x409735]

The crash can be reproduced sometimes.

-- Backtrace:
Application: Nepomuk File Watch (nepomukfilewatch), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
To enable execution of this file add
	add-auto-load-safe-path /home/jtorres/gcc44/lib64/libstdc++.so.6.0.18-gdb.py
line to your configuration file "/home/jtorres/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/jtorres/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
[Current thread is 1 (Thread 0x7f6f696fe780 (LWP 4581))]

Thread 3 (Thread 0x7f6f56b98700 (LWP 4582)):
#0  0x00007f6f623ae289 in ?? () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f6f623ae4f9 in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f6f6236ef28 in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f6f6236f0a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f6f66c0f8b7 in QEventDispatcherGlib::processEvents (this=0x7f6f500008c0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:427
#5  0x00007f6f66be048a in QEventLoop::processEvents (this=this@entry=0x7f6f56b97dc0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:149
#6  0x00007f6f66be06df in QEventLoop::exec (this=0x7f6f56b97dc0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:204
#7  0x00007f6f66ae6d09 in QThread::exec (this=<optimized out>) at /g/kdegit/qt/src/corelib/thread/qthread.cpp:537
#8  0x00007f6f66ae6d9b in QThread::run (this=<optimized out>) at /g/kdegit/qt/src/corelib/thread/qthread.cpp:604
#9  0x00007f6f66ae9157 in QThreadPrivate::start (arg=0x1aab160) at /g/kdegit/qt/src/corelib/thread/qthread_unix.cpp:349
#10 0x00007f6f6683ce0e in start_thread () from /lib64/libpthread.so.0
#11 0x00007f6f65d47b9d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f6f54f4e700 (LWP 4586)):
#0  0x00007f6f6683ee21 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1  0x00007f6f623ae4d1 in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f6f6236e575 in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f6f6236ee9e in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f6f6236f0a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007f6f66c0f8b7 in QEventDispatcherGlib::processEvents (this=0x7f6f4c0008c0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:427
#6  0x00007f6f66be048a in QEventLoop::processEvents (this=this@entry=0x7f6f54f4dd90, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:149
#7  0x00007f6f66be06df in QEventLoop::exec (this=0x7f6f54f4dd90, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:204
#8  0x00007f6f66ae6d09 in QThread::exec (this=<optimized out>) at /g/kdegit/qt/src/corelib/thread/qthread.cpp:537
#9  0x00007f6f66bc2616 in QInotifyFileSystemWatcherEngine::run (this=0x1c19dd0) at /g/kdegit/qt/src/corelib/io/qfilesystemwatcher_inotify.cpp:256
#10 0x00007f6f66ae9157 in QThreadPrivate::start (arg=0x1c19dd0) at /g/kdegit/qt/src/corelib/thread/qthread_unix.cpp:349
#11 0x00007f6f6683ce0e in start_thread () from /lib64/libpthread.so.0
#12 0x00007f6f65d47b9d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f6f696fe780 (LWP 4581)):
[KCrash Handler]
#6  0x00007f6f65c943a5 in raise () from /lib64/libc.so.6
#7  0x00007f6f65c95828 in abort () from /lib64/libc.so.6
#8  0x00007f6f65cd441b in __libc_message () from /lib64/libc.so.6
#9  0x00007f6f65cd9f96 in malloc_printerr () from /lib64/libc.so.6
#10 0x00007f6f65cdad13 in _int_free () from /lib64/libc.so.6
#11 0x00007f6f66ae2927 in qFree (ptr=<optimized out>) at /g/kdegit/qt/src/corelib/global/qmalloc.cpp:60
#12 0x00007f6f66b337ac in QString::free (d=0x1c2e6a0) at /g/kdegit/qt/src/corelib/tools/qstring.cpp:1235
#13 0x00007f6f66b739de in ~QString (this=<optimized out>, __in_chrg=<optimized out>) at ../../include/QtCore/../../../../kdegit/qt/src/corelib/tools/qstring.h:880
#14 ~QFileSystemEntry (this=<optimized out>, __in_chrg=<optimized out>) at /g/kdegit/qt/src/corelib/io/qfilesystementry_p.h:65
#15 ~QFileInfoPrivate (this=<optimized out>, __in_chrg=<optimized out>) at /g/kdegit/qt/src/corelib/io/qfileinfo_p.h:68
#16 ~QSharedDataPointer (this=<optimized out>, __in_chrg=<optimized out>) at ../../include/QtCore/../../../../kdegit/qt/src/corelib/tools/qshareddata.h:90
#17 QFileInfo::~QFileInfo (this=0x11e5, __in_chrg=<optimized out>) at /g/kdegit/qt/src/corelib/io/qfileinfo.cpp:364
#18 0x00007f6f66b6c9f9 in QDirIteratorPrivate::advance (this=0x1c0d4b0) at /g/kdegit/qt/src/corelib/io/qdiriterator.cpp:263
#19 0x00007f6f66b6cc82 in QDirIterator::next (this=0x1c10b30) at /g/kdegit/qt/src/corelib/io/qdiriterator.cpp:496
#20 0x000000000041f1fb in KInotify::Private::_k_addWatches (this=0x1c14360) at /g/kdegit/nepomuk-core/services/filewatch/kinotify.cpp:174
#21 0x000000000041b129 in KInotify::qt_static_metacall (_o=0x1bfaba0, _c=<optimized out>, _id=<optimized out>, _a=0x1d01590) at /g/b45/nepomuk-core/services/filewatch/kinotify.moc:97
#22 0x00007f6f66bf23e8 in QMetaCallEvent::placeMetaCall (this=<optimized out>, object=<optimized out>) at /g/kdegit/qt/src/corelib/kernel/qobject.cpp:524
#23 0x00007f6f66bfa3d1 in QObject::event (this=0x1bfaba0, e=<optimized out>) at /g/kdegit/qt/src/corelib/kernel/qobject.cpp:1194
#24 0x00007f6f67675c89 in QApplicationPrivate::notify_helper (this=this@entry=0x17d9360, receiver=receiver@entry=0x1bfaba0, e=e@entry=0x1d275a0) at /g/kdegit/qt/src/gui/kernel/qapplication.cpp:4562
#25 0x00007f6f6767c440 in QApplication::notify (this=0x7fffc5369e40, receiver=0x1bfaba0, e=0x1d275a0) at /g/kdegit/qt/src/gui/kernel/qapplication.cpp:3944
#26 0x00007f6f6874c416 in KApplication::notify (this=0x7fffc5369e40, receiver=0x1bfaba0, event=0x1d275a0) at /g/kdegit/kdelibs/kdeui/kernel/kapplication.cpp:311
#27 0x00007f6f66be20a4 in QCoreApplication::notifyInternal (this=0x7fffc5369e40, receiver=receiver@entry=0x1bfaba0, event=event@entry=0x1d275a0) at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:949
#28 0x00007f6f66be4f8c in sendEvent (event=0x1d275a0, receiver=0x1bfaba0) at ../../include/QtCore/../../../../kdegit/qt/src/corelib/kernel/qcoreapplication.h:231
#29 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x17a22a0) at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:1573
#30 0x00007f6f66be5159 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:1466
#31 0x00007f6f66c0ff58 in sendPostedEvents () at ../../include/QtCore/../../../../kdegit/qt/src/corelib/kernel/qcoreapplication.h:236
#32 postEventSourceDispatch (s=0x17cde70) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:280
#33 0x00007f6f6236eca5 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#34 0x00007f6f6236efe8 in ?? () from /usr/lib64/libglib-2.0.so.0
#35 0x00007f6f6236f0a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#36 0x00007f6f66c0f8a1 in QEventDispatcherGlib::processEvents (this=0x17a7aa0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:425
#37 0x00007f6f67718246 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at /g/kdegit/qt/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#38 0x00007f6f66be048a in QEventLoop::processEvents (this=this@entry=0x7fffc5369db0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:149
#39 0x00007f6f66be06df in QEventLoop::exec (this=0x7fffc5369db0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:204
#40 0x00007f6f66be5de5 in QCoreApplication::exec () at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:1221
#41 0x00007f6f6767419a in QApplication::exec () at /g/kdegit/qt/src/gui/kernel/qapplication.cpp:3823
#42 0x000000000040def8 in Nepomuk2::Service2::initUI<Nepomuk2::FileWatch> (argc=argc@entry=1, argv=argv@entry=0x7fffc536a098, aboutData=...) at /g/kdegit/nepomuk-core/libnepomukcore/service/service2.h:162
#43 0x00000000004096ec in main (argc=1, argv=0x7fffc536a098) at /g/kdegit/nepomuk-core/services/filewatch/nepomukfilewatch.cpp:564

Possible duplicates by query: bug 306240.

Reported using DrKonqi
Comment 1 Jaime Torres 2013-07-02 19:55:35 UTC
This crash happens to every KDE program that tries to walk into my home directory (almost all).
Just because I had a file in that directory with a very strange name, just to test things like this. To be able to move that file from a KDE application to another place.
The file name is:
\|\|\|\|$'\026'$'\026'$'\026'$'\026'$'\207'$'\207'$'\207'$'\207'$'\377'$'\377'$'\377'$'\377'\(\(\(\($'\255'$'\255'$'\255'$'\255'$'\324'$'\324'$'\324'$'\324'\`\`\`\`$'\373'$'\373'$'\373'$'\373'$'\333'$'\333'$'\333'$'\333'NNNN$'\v'$'\v'$'\v'$'\v'FFFF$'\335'$'\335'$'\335'$'\335'JJJJ$'\275'$'\275'$'\275'$'\275'$'\364'$'\364'$'\364'$'\364'$'\333'$'\333'$'\333'$'\333'MMMM
Once I've moved that file to a rarely used directory (not in /home), the crashes are gone, except when trying to navigate to that directory: dolphin and the open dialog freeze.

Probably related to commit f4269ef3498581964e8a1a13cd0d6d7f19c88762 ?
Fix/workaround for legacy encoded filename handling
Comment 2 Christoph Feck 2013-07-02 21:12:39 UTC
Could you create a simple tar.gz file with an empty file named this way?
Comment 3 Jaime Torres 2013-07-03 05:20:43 UTC
Created attachment 80909 [details]
the tar with the file
Comment 4 Christoph Feck 2013-07-03 11:56:17 UTC
Yep, kio_file crashes when visiting a directory with such a file with Dolphin.
Róbert, could you have a look?
Comment 5 Szokovacs Robert 2013-07-03 13:26:14 UTC
Created attachment 80921 [details]
Proposed fix

Please check if this patch corrects the problem!
Comment 6 Szokovacs Robert 2013-07-03 14:59:55 UTC
Git commit 736d5237f822fc72736f75f379c4f86d6bf48098 by Szókovács Róbert.
Committed on 03/07/2013 at 14:57.
Pushed by szokovacs into branch 'master'.

Fix for kio_file crash on non-utf filenames

The buffersize was too small for cases when more than one characters
are non-utf
REVIEW: 111379

M  +1    -1    kdecore/localization/klocale_kde.cpp

http://commits.kde.org/kdelibs/736d5237f822fc72736f75f379c4f86d6bf48098