Bug 322919 - Crash on exit while PDF file is updated
Summary: Crash on exit while PDF file is updated
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.17.1
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-28 17:52 UTC by auxsvr
Modified: 2013-10-01 17:25 UTC (History)
3 users (show)

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


Attachments
Large tex document (1.28 MB, application/x-xz)
2013-08-03 18:20 UTC, auxsvr
Details
New crash information added by DrKonqi (5.09 KB, text/plain)
2013-09-16 15:05 UTC, Jiri Slaby
Details

Note You need to log in before you can comment on or make changes to this bug.
Description auxsvr 2013-07-28 17:52:39 UTC
Application: okular (0.16.97)
KDE Platform Version: 4.10.97
Qt Version: 4.8.4
Operating System: Linux 3.7.10-1.16-desktop i686
Distribution: "openSUSE 12.3 (i586)"

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

Okular crashes if I close it during update of the PDF file it was displaying, which is the output of a tex file.

The crash can be reproduced every time.

-- Backtrace:
Application: Okular (okular), signal: Segmentation fault
Using host libthread_db library "/lib/libthread_db.so.1".
[KCrash Handler]
#6  0x00000000 in ?? ()
#7  0xb3522a84 in TOCModelPrivate::~TOCModelPrivate (this=0xb8bc418, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.10.97/ui/tocmodel.cpp:108
#8  0xb3522b01 in TOCModel::~TOCModel (this=0xbdb1348, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.10.97/ui/tocmodel.cpp:169
#9  0xb3522b42 in TOCModel::~TOCModel (this=0xbdb1348, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.10.97/ui/tocmodel.cpp:170
#10 0xb6067709 in QObjectPrivate::deleteChildren (this=0x92f39a0) at kernel/qobject.cpp:1916
#11 0xb663bd78 in QWidget::~QWidget (this=0x931b060, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1681
#12 0xb6a525af in QFrame::~QFrame (this=0x931b060, __in_chrg=<optimized out>) at widgets/qframe.cpp:240
#13 0xb6ae4248 in QAbstractScrollArea::~QAbstractScrollArea (this=0x931b060, __in_chrg=<optimized out>) at widgets/qabstractscrollarea.cpp:521
#14 0xb6b81cfe in QAbstractItemView::~QAbstractItemView (this=0x931b060, __in_chrg=<optimized out>) at itemviews/qabstractitemview.cpp:598
#15 0xb6bc5fbf in QTreeView::~QTreeView (this=0x931b060, __in_chrg=<optimized out>) at itemviews/qtreeview.cpp:207
#16 0xb6bc6002 in QTreeView::~QTreeView (this=0x931b060, __in_chrg=<optimized out>) at itemviews/qtreeview.cpp:209
#17 0xb6067709 in QObjectPrivate::deleteChildren (this=0x8fb04c8) at kernel/qobject.cpp:1916
#18 0xb663bd78 in QWidget::~QWidget (this=0x8fb17d8, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1681
#19 0xb35203fc in TOC::~TOC (this=0x8fb17d8, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.10.97/ui/toc.cpp:55
#20 0xb3520452 in TOC::~TOC (this=0x8fb17d8, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.10.97/ui/toc.cpp:58
#21 0xb34906c8 in Okular::Part::~Part (this=this@entry=0x8f42cd8, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/okular-4.10.97/part.cpp:838
#22 0xb34909b2 in Okular::Part::~Part (this=0x8f42cd8, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/okular-4.10.97/part.cpp:863
#23 0xb6067709 in QObjectPrivate::deleteChildren (this=0x8e9a7a0) at kernel/qobject.cpp:1916
#24 0xb663bd78 in QWidget::~QWidget (this=0x8f07c88, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1681
#25 0xb6a6ddaf in QMainWindow::~QMainWindow (this=0x8f07c88, __in_chrg=<optimized out>) at widgets/qmainwindow.cpp:388
#26 0xb72470f1 in KMainWindow::~KMainWindow (this=0x8f07c88, __in_chrg=<optimized out>) at /usr/src/debug/kdelibs-4.10.97/kdeui/widgets/kmainwindow.cpp:467
#27 0xb728ee4c in KXmlGuiWindow::~KXmlGuiWindow (this=0x8f07c88, __vtt_parm=0x80546a8 <VTT for Shell+8>, __in_chrg=<optimized out>) at /usr/src/debug/kdelibs-4.10.97/kdeui/xmlgui/kxmlguiwindow.cpp:118
#28 0xb76b87c9 in KParts::MainWindow::~MainWindow (this=0x8f07c88, __vtt_parm=0x80546a4 <VTT for Shell+4>, __in_chrg=<optimized out>) at /usr/src/debug/kdelibs-4.10.97/kparts/mainwindow.cpp:76
#29 0x08052718 in Shell::~Shell (this=0x8f07c88, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/okular-4.10.97/shell/shell.cpp:151
#30 0x080527b0 in Shell::~Shell (this=0x8f07c88, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/okular-4.10.97/shell/shell.cpp:161
#31 0xb6067433 in qDeleteInEventHandler (o=o@entry=0x8f07c88) at kernel/qobject.cpp:4278
#32 0xb6069bd0 in QObject::event (this=0x8f07c88, e=0x8ff7470) at kernel/qobject.cpp:1184
#33 0xb6641b3a in QWidget::event (this=0x8f07c88, event=0x8ff7470) at kernel/qwidget.cpp:8845
#34 0xb6a7018c in QMainWindow::event (this=0x8f07c88, event=0x8ff7470) at widgets/qmainwindow.cpp:1478
#35 0xb7246dd4 in KMainWindow::event (this=0x8f07c88, ev=0x8ff7470) at /usr/src/debug/kdelibs-4.10.97/kdeui/widgets/kmainwindow.cpp:1084
#36 0xb728e992 in KXmlGuiWindow::event (this=0x8f07c88, ev=0x8ff7470) at /usr/src/debug/kdelibs-4.10.97/kdeui/xmlgui/kxmlguiwindow.cpp:126
#37 0xb65e8bac in QApplicationPrivate::notify_helper (this=0x8d94808, receiver=0x8f07c88, e=0x8ff7470) at kernel/qapplication.cpp:4562
#38 0xb65ed635 in QApplication::notify (this=0x8d94808, receiver=0x8f07c88, e=0x8ff7470) at kernel/qapplication.cpp:4423
#39 0xb71713c1 in KApplication::notify (this=0xbff11c44, receiver=0x8f07c88, event=0x8ff7470) at /usr/src/debug/kdelibs-4.10.97/kdeui/kernel/kapplication.cpp:311
#40 0xb60538ce in QCoreApplication::notifyInternal (this=0xbff11c44, receiver=0x8f07c88, event=0x8ff7470) at kernel/qcoreapplication.cpp:946
#41 0xb6057621 in sendEvent (event=<optimized out>, receiver=<optimized out>) at kernel/qcoreapplication.h:231
#42 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x8d72370) at kernel/qcoreapplication.cpp:1570
#43 0xb605789c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1463
#44 0xb6085714 in sendPostedEvents () at kernel/qcoreapplication.h:236
#45 postEventSourceDispatch (s=s@entry=0x8d94638) at kernel/qeventdispatcher_glib.cpp:279
#46 0xb53af8b3 in g_main_dispatch (context=0x8d946f8, context@entry=0x8d96300) at gmain.c:2715
#47 g_main_context_dispatch (context=context@entry=0x8d946f8) at gmain.c:3219
#48 0xb53afc50 in g_main_context_iterate (context=context@entry=0x8d946f8, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3290
#49 0xb53afd31 in g_main_context_iteration (context=0x8d946f8, may_block=1) at gmain.c:3351
#50 0xb6085891 in QEventDispatcherGlib::processEvents (this=0x8d759c0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#51 0xb669a4aa in QGuiEventDispatcherGlib::processEvents (this=0x8d759c0, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#52 0xb605239c in QEventLoop::processEvents (this=this@entry=0xbff11b68, flags=...) at kernel/qeventloop.cpp:149
#53 0xb6052691 in QEventLoop::exec (this=0xbff11b68, flags=...) at kernel/qeventloop.cpp:204
#54 0xb605794a in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#55 0xb65e6a24 in QApplication::exec () at kernel/qapplication.cpp:3823
#56 0x0804ef1e in main (argc=6, argv=0xbff11e94) at /usr/src/debug/okular-4.10.97/shell/main.cpp:100

