Created attachment 107835 [details] gdb backtrace Sometimes when I use backward search from okular, kile crashes with a segmentation fault. I have attached a corresponding backtrace. I am using tag v3.0b1 (commit b9939900) of kile.
Relevant part for backtrace searches: (gdb) run Starting program: /usr/bin/kile Thread 1 "kile" received signal SIGSEGV, Segmentation fault. (gdb) backtrace #0 0x00007ffff791f190 in KileDocument::TextInfo::getDoc() () at src/documentinfo.cpp:427 #1 0x00007ffff797b8d2 in KileDocument::Manager::loadDocumentAndViewSettings (this=this@entry=0x555555813420, textInfo=textInfo@entry=0x0) at src/kiledocmanager.cpp:2376 #2 0x00007ffff797bf7b in KileDocument::Manager::fileOpen (this=0x555555813420, url=..., encoding=..., index=index@entry=-1) at src/kiledocmanager.cpp:925 #3 0x00007ffff797c171 in KileDocument::Manager::fileSelected (this=<optimized out>, url=...) at src/kiledocmanager.cpp:828 #4 0x00007ffff7951de2 in Kile::openDocument (url=..., this=0x55555580c600) at src/kile.cpp:1384 #5 Kile::openDocument (this=0x55555580c600, s=...) at src/kile.cpp:1389 #6 0x00007ffff7ab1d84 in MainAdaptor::qt_static_metacall (_a=0x7fffffffd420, _id=2, _c=QMetaObject::InvokeMetaMethod, _o=0x555556b4d090) at build/src/mainadaptor.moc:159 #7 MainAdaptor::qt_metacall (this=0x555556b4d090, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffffffd420) at build/src/mainadaptor.moc:160 #8 0x00007ffff2566add in ?? () from /usr/lib/libQt5DBus.so.5 #9 0x00007ffff256bf49 in ?? () from /usr/lib/libQt5DBus.so.5 #10 0x00007ffff256c518 in ?? () from /usr/lib/libQt5DBus.so.5 #11 0x00007ffff256ed2e in ?? () from /usr/lib/libQt5DBus.so.5 #12 0x00007ffff11441d2 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5 #13 0x00007ffff1e7d49c in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5 #14 0x00007ffff1f6f5e4 in QMainWindow::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5 #15 0x00007ffff4c1345b in KMainWindow::event(QEvent*) () from /usr/lib/libKF5XmlGui.so.5 #16 0x00007ffff4c65156 in KXmlGuiWindow::event(QEvent*) () from /usr/lib/libKF5XmlGui.so.5 #17 0x00007ffff1e3ae4c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5 #18 0x00007ffff1e42926 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5 #19 0x00007ffff1113bd0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5 #20 0x00007ffff1116426 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5 #21 0x00007ffff116ea74 in ?? () from /usr/lib/libQt5Core.so.5 #22 0x00007fffe954fa57 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #23 0x00007fffe954fc88 in ?? () from /usr/lib/libglib-2.0.so.0 #24 0x00007fffe954fd1c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #25 0x00007ffff116e061 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5 #26 0x00007ffff1111ffb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5 #27 0x00007ffff111b048 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5 #28 0x00007ffff7a00d89 in kdemain (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:179 #29 0x00007ffff7439f6a in __libc_start_main () from /usr/lib/libc.so.6 #30 0x000055555555478a in _start ()
Can you try to create a small test file that demonstrates the problem?
After some further investigations I suspect the problem is not related to backward search at all. If kile is passed a folder on the command line, then kile segfaults: % /usr/bin/kile /home zsh: segmentation fault (core dumped) /usr/bin/kile /home return value 139 For some reason okular occasionally tries to open a specific line in a folder on backward search, but this is another issue.
Indeed it crashes when passed a directory.
Using backwards search, the journal shows a complaint from KDirWatch on the line immediately preceding the segfault. Tach 16 18:40:55 MyComputer kile[1818]: org.kde.kcoreaddons: KDirWatch: "<path to directory under my home>" is a directory. Use addDir! Tach 16 18:40:55 MyComputer kernel: kile[1818]: segfault at 98 ip 00007f3c0506b9c0 sp 00007ffc552e2038 error 4 in libkdeinit5_kile.so[7f3c04f19000+3db000] Tach 16 18:40:55 MyComputer systemd[1]: Created slice system-systemd\x2dcoredump.slice. Tach 16 18:40:55 MyComputer systemd[1]: Started Process Core Dump (PID 10102/UID 0). Tach 16 18:40:56 MyComputer kwin_x11[1208]: QXcbConnection: XCB error: 3 (BadWindow), sequence: 34509, resource id: 67108877, major code: 15 (QueryTree), minor code: 0 Tach 16 18:40:56 MyComputer systemd-coredump[10103]: Process 1818 (kile) of user 1000 dumped core. Stack trace of thread 1818: #0 0x00007f3c0506b9c0 n/a (libkdeinit5_kile.so) #1 0x00007f3c050cabd2 n/a (libkdeinit5_kile.so) #2 0x00007f3c050cb24b n/a (libkdeinit5_kile.so) #3 0x00007f3c050cb441 n/a (libkdeinit5_kile.so) #4 0x00007f3c050a2182 n/a (libkdeinit5_kile.so) #5 0x00007f3c05207a4a n/a (libkdeinit5_kile.so) #6 0x00007f3bffca7abd n/a (libQt5DBus.so.5) #7 0x00007f3bffcacf29 n/a (libQt5DBus.so.5) #8 0x00007f3bffcad4f8 n/a (libQt5DBus.so.5) #9 0x00007f3bffcafd0e n/a (libQt5DBus.so.5) #10 0x00007f3bfe897662 _ZN7QObject5eventEP6QEvent (libQt5Core.so.5) #11 0x00007f3bff5c513c _ZN7QWidget5eventEP6QEvent (libQt5Widgets.so.5) #12 0x00007f3bff6dd264 _ZN11QMainWindow5eventEP6QEvent (libQt5Widgets.so.5) #13 0x00007f3c023533bb _ZN11KMainWindow5eventEP6QEvent (libKF5XmlGui.so.5) #14 0x00007f3c023a4ca6 _ZN13KXmlGuiWindow5eventEP6QEvent (libKF5XmlGui.so.5) #15 0x00007f3bff584f2c _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5) #16 0x00007f3bff58ca06 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5) #17 0x00007f3bfe867060 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5) #18 0x00007f3bfe8698b6 _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData (libQt5Core.so.5) #19 0x00007f3bfe8c26e4 n/a (libQt5Core.so.5) #20 0x00007f3bf6cad270 g_main_context_dispatch (libglib-2.0.so.0) #21 0x00007f3bf6caef69 n/a (libglib-2.0.so.0) #22 0x00007f3bf6caefae g_main_context_iteration (libglib-2.0.so.0) #23 0x00007f3bfe8c1cd1 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5) #24 0x00007f3bfe86548b _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5) #25 0x00007f3bfe86e4d8 _ZN16QCoreApplication4execEv (libQt5Core.so.5) #26 0x00007f3c05150d94 kdemain (libkdeinit5_kile.so) #27 0x00007f3c04b81f6a __libc_start_main (libc.so.6) #28 0x0000560f585b776a _start (kile) Stack trace of thread 1819: #0 0x00007f3c04c4cf7b __poll (libc.so.6) #1 0x00007f3bf8a218e0 n/a (libxcb.so.1) #2 0x00007f3bf8a23679 xcb_wait_for_event (libxcb.so.1) #3 0x00007f3beccc785a n/a (libQt5XcbQpa.so.5) #4 0x00007f3bfe682fcb n/a (libQt5Core.so.5) #5 0x00007f3bfde2208a start_thread (libpthread.so.0) #6 0x00007f3c04c5747f __clone (libc.so.6) Stack trace of thread 1822: #0 0x00007f3bfde2838d pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0) #1 0x00007f3bfe68445c _ZN14QWaitCondition4waitEP6QMutexm (libQt5Core.so.5) #2 0x00007f3c05163818 n/a (libkdeinit5_kile.so) #3 0x00007f3bfe682fcb n/a (libQt5Core.so.5) #4 0x00007f3bfde2208a start_thread (libpthread.so.0) #5 0x00007f3c04c5747f __clone (libc.so.6) Stack trace of thread 1821: #0 0x00007f3bfde2838d pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0) #1 0x00007f3bfe68445c _ZN14QWaitCondition4waitEP6QMutexm (libQt5Core.so.5) #2 0x00007f3c05163818 n/a (libkdeinit5_kile.so) #3 0x00007f3bfe682fcb n/a (libQt5Core.so.5) #4 0x00007f3bfde2208a start_thread (libpthread.so.0) #5 0x00007f3c04c5747f __clone (libc.so.6) Stack trace of thread 1820: #0 0x00007f3c04c4cf7b __poll (libc.so.6) #1 0x00007f3bf6caeed3 n/a (libglib-2.0.so.0) #2 0x00007f3bf6caefae g_main_context_iteration (libglib-2.0.so.0) #3 0x00007f3bfe8c1cd1 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5) #4 0x00007f3bfe86548b _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5) #5 0x00007f3bfe67e27e _ZN7QThread4execEv (libQt5Core.so.5) #6 0x00007f3bffc9c376 n/a (libQt5DBus.so.5) #7 0x00007f3bfe682fcb n/a (libQt5Core.so.5) #8 0x00007f3bfde2208a start_thread (libpthread.so.0) #9 0x00007f3c04c5747f __clone (libc.so.6)
Git commit 1255af8b3bf7a835a09768dea61f9351e6da75a9 by Michel Ludwig. Committed on 25/11/2017 at 07:40. Pushed by mludwig into branch 'master'. Avoid crashing when trying to open a directory M +36 -3 src/kiledocmanager.cpp https://commits.kde.org/kile/1255af8b3bf7a835a09768dea61f9351e6da75a9
*** Bug 387176 has been marked as a duplicate of this bug. ***
*** Bug 388762 has been marked as a duplicate of this bug. ***