Bug 329582 - Okular crashes while searching and reloading the PDF simultaneously
Summary: Okular crashes while searching and reloading the PDF simultaneously
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.18.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: drkonqi
: 331131 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-03 22:36 UTC by Bernhard Jungk
Modified: 2014-02-14 22:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Jungk 2014-01-03 22:36:02 UTC
Application: okular (0.18.0)
KDE Platform Version: 4.12.0
Qt Version: 4.8.4
Operating System: Linux 3.11.0-15-generic x86_64
Distribution: Ubuntu 13.10

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

Searching in a PDF document, while pdflatex regenerated the PDF. I think that Okular crashed while reloading the document.

-- Backtrace:
Application: Okular (okular), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f14e3b057c0 (LWP 2625))]

Thread 2 (Thread 0x7f14c7499700 (LWP 6979)):
#0  0x00007f14e0b29f7d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f14dd7206a4 in g_main_context_poll (priority=2147483647, n_fds=1, fds=0x7f14c802b060, timeout=-1, context=0x7f14c802b480) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:4006
#2  g_main_context_iterate (context=context@entry=0x7f14c802b480, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3707
#3  0x00007f14dd7207ac in g_main_context_iteration (context=0x7f14c802b480, may_block=1) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3773
#4  0x00007f14e152aa76 in QEventDispatcherGlib::processEvents (this=0x7f14c802b460, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#5  0x00007f14e14fc5ef in QEventLoop::processEvents (this=this@entry=0x7f14c7498d70, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f14e14fc8e5 in QEventLoop::exec (this=this@entry=0x7f14c7498d70, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f14e13fb88f in QThread::exec (this=this@entry=0x1fc1cc0) at thread/qthread.cpp:542
#8  0x00007f14e14ddd13 in QInotifyFileSystemWatcherEngine::run (this=0x1fc1cc0) at io/qfilesystemwatcher_inotify.cpp:265
#9  0x00007f14e13fdf2f in QThreadPrivate::start (arg=0x1fc1cc0) at thread/qthread_unix.cpp:338
#10 0x00007f14ddbf8f6e in start_thread (arg=0x7f14c7499700) at pthread_create.c:311
#11 0x00007f14e0b369cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7f14e3b057c0 (LWP 2625)):
[KCrash Handler]
#6  0x00007f14d1f25973 in Okular::Page::number (this=0x2ef9c80) at ../core/page.cpp:162
#7  0x00007f14d223a7f8 in PageViewItem::pageNumber (this=this@entry=0x27bdf40) at ../ui/pageviewutils.cpp:66
#8  0x00007f14d222c806 in PageView::slotRelayoutPages (this=<optimized out>) at ../ui/pageview.cpp:4040
#9  0x00007f14d2233d75 in PageView::qt_static_metacall (_o=<optimized out>, _id=<optimized out>, _a=<optimized out>, _c=<optimized out>) at ./pageview.moc:173
#10 0x00007f14e1515dce in QObject::event (this=this@entry=0x1bb4570, e=e@entry=0xb2c5010) at kernel/qobject.cpp:1194
#11 0x00007f14e1f3e36b in QWidget::event (this=this@entry=0x1bb4570, event=event@entry=0xb2c5010) at kernel/qwidget.cpp:8845
#12 0x00007f14e22df5be in QFrame::event (this=this@entry=0x1bb4570, e=e@entry=0xb2c5010) at widgets/qframe.cpp:557
#13 0x00007f14e235b77b in QAbstractScrollArea::event (this=0x1bb4570, e=0xb2c5010) at widgets/qabstractscrollarea.cpp:996
#14 0x00007f14e1eeedfc in QApplicationPrivate::notify_helper (this=this@entry=0x1723570, receiver=receiver@entry=0x1bb4570, e=e@entry=0xb2c5010) at kernel/qapplication.cpp:4567
#15 0x00007f14e1ef5470 in QApplication::notify (this=this@entry=0x7ffff1680fa0, receiver=receiver@entry=0x1bb4570, e=e@entry=0xb2c5010) at kernel/qapplication.cpp:4353
#16 0x00007f14e2bf8c6a in KApplication::notify (this=0x7ffff1680fa0, receiver=0x1bb4570, event=0xb2c5010) at ../../kdeui/kernel/kapplication.cpp:311
#17 0x00007f14e14fd8bd in QCoreApplication::notifyInternal (this=0x7ffff1680fa0, receiver=receiver@entry=0x1bb4570, event=event@entry=0xb2c5010) at kernel/qcoreapplication.cpp:946
#18 0x00007f14e1500e1f in sendEvent (event=0xb2c5010, receiver=0x1bb4570) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#19 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x16e6670) at kernel/qcoreapplication.cpp:1570
#20 0x00007f14e15012c3 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1463
#21 0x00007f14e152b073 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#22 postEventSourceDispatch (s=s@entry=0x1727bc0) at kernel/qeventdispatcher_glib.cpp:279
#23 0x00007f14dd7203b6 in g_main_dispatch (context=0x1723940) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3065
#24 g_main_context_dispatch (context=context@entry=0x1723940) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3641
#25 0x00007f14dd720708 in g_main_context_iterate (context=context@entry=0x1723940, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3712
#26 0x00007f14dd7207ac in g_main_context_iteration (context=0x1723940, may_block=1) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3773
#27 0x00007f14e152aa55 in QEventDispatcherGlib::processEvents (this=0x16e7b30, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#28 0x00007f14e1f909d6 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#29 0x00007f14e14fc5ef in QEventLoop::processEvents (this=this@entry=0x7ffff1680230, flags=...) at kernel/qeventloop.cpp:149
#30 0x00007f14e14fc8e5 in QEventLoop::exec (this=this@entry=0x7ffff1680230, flags=...) at kernel/qeventloop.cpp:204
#31 0x00007f14e239538c in QDialog::exec (this=0x2438e30) at dialogs/qdialog.cpp:554
#32 0x00007f14e2b6bf02 in KMessageBox::createKMessageBox (dialog=dialog@entry=0x2438e30, icon=..., text=..., strlist=..., ask=..., checkboxReturn=checkboxReturn@entry=0x7ffff1680530, options=..., details=..., notifyType=notifyType@entry=QMessageBox::Information) at ../../kdeui/dialogs/kmessagebox.cpp:344
#33 0x00007f14e2b6c141 in KMessageBox::createKMessageBox (dialog=dialog@entry=0x2438e30, icon=icon@entry=QMessageBox::Information, text=..., strlist=..., ask=..., checkboxReturn=checkboxReturn@entry=0x7ffff1680530, options=..., details=...) at ../../kdeui/dialogs/kmessagebox.cpp:159
#34 0x00007f14e2b6dcdc in KMessageBox::questionYesNoListWId (parent_id=113246291, text=..., strlist=..., caption=..., buttonYes_=..., buttonNo_=..., dontAskAgainName=..., options=...) at ../../kdeui/dialogs/kmessagebox.cpp:486
#35 0x00007f14e2b6ded0 in KMessageBox::questionYesNoList (parent=<optimized out>, text=..., strlist=..., caption=..., buttonYes=..., buttonNo=..., dontAskAgainName=..., options=...) at ../../kdeui/dialogs/kmessagebox.cpp:446
#36 0x00007f14e2b6df28 in KMessageBox::questionYesNo (parent=<optimized out>, text=..., caption=..., buttonYes=..., buttonNo=..., dontAskAgainName=..., options=...) at ../../kdeui/dialogs/kmessagebox.cpp:361
#37 0x00007f14d1f0d0de in Okular::DocumentPrivate::doContinueDirectionMatchSearch (this=0x1959600, doContinueDirectionMatchSearchStruct=0x6ca5810) at ../core/document.cpp:1639
#38 0x00007f14e1515dce in QObject::event (this=0x187e630, e=<optimized out>) at kernel/qobject.cpp:1194
#39 0x00007f14e1eeedfc in QApplicationPrivate::notify_helper (this=this@entry=0x1723570, receiver=receiver@entry=0x187e630, e=e@entry=0x2ed8fc0) at kernel/qapplication.cpp:4567
#40 0x00007f14e1ef5470 in QApplication::notify (this=this@entry=0x7ffff1680fa0, receiver=receiver@entry=0x187e630, e=e@entry=0x2ed8fc0) at kernel/qapplication.cpp:4353
#41 0x00007f14e2bf8c6a in KApplication::notify (this=0x7ffff1680fa0, receiver=0x187e630, event=0x2ed8fc0) at ../../kdeui/kernel/kapplication.cpp:311
#42 0x00007f14e14fd8bd in QCoreApplication::notifyInternal (this=0x7ffff1680fa0, receiver=receiver@entry=0x187e630, event=event@entry=0x2ed8fc0) at kernel/qcoreapplication.cpp:946
#43 0x00007f14e1500e1f in sendEvent (event=0x2ed8fc0, receiver=0x187e630) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#44 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x16e6670) at kernel/qcoreapplication.cpp:1570
#45 0x00007f14e15012c3 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1463
#46 0x00007f14e152b073 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#47 postEventSourceDispatch (s=s@entry=0x1727bc0) at kernel/qeventdispatcher_glib.cpp:279
#48 0x00007f14dd7203b6 in g_main_dispatch (context=0x1723940) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3065
#49 g_main_context_dispatch (context=context@entry=0x1723940) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3641
#50 0x00007f14dd720708 in g_main_context_iterate (context=context@entry=0x1723940, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3712
#51 0x00007f14dd7207ac in g_main_context_iteration (context=0x1723940, may_block=1) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3773
#52 0x00007f14e152aa55 in QEventDispatcherGlib::processEvents (this=0x16e7b30, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#53 0x00007f14e1f909d6 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#54 0x00007f14e14fc5ef in QEventLoop::processEvents (this=this@entry=0x7ffff1680de0, flags=...) at kernel/qeventloop.cpp:149
#55 0x00007f14e14fc8e5 in QEventLoop::exec (this=this@entry=0x7ffff1680de0, flags=...) at kernel/qeventloop.cpp:204
#56 0x00007f14e1501e5b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#57 0x00007f14e1eed34c in QApplication::exec () at kernel/qapplication.cpp:3828
#58 0x0000000000408276 in main (argc=<optimized out>, argv=<optimized out>) at ../../shell/main.cpp:100