Reported using DrKonqi
Comment 1 Albert Astals Cid 2013-07-28 22:02:56 UTC
I guess it's a latex file that takes "a while" to generate, right? Or can you also reproduce with "very simple" latex files?
Comment 2 auxsvr 2013-08-01 17:58:47 UTC
In order to reproduce this the PDF file must take so long to generate, that "Reloading the document..." is displayed while attempting to close okular. For small latex files the window of opportunity is too short.
Comment 3 Albert Astals Cid 2013-08-01 20:25:26 UTC
I don't have such a big latex file, can you provide one to us to help reproduce the problem?
Comment 4 auxsvr 2013-08-03 18:20:19 UTC
Created attachment 81546 [details]
Large tex document
Comment 5 Albert Astals Cid 2013-08-05 22:15:35 UTC
I'm getting

! fontspec error: "font-not-found"
! 
! The font "Minion Pro" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.

Do you have any clue how to install that font on Ubuntu or maybe you can use a different font?

Sorry i'm a tex noob
Comment 6 Yuri Chornoivan 2013-08-06 05:43:34 UTC
(In reply to comment #5)
> I'm getting
> 
> ! fontspec error: "font-not-found"
> ! 
> ! The font "Minion Pro" cannot be found.
> ! 
> ! See the fontspec documentation for further information.
> ! 
> ! For immediate help type H <return>.
> 
> Do you have any clue how to install that font on Ubuntu or maybe you can use
> a different font?
> 
> Sorry i'm a tex noob

It is enough to copy Minion Pro and Myriad Pro (*.otf) fonts from Adobe Reader Linux distribution to /usr/share/fonts/OTF (I can send you an archive with them if you need it) then run xelatex.
Comment 7 Albert Astals Cid 2013-08-17 15:27:18 UTC
Valgrind says 

==23131== Invalid read of size 8
==23131==    at 0x17D258BB: TOCModelPrivate::~TOCModelPrivate() (tocmodel.cpp:108)
==23131==    by 0x17D2591B: TOCModel::~TOCModel() (tocmodel.cpp:169)
==23131==    by 0x17D25938: TOCModel::~TOCModel() (tocmodel.cpp:170)
==23131==    by 0x7095307: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQtCore.so.4.8.4)
==23131==    by 0x5FA6B36: QWidget::~QWidget() (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.4)
==23131==    by 0x648B008: QTreeView::~QTreeView() (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.4)
==23131==    by 0x7095307: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQtCore.so.4.8.4)
==23131==    by 0x5FA6B36: QWidget::~QWidget() (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.4)
==23131==    by 0x17D23838: TOC::~TOC() (toc.cpp:58)
==23131==    by 0x17CA09E1: Okular::Part::~Part() (part.cpp:838)
==23131==    by 0x17CA0CB8: Okular::Part::~Part() (part.cpp:863)
==23131==    by 0x7095307: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQtCore.so.4.8.4)
==23131==  Address 0xedc2830 is 0 bytes inside a block of size 24 free'd
==23131==    at 0x4C2BADC: operator delete(void*) (vg_replace_malloc.c:480)
==23131==    by 0x7095307: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQtCore.so.4.8.4)
==23131==    by 0x5FA6B36: QWidget::~QWidget() (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.4)
==23131==    by 0x648B008: QTreeView::~QTreeView() (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.4)
==23131==    by 0x7095307: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQtCore.so.4.8.4)
==23131==    by 0x5FA6B36: QWidget::~QWidget() (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.4)
==23131==    by 0x17D23838: TOC::~TOC() (toc.cpp:58)
==23131==    by 0x17CA09E1: Okular::Part::~Part() (part.cpp:838)
==23131==    by 0x17CA0CB8: Okular::Part::~Part() (part.cpp:863)
==23131==    by 0x7095307: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQtCore.so.4.8.4)
==23131==    by 0x5FA6B36: QWidget::~QWidget() (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.4)
==23131==    by 0x5A1FEE4: KMainWindow::~KMainWindow() (kmainwindow.cpp:467)
Comment 8 Albert Astals Cid 2013-08-17 15:37:40 UTC
Possible solutions, make 
    TOCModel *m_oldModel;
