Bug 19669

Summary: okular/poppler crash in Poppler::convertAnnotColor when opening large PDF (Qt book)
Product: poppler Reporter: Luka Renko <lure>
Component: qt4 frontendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: medium CC: connor.k.imes
Version: unspecifiedKeywords: regression
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Luka Renko 2009-01-21 01:38:37 UTC
OS: Ubuntu Jaunty (up-to-date)
- KDE 4.2 RC packages (okular)
- Poppler 0.10.3 (Ubuntu package 0.10.3-0ubuntu1)

When I try to open "C++ GUI Programming with Qt" book in PDF with okular from KDE 4.2, it crashes reports the following error on console:

okular(21461): Attempt to use QAction "bookmark_action_0" with KXMLGUIFactory!
Error: Illegal annotation destination
Segmentation fault (core dumped)

I have installed dependand -dbg packages and reproduced the problem in "gdb" to get proper backtrace:

#0  Poppler::convertAnnotColor (color=0x6e653e0100000001)
    at poppler-annotation.cc:2043
#1  0x00007f784d8f00b5 in Poppler::Page::annotations (this=0x15474e0)
    at poppler-page.cc:1041
#2  0x00007f784db696eb in PDFGenerator::addAnnotations (
    this=<value optimized out>, popplerPage=0x6e653e0100000001, page=0x0)
    at /build/buildd/kdegraphics-4.1.96/okular/generators/poppler/generator_pdf.cpp:1261
#3  0x00007f784db6b8d9 in PDFGenerator::loadPages (this=0x1269fa0,
    pagesVector=@0xeb7d28, rotation=<value optimized out>, clear=false)
    at /build/buildd/kdegraphics-4.1.96/okular/generators/poppler/generator_pdf.cpp:462
#4  0x00007f784db6d36d in PDFGenerator::init (this=0x1269fa0,
    pagesVector=@0xeb7d28, walletKey=@0x7fff63966140)
    at /build/buildd/kdegraphics-4.1.96/okular/generators/poppler/generator_pdf.cpp:410
#5  0x00007f784db70845 in PDFGenerator::loadDocument (this=0x1269fa0,
    filePath=@0x7fff63966b00, pagesVector=@0xeb7d28)
    at /build/buildd/kdegraphics-4.1.96/okular/generators/poppler/generator_pdf.cpp:312
#6  0x00007f7850e639f0 in Okular::DocumentPrivate::openDocumentInternal (
    this=0xeb7bf0, offer=<value optimized out>, isstdin=false,
    docFile=@0x7fff63966b00, filedata=@0x7fff63966670)
    at /build/buildd/kdegraphics-4.1.96/okular/core/document.cpp:643
#7  0x00007f7850e711e5 in Okular::Document::openDocument (this=0xec2930,
    docFile=@0x7fff63966b00, url=@0x7fff639665d0, _mime=<value optimized out>)
    at /build/buildd/kdegraphics-4.1.96/okular/core/document.cpp:1593
#8  0x00007f785111e930 in Part::openFile (this=0xed3f80)
    at /build/buildd/kdegraphics-4.1.96/okular/part.cpp:874
#9  0x00007f785b51fb14 in KParts::ReadOnlyPart::openUrl (this=0xed3f80,
    url=<value optimized out>)
    at /build/buildd/kde4libs-4.1.96/kparts/part.cpp:558
#10 0x00007f7851119ce6 in Part::openUrl (this=0x7fff639650d0,
    url=@0x6e653e0100000001)
    at /build/buildd/kdegraphics-4.1.96/okular/part.cpp:970
#11 0x0000000000409830 in Shell::openUrl (this=0xe648f0, url=@0xe64990, page=0)
    at /build/buildd/kdegraphics-4.1.96/okular/shell/shell.cpp:136
#12 0x000000000040992c in Shell::delayedOpen (this=0xe648f0)
    at /build/buildd/kdegraphics-4.1.96/okular/shell/shell.cpp:119
#13 0x000000000040a738 in Shell::qt_metacall (this=0xe648f0,
    _c=QMetaObject::InvokeMetaMethod, _id=22333904, _a=0x7fff63966f40)
    at /build/buildd/kdegraphics-4.1.96/obj-x86_64-linux-gnu/okular/shell/shell.moc:90