Reported using DrKonqi
Comment 1 Albert Astals Cid 2014-01-05 00:32:40 UTC
Git commit 9adbd054e4de88de262d7fa8243ccd73789e2bfc by Albert Astals Cid.
Committed on 05/01/2014 at 00:26.
Pushed by aacid into branch 'KDE/4.12'.

Do not resetSearch if we're closing down

It's useless as it will be reset anyway on the close down procedure
and it will cause a crash if you are unlucky.

Reason:
  * In the document observers qset pageview comes before
  * We are closing and notifySetup with an empty vector
  * pageview empties its vector in notifySetip
  * part sees the notifySetup and resets the search
  * resetting the search calls another notifySetup with the non empty page vector
    that will be deleted asap when we go back to the first notifySetup

There are another billion ways to fix this:
 * Don't allow nested notifySetup
 * Clear the running searches before sending the first notifySetup
 * Empty the pagesVector before sending the first notifySetup
 * etc

But i feel this is the less invasive one (even if it may not be the most technically correct)
FIXED-IN: 4.12.1

M  +4    -0    core/document.cpp

http://commits.kde.org/okular/9adbd054e4de88de262d7fa8243ccd73789e2bfc
Comment 2 Albert Astals Cid 2014-02-14 22:11:50 UTC
*** Bug 331131 has been marked as a duplicate of this bug. ***