Bug 110111 - Crash on expanding Contents tree in sidebar
Summary: Crash on expanding Contents tree in sidebar
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Unmaintained
Component: general (show other bugs)
Version: 0.4.2
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-03 17:42 UTC by Peter Brett
Modified: 2005-08-03 18:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
PDF testcase (244.91 KB, application/pdf)
2005-08-03 17:46 UTC, Peter Brett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Brett 2005-08-03 17:42:33 UTC
Version:           0.4.2 (using KDE KDE 3.4.2)
Installed from:    Fedora RPMs
OS:                Linux

1. Load a PDF created with LyX using "\usepackage{hyperref}"
2. Click on the contents tab in the sidebar. The top-level of the contents tree appears, unexpanded.
3. Click on one of the top nodes to expand it.
4. Immediate SIGSEGV.

Backtrace:

(no debugging symbols found)
.
.
.
(no debugging symbols found)
[KCrash handler]
#4  0x0267dd28 in QDomElement::attribute ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#5  0x0052ba03 in TOC::slotExecuted () from /usr/lib/kde3/libkpdfpart.so
#6  0x0052be60 in TOC::qt_invoke () from /usr/lib/kde3/libkpdfpart.so
#7  0x02419df4 in QObject::activate_signal ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#8  0x027a5c4f in QListView::clicked () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#9  0x0250f180 in QListView::contentsMouseReleaseEventEx ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#10 0x0250f930 in QListView::contentsMouseReleaseEvent ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#11 0x02ea1816 in KListView::contentsMouseReleaseEvent ()
   from /usr/lib/libkdeui.so.4
#12 0x02541ac7 in QScrollView::viewportMouseReleaseEvent ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#13 0x0253ed2a in QScrollView::eventFilter ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#14 0x02509307 in QListView::eventFilter ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#15 0x0241987c in QObject::activate_filters ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#16 0x024198f1 in QObject::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#17 0x02457dec in QWidget::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#18 0x023b50cd in QApplication::internalNotify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#19 0x023b602f in QApplication::notify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#20 0x02b89851 in KApplication::notify () from /usr/lib/libkdecore.so.4
#21 0x0234c746 in QETWidget::translateMouseEvent ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#22 0x0234af01 in QApplication::x11ProcessEvent ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#23 0x0235f008 in QEventLoop::processEvents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#24 0x023cd78b in QEventLoop::enterLoop ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#25 0x023cd696 in QEventLoop::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#26 0x023b4a99 in QApplication::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#27 0x0804f000 in ?? ()
#28 0x008aede6 in __libc_start_main () from /lib/libc.so.6
#29 0x0804ed31 in ?? ()
Comment 1 Peter Brett 2005-08-03 17:46:15 UTC
Created attachment 12064 [details]
PDF testcase

The contents of the document can be browsed successfully in Gnome PDF Viewer.
Comment 2 Albert Astals Cid 2005-08-03 18:12:24 UTC
SVN commit 442692 by aacid:

Forgot to backport this crash fix from 3.5 branch, sorry about it, will be there on KDE 3.4.3 and KDE 3.5.0
BUGS: 110087
BUGS: 110111


 M  +6 -1      toc.cpp  


--- branches/KDE/3.4/kdegraphics/kpdf/ui/toc.cpp #442691:442692
@@ -121,7 +121,12 @@
 
 void TOC::slotExecuted( QListViewItem *i )
 {
-    const QDomElement & e = static_cast< TOCItem* >( i )->element();
+    TOCItem* tocItem = dynamic_cast<TOCItem*>( i );
+    // that filters clicks on [+] that for a strange reason don't seem to be TOCItem*
+    if (tocItem == NULL)
+        return;
+    const QDomElement & e = tocItem->element();
+
     QString externalFileName = e.attribute( "ExternalFileName" );
     if ( !externalFileName.isEmpty() )
     {