Bug 266133

Summary: crashes when any outline item points to pages out of the document
Product: [Applications] okular Reporter: andres ordonez <andres.felipe.ordonez>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 0.11.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.1
Sentry Crash Report:

Description andres ordonez 2011-02-12 14:16:40 UTC
Application: okular (0.11.1)
KDE Platform Version: 4.5.1 (KDE 4.5.1)
Qt Version: 4.7.0
Operating System: Linux 2.6.35-25-generic x86_64
Distribution: Ubuntu 10.10

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

I created an outline for a djvu file using djvused
djvused file.djvu -e 'set-outline outline.info' -s

Then I opened file.djvu with okular and when tried to see the outline by clicking in the 'contents' button okular crashed

This does not happen with other files i.e. I have created outlines for djvu files (in the same way as above) and okular works fine with them (I just checked this)

The crash can be reproduced every time.

-- Backtrace:
Application: Okular (okular), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f8667e74760 (LWP 4066))]

Thread 2 (Thread 0x7f865d4f7700 (LWP 4067)):
#0  0x00007f86650c3203 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8660faa009 in ?? () from /lib/libglib-2.0.so.0
#2  0x00007f8660faa7b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
#3  0x00007f865dc2e0f4 in ?? () from /usr/lib/libgio-2.0.so.0
#4  0x00007f8660fcf7e4 in ?? () from /lib/libglib-2.0.so.0
#5  0x00007f8664074971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#6  0x00007f86650cf92d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f8667e74760 (LWP 4066)):
[KCrash Handler]
#6  0x00007f864b62c680 in Okular::Page::label() const () from /usr/lib/libokularcore.so.1
#7  0x00007f864b94beb5 in ?? () from /usr/lib/kde4/okularpart.so
#8  0x00007f864b9052f8 in ?? () from /usr/lib/kde4/okularpart.so
#9  0x00007f86669b1e01 in QItemDelegate::paint (this=0x10985a0, painter=0x7fff7fb37880, option=<value optimized out>, index=...) at itemviews/qitemdelegate.cpp:483
#10 0x00007f86669a8889 in QTreeView::drawRow (this=<value optimized out>, painter=<value optimized out>, option=<value optimized out>, index=<value optimized out>) at itemviews/qtreeview.cpp:1678
#11 0x00007f86669a341a in QTreeView::drawTree (this=0x10cd340, painter=<value optimized out>, region=<value optimized out>) at itemviews/qtreeview.cpp:1441
#12 0x00007f86669a3f43 in QTreeView::paintEvent (this=0x10cd340, event=0x7fff7fb384d0) at itemviews/qtreeview.cpp:1274
#13 0x00007f8666461c2e in QWidget::event (this=0x10cd340, event=0x7fff7fb384d0) at kernel/qwidget.cpp:8333
#14 0x00007f866682d5e6 in QFrame::event (this=0x10cd340, e=0x7fff7fb384d0) at widgets/qframe.cpp:557
#15 0x00007f8666966a8b in QAbstractItemView::viewportEvent (this=0x10cd340, event=0x7fff7fb384d0) at itemviews/qabstractitemview.cpp:1619
#16 0x00007f86669a4d65 in QTreeView::viewportEvent (this=0x10cd340, event=0x7fff7fb384d0) at itemviews/qtreeview.cpp:1256
#17 0x00007f8665a55507 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value optimized out>, receiver=0x1069980, event=0x7fff7fb384d0) at kernel/qcoreapplication.cpp:847
#18 0x00007f866640bfac in QApplicationPrivate::notify_helper (this=0xe40910, receiver=0x1069980, e=0x7fff7fb384d0) at kernel/qapplication.cpp:4392
#19 0x00007f8666411aed in QApplication::notify (this=0x7fff7fb396e0, receiver=0x1069980, e=0x7fff7fb384d0) at kernel/qapplication.cpp:4277
#20 0x00007f866715e156 in KApplication::notify (this=0x7fff7fb396e0, receiver=0x1069980, event=0x7fff7fb384d0) at ../../kdeui/kernel/kapplication.cpp:310
#21 0x00007f8665a55cdc in QCoreApplication::notifyInternal (this=0x7fff7fb396e0, receiver=0x1069980, event=0x7fff7fb384d0) at kernel/qcoreapplication.cpp:732
#22 0x00007f866646867d in sendSpontaneousEvent (this=0x10d7c60, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x122c3e0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#23 QWidgetPrivate::drawWidget (this=0x10d7c60, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x122c3e0) at kernel/qwidget.cpp:5420
#24 0x00007f866663c3a6 in QWidgetBackingStore::sync (this=0x122c3e0) at painting/qbackingstore.cpp:1320
#25 0x00007f866645b730 in QWidgetPrivate::syncBackingStore (this=0x103c750) at kernel/qwidget.cpp:1805
#26 0x00007f86664622f5 in QWidget::event (this=0xfda540, event=0x1094fe0) at kernel/qwidget.cpp:8480
#27 0x00007f866684941b in QMainWindow::event (this=0xfda540, event=0x1094fe0) at widgets/qmainwindow.cpp:1417
#28 0x00007f866727a683 in KXmlGuiWindow::event (this=0x7fff7fb36d10, ev=0x0) at ../../kdeui/xmlgui/kxmlguiwindow.cpp:130
#29 0x00007f866640bfdc in QApplicationPrivate::notify_helper (this=0xe40910, receiver=0xfda540, e=0x1094fe0) at kernel/qapplication.cpp:4396
#30 0x00007f8666411aed in QApplication::notify (this=0x7fff7fb396e0, receiver=0xfda540, e=0x1094fe0) at kernel/qapplication.cpp:4277
#31 0x00007f866715e156 in KApplication::notify (this=0x7fff7fb396e0, receiver=0xfda540, event=0x1094fe0) at ../../kdeui/kernel/kapplication.cpp:310
#32 0x00007f8665a55cdc in QCoreApplication::notifyInternal (this=0x7fff7fb396e0, receiver=0xfda540, event=0x1094fe0) at kernel/qcoreapplication.cpp:732
#33 0x00007f8665a58c22 in sendEvent (receiver=0x0, event_type=<value optimized out>, data=0xe28350) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#34 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0xe28350) at kernel/qcoreapplication.cpp:1373
#35 0x00007f8665a82653 in sendPostedEvents (s=0xe444e0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#36 postEventSourceDispatch (s=0xe444e0) at kernel/qeventdispatcher_glib.cpp:277
#37 0x00007f8660fa6342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#38 0x00007f8660faa2a8 in ?? () from /lib/libglib-2.0.so.0
#39 0x00007f8660faa45c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#40 0x00007f8665a82193 in QEventDispatcherGlib::processEvents (this=0xe27e60, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415
#41 0x00007f86664bea4e in QGuiEventDispatcherGlib::processEvents (this=0x7fff7fb36d10, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#42 0x00007f8665a54a02 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#43 0x00007f8665a54dec in QEventLoop::exec (this=0x7fff7fb39630, flags=) at kernel/qeventloop.cpp:201
#44 0x00007f8665a58ebb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#45 0x000000000040807c in _start ()

