Bug 311238 - Crash when zooming 400% on PDF
Summary: Crash when zooming 400% on PDF
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-06 03:19 UTC by Christoph Feck
Modified: 2012-12-12 22:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
PDF that causes crash (206.02 KB, application/pdf)
2012-12-06 03:20 UTC, Christoph Feck
Details
Naïve patch (679 bytes, patch)
2012-12-12 21:36 UTC, Albert Astals Cid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Feck 2012-12-06 03:19:03 UTC
Application: okular (0.15.90)
KDE Platform Version: 4.9.90 (Compiled from sources)
Qt Version: 4.8.4
Operating System: Linux 3.6.8-1-desktop i686
Distribution: "openSUSE 12.2 (i586)"

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

Opening attached PDF, then zooming 400% caused this crash. Poppler 0.21.1, Okular from today's master.

The crash can be reproduced every time.

-- Backtrace:
Application: Okular (okular), signal: Aborted
Using host libthread_db library "/lib/libthread_db.so.1".
[KCrash Handler]
#7  0xb7742424 in __kernel_vsyscall ()
#8  0xb56a331f in raise () from /lib/libc.so.6
#9  0xb56a4c03 in abort () from /lib/libc.so.6
#10 0xb5a4fe3e in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#11 0xb5a50039 in ?? () from /usr/lib/libQtCore.so.4
#12 0xb5a50158 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#13 0xb5a501d5 in qt_assert(char const*, char const*, int) () from /usr/lib/libQtCore.so.4
#14 0xb374ec97 in Okular::DocumentPrivate::sendGeneratorPixmapRequest (this=0x83e2040) at /local/git/KDE/graphics/okular/core/document.cpp:1104
#15 0xb37565e8 in Okular::Document::requestPixmaps (this=0x830d730, requests=..., reqOptions=...) at /local/git/KDE/graphics/okular/core/document.cpp:2603
#16 0xb3755d14 in Okular::Document::requestPixmaps (this=0x830d730, requests=...) at /local/git/KDE/graphics/okular/core/document.cpp:2497
#17 0xb3889572 in PageView::slotRequestVisiblePixmaps (this=0x844e000, newValue=1) at /local/git/KDE/graphics/okular/ui/pageview.cpp:4230
#18 0xb3886b85 in PageView::scrollTo (this=0x844e000, x=816, y=1038) at /local/git/KDE/graphics/okular/ui/pageview.cpp:3709
#19 0xb3886aaa in PageView::center (this=0x844e000, cx=1192, cy=1508) at /local/git/KDE/graphics/okular/ui/pageview.cpp:3692
#20 0xb3887f14 in PageView::slotRelayoutPages (this=0x844e000) at /local/git/KDE/graphics/okular/ui/pageview.cpp:3990
#21 0xb3888005 in PageView::delayedResizeEvent (this=0x844e000) at /local/git/KDE/graphics/okular/ui/pageview.cpp:4012
#22 0xb388bb22 in PageView::qt_static_metacall (_o=0x844e000, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=0xbffbf88c) at /local/build/KDE/graphics/okular/pageview.moc:171
#23 0xb5b859b2 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#24 0xb5bd7065 in QTimer::timeout() () from /usr/lib/libQtCore.so.4
#25 0xb5b8caa6 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/libQtCore.so.4
#26 0xb5b83784 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#27 0xb628cb9c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#28 0xb629159f in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#29 0xb6e2f156 in KApplication::notify (this=0xbffc0098, receiver=0x844a640, event=0xbffbfdd0) at /local/git/KDE/libs/kdelibs/kdeui/kernel/kapplication.cpp:311
#30 0xb5b6d65e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#31 0xb5ba1f37 in ?? () from /usr/lib/libQtCore.so.4
#32 0xb5b9efb8 in ?? () from /usr/lib/libQtCore.so.4
#33 0xb4ea47d3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#34 0xb4ea4b70 in ?? () from /usr/lib/libglib-2.0.so.0
#35 0xb4ea4c51 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#36 0xb5b9f631 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#37 0xb633e48a in ?? () from /usr/lib/libQtGui.so.4
#38 0xb5b6c12c in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#39 0xb5b6c421 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#40 0xb5b716da in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#41 0xb628aa14 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#42 0x0804fd22 in main (argc=6, argv=0xbffc01e4) at /local/git/KDE/graphics/okular/shell/main.cpp:94

Reported using DrKonqi
Comment 1 Christoph Feck 2012-12-06 03:20:36 UTC
Created attachment 75648 [details]
PDF that causes crash
Comment 2 Fabio D'Urso 2012-12-06 07:46:56 UTC
@Christoph: I can't reproduce it here. Are you doing something special (e.g. scrolling/zooming in a particular sequence)?
@Mailson: Can you have a look? Seems it's Q_ASSERT( !r->normalizedRect().isNull() ); from commit ce7d96d firing
Comment 3 Christoph Feck 2012-12-06 16:07:47 UTC
I just open it with default "Fit to Width" zoom, then change it to "400%" in toolbar. What might be unusual in my setup is the rotated screen. Okular window is 768x1024, not 1024x768.

Actually, I see that practically all PDF crash when zooming in at 400%. A single-page PDF, however, can be zoomed in to 1600% without a crash, so I doubt it is a memory issue.
Comment 4 Christoph Feck 2012-12-06 16:17:59 UTC
When disabling mentioned assert, Okular works as expected.
Comment 5 Fabio D'Urso 2012-12-06 22:56:30 UTC
Christoph sorry, my fault, I had assertions disabled. It couldn't happen :D

Mailson: I've made some tests and it seems that the failed assertion is triggered by preload requests issued by PageView.cpp lines 4172-4185 and 4204-4217. If I read the code correctly we're setting a null request rectangle if (intersectionRect.isEmpty() && !pageHasTilesManager), do we?
Comment 6 Mailson Menezes 2012-12-08 19:30:30 UTC
Fabio,

Yes you're right. The thing is, we shouldn't have that Q_ASSERT since there may be requests for non-visible pages. In that case we end up with a null normalized rect.
Comment 7 Albert Astals Cid 2012-12-08 20:10:09 UTC
I remember discussing about that assert and you guys agreed we needed it, if we don't, please remove it, though i am usunsure why a non-visible page should have the normalized rect empty, can you clarify on that?
Comment 8 Albert Astals Cid 2012-12-12 21:36:50 UTC
Created attachment 75806 [details]
Naïve patch

I'm not sure i fully understand the intent of those rects over there, but isn't this enough? If we don't have an interesection because we are just preloading a page that is not in the viewport, then well, assume we just want to preload it all and give a 0,0,1,1 normalized rect, no?

Comments? Mailson? Fabio?
Comment 9 Fabio D'Urso 2012-12-12 22:36:47 UTC
Git commit 466e402d9ee320f41ba85b39f2a5d43615860c5c by Fabio D'Urso, on behalf of Mailson Menezes.
Committed on 08/12/2012 at 20:02.
Pushed by fabiod into branch 'master'.

Remove assertion of request normalized rect

normalizedRect is null if the requested page is not visible

M  +6    -3    core/document.cpp

http://commits.kde.org/okular/466e402d9ee320f41ba85b39f2a5d43615860c5c