#14 0x00007f78598e1154 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#15 0x00007f78598e73bf in ?? () from /usr/lib/libQtCore.so.4
#16 0x00007f78598dba63 in QObject::event () from /usr/lib/libQtCore.so.4
#17 0x00007f7858deebfd in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#18 0x00007f7858df69ba in QApplication::notify () from /usr/lib/libQtGui.so.4
#19 0x00007f785a6f833b in KApplication::notify (this=0x7fff63967930,
    receiver=0x126ef00, event=0x7fff63967600)
    at /build/buildd/kde4libs-4.1.96/kdeui/kernel/kapplication.cpp:307
#20 0x00007f78598ccd81 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#21 0x00007f78598f8ac6 in ?? () from /usr/lib/libQtCore.so.4
#22 0x00007f78598f522d in ?? () from /usr/lib/libQtCore.so.4
#23 0x00007f7854f5b30b in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#24 0x00007f7854f5eacd in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00007f7854f5ec8b in g_main_context_iteration ()
   from /usr/lib/libglib-2.0.so.0
#26 0x00007f78598f518f in QEventDispatcherGlib::processEvents ()
   from /usr/lib/libQtCore.so.4
#27 0x00007f7858e80adf in ?? () from /usr/lib/libQtGui.so.4
#28 0x00007f78598cb6a2 in QEventLoop::processEvents ()
   from /usr/lib/libQtCore.so.4
#29 0x00007f78598cb82d in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#30 0x00007f78598cdcdd in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#31 0x0000000000407de4 in main (argc=<value optimized out>,
    argv=<value optimized out>)
    at /build/buildd/kdegraphics-4.1.96/okular/shell/main.cpp:81

Note: this PDF can be opened on Ubuntu/Intrepid with KDE 4.1 and poppler 0.8.7
Comment 1 Luka Renko 2009-01-21 01:40:45 UTC
You can get problematic PDF from:
http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip
Comment 2 Albert Astals Cid 2009-01-21 12:34:43 UTC
I can't reproduce the crash and also the gdb backtrace looks damn strange, can you please run 
valgring okular path_to_file
and attach the results here?
Comment 3 Albert Astals Cid 2009-01-21 12:35:25 UTC
The other possibility i can think of is that you ran out of memory, is that possible?
Comment 4 Luka Renko 2009-01-21 12:51:17 UTC
I have tried it now on a clean KDE desktop (just Plasma, no apps beside some tray icons) on machine with 2 GB RAM. /proc/meminfo before test showed that I have 680 MB free memory + 800 MB occupied by cache (therefore available), which I suspect should be plenty even for 53 MB PDF.

Okular crashes almost instantly - I just get a main window for 0.1 sec (sometimes seen just as flicker), so I would say memory is not the issue here.

I would also like to point out that another Ubuntu/Jaunty (KDE 4.2 rc) user confirmed the bug in #kubuntu-devel, while two other users running Ubuntu/Intrepid (one with standard KDE 4.1.x and one with KDE 4.2.60 from SVN) reported that file opens OK for them. Therefore I suspect the difference is really in version of the poppler library (0.8.7 vs 0.10.3), which is also indicated by the stack trace.

I have also looked into poppler packages in Ubuntu, and they do not include any distro specific patches that could cause this (only patch is to fix bug 5667).
Comment 5 Albert Astals Cid 2009-01-21 15:08:02 UTC
It might be a problem in Ubuntu, i got Harald Sitter to rebuild Jaunty's okular package, please try the new package when available and report if it fixes the problem for you.
Comment 6 Connor Imes 2009-01-26 14:58:43 UTC
This bug has also been filed on Launchpad at https://bugs.launchpad.net/poppler/+bug/320269
Thank you.
Comment 7 Albert Astals Cid 2009-01-26 15:13:44 UTC
Has anyone retried after the okular rebuild? Did it get fixed?
Comment 8 Greg Grossmeier 2009-01-27 10:47:08 UTC
The original reporter to the Launchpad bug (referenced above) stated that the build in Jaunty (4:4.2.0-0ubuntu1) fixes the issue.

Unless someone else can reproduce this bug with the latest build, I'm marking it as Fixed.
Comment 9 Luka Renko 2009-01-28 00:49:36 UTC
Yes, this is fixed with new KDE 4.2 packages, so I can confirm it was just rebuild issue.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.