Possible duplicates by query: bug 226635, bug 206843, bug 193175.

Reported using DrKonqi
Comment 1 Pino Toscano 2011-02-12 14:26:12 UTC
Can you please attach a sample document showing the issue?
Comment 3 Pino Toscano 2011-02-12 15:40:53 UTC
Thanks, useful.

Fixes coming in few minutes.
Comment 4 Pino Toscano 2011-02-12 15:43:48 UTC
SVN commit 1220023 by pino:

do not try to get the label of pages "out of the document"

CCBUG: 266133


 M  +1 -1      tocmodel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1220023
Comment 5 Pino Toscano 2011-02-12 15:44:04 UTC
SVN commit 1220024 by pino:

do not try to get the label of pages "out of the document"

CCBUG: 266133


 M  +1 -1      tocmodel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1220024
Comment 6 Pino Toscano 2011-02-12 15:50:02 UTC
SVN commit 1220027 by pino:

ignore setViewport() for page numbers out of the document

CCBUG: 266133


 M  +5 -0      document.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1220027
Comment 7 Pino Toscano 2011-02-12 15:50:41 UTC
SVN commit 1220028 by pino:

ignore setViewport() for page numbers out of the document

CCBUG: 266133


 M  +5 -0      document.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1220028
Comment 8 Pino Toscano 2011-02-12 15:53:15 UTC
Ok, should be fixed now, for KE 4.6.1.
Comment 9 andres ordonez 2011-02-12 17:52:16 UTC
idiot proof. 

That was fast! thanks!