be a QPointer so it gets automatically nulled when it's deleted or
change parentship of m_model in toc.cpp when calling setOldModelData/clearOldModelData

Both look not nice. Comments on what you guys think its less worse?
Comment 9 Jiri Slaby 2013-09-16 15:05:07 UTC
Created attachment 82340 [details]
New crash information added by DrKonqi

okular (0.17.1) on KDE Platform 4.11.1 using Qt 4.8.5

- What I was doing when the application crashed:

I just updated the pdf and moved it elsewhere. Then I tried to close okular and it crashed.

-- Backtrace (Reduced):
#7  0x00007ffcb452f971 in TOCModelPrivate::~TOCModelPrivate (this=0x23615a0, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.11.1/ui/tocmodel.cpp:108
#8  0x00007ffcb452f9cc in TOCModel::~TOCModel (this=0x2353240, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.11.1/ui/tocmodel.cpp:169
#9  0x00007ffcb452f9e9 in TOCModel::~TOCModel (this=0x2353240, __in_chrg=<optimized out>) at /usr/src/debug/okular-4.11.1/ui/tocmodel.cpp:170
#10 0x00007ffcc6ccc672 in QObjectPrivate::deleteChildren (this=0x1f2def0) at kernel/qobject.cpp:1916
#11 0x00007ffcc770d67c in QWidget::~QWidget (this=0x1dca2a0, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1679
Comment 10 Fabio D'Urso 2013-10-01 17:25:17 UTC
Git commit 68439221ea29801133586d82f19a24f8f3627a31 by Fabio D'Urso.
Committed on 01/10/2013 at 14:19.
Pushed by fabiod into branch 'KDE/4.11'.

Unparent the old TOCModel so that it doesn't get deleted twice
FIXED-IN: 4.11.3

M  +3    -0    ui/toc.cpp

http://commits.kde.org/okular/68439221ea29801133586d82f19a24f8f3627a31