geometer / FBReader

Official FBReader C++ project repository
http://www.fbreader.org/
540 stars 169 forks source link

segfault while opening valid .fb2 file #226

Open md2 opened 12 years ago

md2 commented 12 years ago

FBreader 0.99.2 crashes while trying to open valid fb2 file (.fb2.zip) gdb backtrace:

(gdb) bt

#0  0x00000000004de9cc in shared_ptr<Book>::shared_ptr (this=0x7fffffff9ea0, t=...)
    at /var/tmp/portage/app-text/fbreader-0.99.2/work/fbreader-0.99.2/fbreader/../zlibrary/core/include/shared_ptr.h:196
#1  0x0000000000586100 in BookModel::book (this=0x0) at BookModel.cpp:67
#2  0x0000000000557dd4 in FBReader::currentBook (this=0x8ae540) at FBReader.cpp:546
#3  0x00000000005794b2 in BookNode::highlighted (this=0xb89c00) at BookNode.cpp:104
#4  0x00000000004ce01e in FBReaderNode::drawTitle (this=0xb89c00, context=..., vOffset=858) at FBReaderNode.cpp:115
#5  0x00000000004cf111 in FBReaderNode::paint (this=0xb89c00, context=..., vOffset=858) at FBReaderNode.cpp:261
#6  0x00007ffff78ab3e1 in ZLBlockTreeView::paint (this=0x9006d0) at ZLBlockTreeView.cpp:59
#7  0x00000000005765f0 in LibraryView::paint (this=0x9006d0) at LibraryView.cpp:41
#8  0x00007ffff7500579 in ZLQtViewWidget::Widget::paintEvent (this=0x9cb520) at ZLQtViewWidget.cpp:108
#9  0x00007ffff51203ef in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#10 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#11 0x00007ffff50d2dbd in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#12 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#13 0x00007ffff511bfb9 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#14 0x00007ffff511cc7b in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#15 0x00007ffff511bd02 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#16 0x00007ffff511cc7b in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#17 0x00007ffff511bd02 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#18 0x00007ffff52e7b93 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#19 0x00007ffff51124d0 in QWidgetPrivate::syncBackingStore() () from /usr/lib64/qt4/libQtGui.so.4
#20 0x00007ffff51208f1 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#21 0x00007ffff54e012b in QMainWindow::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#22 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#23 0x00007ffff50d2dbd in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#24 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#25 0x00007ffff485b750 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib64/qt4/libQtCore.so.4
#26 0x00007ffff48872d3 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#27 0x00007ffff385e653 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#28 0x00007ffff385e998 in ?? () from /usr/lib64/libglib-2.0.so.0
#29 0x00007ffff385ea54 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#30 0x00007ffff488746f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#31 0x00007ffff517424e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#32 0x00007ffff4856eb2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#33 0x00007ffff485716d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#34 0x00007ffff5581d0e in QDialog::exec() () from /usr/lib64/qt4/libQtGui.so.4
#35 0x00007ffff74fd109 in ZLQtProgressDialog::run (this=0x1066070, runnable=...) at ZLQtProgressDialog.cpp:54
#36 0x00007ffff785c16a in ZLDialogManager::wait (this=0x8e3810, key=..., runnable=..., network=false)
    at ZLDialogManager.cpp:98
#37 0x0000000000556654 in FBReader::openBook (this=0x8ae540, book=...) at FBReader.cpp:285
#38 0x00000000004fded3 in BookReadAction::run (this=0x106c210) at LibraryBookActions.cpp:36
#39 0x00007ffff78a8488 in ZLBlockTreeNode::onStylusPress (this=0xb8b7c0, x=178, y=54) at ZLBlockTreeNode.cpp:104
#40 0x00007ffff78ab635 in ZLBlockTreeView::onStylusPress (this=0x9006d0, x=178, y=54) at ZLBlockTreeView.cpp:104
#41 0x00007ffff75007fd in ZLQtViewWidget::Widget::mousePressEvent (this=0x9cb520, event=0x7fffffffd300)
    at ZLQtViewWidget.cpp:131
#42 0x00007ffff5120729 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#43 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#44 0x00007ffff50d369d in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#45 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#46 0x00007ffff50cf255 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/qt4/libQtGui.so.4
#47 0x00007ffff514dfd8 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#48 0x00007ffff514c689 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#49 0x00007ffff517459a in ?? () from /usr/lib64/qt4/libQtGui.so.4
#50 0x00007ffff385e653 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#51 0x00007ffff385e998 in ?? () from /usr/lib64/libglib-2.0.so.0
#52 0x00007ffff385ea54 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#53 0x00007ffff488746f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#54 0x00007ffff517424e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#55 0x00007ffff4856eb2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#56 0x00007ffff485716d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#57 0x00007ffff485bbeb in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#58 0x00007ffff7502cb5 in ZLQtLibraryImplementation::run (this=0x84a5f0, application=0x8ae540) at ZLibrary.cpp:79
#59 0x00007ffff78b6788 in ZLibrary::run (application=0x8ae540) at ZLibrary.cpp:142
#60 0x000000000055f77c in main (argc=1, argv=0x7fffffffdf78) at main.cpp:28

==================================================
(gdb) bt full

#0  0x00000000004de9cc in shared_ptr<Book>::shared_ptr (this=0x7fffffff9ea0, t=...)
    at /var/tmp/portage/app-text/fbreader-0.99.2/work/fbreader-0.99.2/fbreader/../zlibrary/core/include/shared_ptr.h:196
No locals.
#1  0x0000000000586100 in BookModel::book (this=0x0) at BookModel.cpp:67
No locals.
#2  0x0000000000557dd4 in FBReader::currentBook (this=0x8ae540) at FBReader.cpp:546
No locals.
#3  0x00000000005794b2 in BookNode::highlighted (this=0xb89c00) at BookNode.cpp:104
No locals.
#4  0x00000000004ce01e in FBReaderNode::drawTitle (this=0xb89c00, context=..., vOffset=858) at FBReaderNode.cpp:115
        style = @0xab5290
        unit = 12
        hOffset = 96
        text = <error reading variable: Cannot access memory at address 0xc0000001e>
#5  0x00000000004cf111 in FBReaderNode::paint (this=0xb89c00, context=..., vOffset=858) at FBReaderNode.cpp:261
        left = 0
        auxLeft = 10359824
#6  0x00007ffff78ab3e1 in ZLBlockTreeView::paint (this=0x9006d0) at ZLBlockTreeView.cpp:59
        h = 66
        node = 0xb89c00
        context = @0x8fbb20
        firstNodeFound = true
        vOffset = 858
        showScrollbar = false
        maxY = 976
        before = 1188
        after = 4622489
#7  0x00000000005765f0 in LibraryView::paint (this=0x9006d0) at LibraryView.cpp:41
        revision = 1
#8  0x00007ffff7500579 in ZLQtViewWidget::Widget::paintEvent (this=0x9cb520) at ZLQtViewWidget.cpp:108
        context = @0x8fbb20
        realPainter = {static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7ffff57a5960 "QPainter", 
              data = 0x7ffff57a5a00, extradata = 0x0}}, d_ptr = {d = 0x0}}
#9  0x00007ffff51203ef in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#10 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#11 0x00007ffff50d2dbd in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#12 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#13 0x00007ffff511bfb9 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#14 0x00007ffff511cc7b in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#15 0x00007ffff511bd02 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#16 0x00007ffff511cc7b in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#17 0x00007ffff511bd02 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#18 0x00007ffff52e7b93 in ?? () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#19 0x00007ffff51124d0 in QWidgetPrivate::syncBackingStore() () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#20 0x00007ffff51208f1 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#21 0x00007ffff54e012b in QMainWindow::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#22 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#23 0x00007ffff50d2dbd in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#24 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#25 0x00007ffff485b750 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#26 0x00007ffff48872d3 in ?? () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#27 0x00007ffff385e653 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#28 0x00007ffff385e998 in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#29 0x00007ffff385ea54 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#30 0x00007ffff488746f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#31 0x00007ffff517424e in ?? () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#32 0x00007ffff4856eb2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#33 0x00007ffff485716d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#34 0x00007ffff5581d0e in QDialog::exec() () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#35 0x00007ffff74fd109 in ZLQtProgressDialog::run (this=0x1066070, runnable=...) at ZLQtProgressDialog.cpp:54
        wrapper = 0x1075dd0
        dialog = 0x1009f10
#36 0x00007ffff785c16a in ZLDialogManager::wait (this=0x8e3810, key=..., runnable=..., network=false)
    at ZLDialogManager.cpp:98
        dialog = {myStorage = 0x107ab70}
#37 0x0000000000556654 in FBReader::openBook (this=0x8ae540, book=...) at FBReader.cpp:285
        runnable = {<ZLRunnable> = {_vptr.ZLRunnable = 0x5a9eb0}, myBook = {myStorage = 0x7fffe4122240}}
#38 0x00000000004fded3 in BookReadAction::run (this=0x106c210) at LibraryBookActions.cpp:36
        fbreader = @0x8ae540
#39 0x00007ffff78a8488 in ZLBlockTreeNode::onStylusPress (this=0xb8b7c0, x=178, y=54) at ZLBlockTreeNode.cpp:104
        it = {first = {Left = 200, Top = 42, Right = 295, Bottom = 54}, second = {myStorage = }}
#40 0x00007ffff78ab635 in ZLBlockTreeView::onStylusPress (this=0x9006d0, x=178, y=54) at ZLBlockTreeView.cpp:104
        node = 0xb8b7c0
#41 0x00007ffff75007fd in ZLQtViewWidget::Widget::mousePressEvent (this=0x9cb520, event=0x7fffffffd300)
    at ZLQtViewWidget.cpp:131
No locals.
#42 0x00007ffff5120729 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#43 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#44 0x00007ffff50d369d in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#45 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#46 0x00007ffff50cf255 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#47 0x00007ffff514dfd8 in ?? () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#48 0x00007ffff514c689 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#49 0x00007ffff517459a in ?? () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#50 0x00007ffff385e653 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#51 0x00007ffff385e998 in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#52 0x00007ffff385ea54 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#53 0x00007ffff488746f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#54 0x00007ffff517424e in ?? () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#55 0x00007ffff4856eb2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#56 0x00007ffff485716d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#57 0x00007ffff485bbeb in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#58 0x00007ffff7502cb5 in ZLQtLibraryImplementation::run (this=0x84a5f0, application=0x8ae540) at ZLibrary.cpp:79
No locals.
#59 0x00007ffff78b6788 in ZLibrary::run (application=0x8ae540) at ZLibrary.cpp:142
No locals.
#60 0x000000000055f77c in main (argc=1, argv=0x7fffffffdf78) at main.cpp:28
No locals.

==================================================
(gdb) thread apply all bt

Thread 2 (Thread 0x7fffebb80700 (LWP 21810)):
#0  0x00007ffff5ff553e in ?? () from /usr/lib64/libexpat.so.1
#1  0x00007ffff5fe88c5 in ?? () from /usr/lib64/libexpat.so.1
#2  0x00007ffff5fe9efe in ?? () from /usr/lib64/libexpat.so.1
#3  0x00007ffff5fee1cd in XML_ParseBuffer () from /usr/lib64/libexpat.so.1
#4  0x00007ffff788cdd1 in ZLXMLReaderInternal::parseBuffer (this=0x7fffe4049c20, 
    buffer=0x7fffe4308200 "\201обой целую философию – как достичь гармоничного слияния с тканью мира. В свое время юный Эраст Петрович был", <incomplete sequence \320>..., len=2048) at ZLXMLReaderInternal.cpp:165
#5  0x00007ffff7887409 in ZLXMLReader::readFromBuffer (this=0x7fffebb7fad0, 
    data=0x7fffe4308200 "\201обой целую философию – как достичь гармоничного слияния с тканью мира. В свое время юный Эраст Петрович был", <incomplete sequence \320>..., len=2048) at ZLXMLReader.cpp:137
#6  0x00007ffff78872c4 in ZLXMLReader::readDocument (this=0x7fffebb7fad0, stream=...) at ZLXMLReader.cpp:114
#7  0x00007ffff78870ad in ZLXMLReader::readDocument (this=0x7fffebb7fad0, file=...) at ZLXMLReader.cpp:89
#8  0x00000000004c16ff in FB2BookReader::readBook (this=0x7fffebb7fad0) at FB2BookReader.cpp:335
#9  0x00000000004c009a in FB2Plugin::readModel (this=0x7fffe4004060, model=...) at FB2Plugin.cpp:39
#10 0x0000000000585dad in BookModel::BookModel (this=0x7fffe40f1160, book=...) at BookModel.cpp:34
#11 0x0000000000556873 in FBReader::openBookInternal (this=0x8ae540, book=...) at FBReader.cpp:303
#12 0x000000000055866f in OpenBookRunnable::run (this=0x7fffffffc6c0) at FBReader.cpp:277
#13 0x00007ffff74fd4d3 in ZLQtRunnableWrapper::run (this=0x1075dd0) at ZLQtProgressDialog.cpp:96
#14 0x00007ffff4749848 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#15 0x00007ffff47552db in ?? () from /usr/lib64/qt4/libQtCore.so.4
#16 0x00007ffff6632da6 in start_thread () from /lib64/libpthread.so.0
#17 0x00007ffff6933abd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7ffff7fcf780 (LWP 21807)):
#0  0x00000000004de9cc in shared_ptr<Book>::shared_ptr (this=0x7fffffff9ea0, t=...)
    at /var/tmp/portage/app-text/fbreader-0.99.2/work/fbreader-0.99.2/fbreader/../zlibrary/core/include/shared_ptr.h:196
#1  0x0000000000586100 in BookModel::book (this=0x0) at BookModel.cpp:67
#2  0x0000000000557dd4 in FBReader::currentBook (this=0x8ae540) at FBReader.cpp:546
#3  0x00000000005794b2 in BookNode::highlighted (this=0xb89c00) at BookNode.cpp:104
#4  0x00000000004ce01e in FBReaderNode::drawTitle (this=0xb89c00, context=..., vOffset=858) at FBReaderNode.cpp:115
#5  0x00000000004cf111 in FBReaderNode::paint (this=0xb89c00, context=..., vOffset=858) at FBReaderNode.cpp:261
#6  0x00007ffff78ab3e1 in ZLBlockTreeView::paint (this=0x9006d0) at ZLBlockTreeView.cpp:59
#7  0x00000000005765f0 in LibraryView::paint (this=0x9006d0) at LibraryView.cpp:41
#8  0x00007ffff7500579 in ZLQtViewWidget::Widget::paintEvent (this=0x9cb520) at ZLQtViewWidget.cpp:108
#9  0x00007ffff51203ef in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#10 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#11 0x00007ffff50d2dbd in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#12 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#13 0x00007ffff511bfb9 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#14 0x00007ffff511cc7b in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#15 0x00007ffff511bd02 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#16 0x00007ffff511cc7b in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#17 0x00007ffff511bd02 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#18 0x00007ffff52e7b93 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#19 0x00007ffff51124d0 in QWidgetPrivate::syncBackingStore() () from /usr/lib64/qt4/libQtGui.so.4
#20 0x00007ffff51208f1 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#21 0x00007ffff54e012b in QMainWindow::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#22 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#23 0x00007ffff50d2dbd in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#24 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#25 0x00007ffff485b750 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib64/qt4/libQtCore.so.4
#26 0x00007ffff48872d3 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#27 0x00007ffff385e653 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#28 0x00007ffff385e998 in ?? () from /usr/lib64/libglib-2.0.so.0
#29 0x00007ffff385ea54 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#30 0x00007ffff488746f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#31 0x00007ffff517424e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#32 0x00007ffff4856eb2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#33 0x00007ffff485716d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#34 0x00007ffff5581d0e in QDialog::exec() () from /usr/lib64/qt4/libQtGui.so.4
#35 0x00007ffff74fd109 in ZLQtProgressDialog::run (this=0x1066070, runnable=...) at ZLQtProgressDialog.cpp:54
#36 0x00007ffff785c16a in ZLDialogManager::wait (this=0x8e3810, key=..., runnable=..., network=false)
    at ZLDialogManager.cpp:98
#37 0x0000000000556654 in FBReader::openBook (this=0x8ae540, book=...) at FBReader.cpp:285
#38 0x00000000004fded3 in BookReadAction::run (this=0x106c210) at LibraryBookActions.cpp:36
#39 0x00007ffff78a8488 in ZLBlockTreeNode::onStylusPress (this=0xb8b7c0, x=178, y=54) at ZLBlockTreeNode.cpp:104
#40 0x00007ffff78ab635 in ZLBlockTreeView::onStylusPress (this=0x9006d0, x=178, y=54) at ZLBlockTreeView.cpp:104
#41 0x00007ffff75007fd in ZLQtViewWidget::Widget::mousePressEvent (this=0x9cb520, event=0x7fffffffd300)
    at ZLQtViewWidget.cpp:131
#42 0x00007ffff5120729 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#43 0x00007ffff50ce2b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#44 0x00007ffff50d369d in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#45 0x00007ffff485815c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#46 0x00007ffff50cf255 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/qt4/libQtGui.so.4
#47 0x00007ffff514dfd8 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#48 0x00007ffff514c689 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#49 0x00007ffff517459a in ?? () from /usr/lib64/qt4/libQtGui.so.4
#50 0x00007ffff385e653 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#51 0x00007ffff385e998 in ?? () from /usr/lib64/libglib-2.0.so.0
#52 0x00007ffff385ea54 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#53 0x00007ffff488746f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#54 0x00007ffff517424e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#55 0x00007ffff4856eb2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#56 0x00007ffff485716d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/qt4/libQtCore.so.4
#57 0x00007ffff485bbeb in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#58 0x00007ffff7502cb5 in ZLQtLibraryImplementation::run (this=0x84a5f0, application=0x8ae540) at ZLibrary.cpp:79
#59 0x00007ffff78b6788 in ZLibrary::run (application=0x8ae540) at ZLibrary.cpp:142
#60 0x000000000055f77c in main (argc=1, argv=0x7fffffffdf78) at main.cpp:28
A debugging session is active.

    Inferior 1 [process 21807] will be killed.

Quit anyway? (y or n) 

The issue seems to be related with contents of ~/Books directory. I've narrowed ~/Books contents to two .fb2.zip files. When these files are both present in ~/Books, I observe above crash when opening a book (with a fresh config; before I run fbreader I rm -r ~/.FBReader directory); when ~/Books contains only one of them, there are no crashes.

geometer commented 12 years ago

Could you please send me the file?

md2 commented 12 years ago

Sent. Subject is "Issue #226". How to reproduce the issue: $ mv ~/Books ~/Books.orig $ mkdir ~/Books $ rm -r ~/.FBReader Copy those two files to ~/Books $ fbreader Now

  1. Press first icon on the toolbar to go to the library.
  2. Open one of the books
  3. Go to the library
  4. Open another book
  5. Repeat from 1.

It takes several iterations for FBReader to crash.

md2 commented 12 years ago

My version of expat is 2.1.0-r2

md2 commented 11 years ago

I've fixed this annoying bug at last, I believe. Here's the patch:

diff -Naur fbreader-0.99.4.orig/fbreader/src/fbreader/FBReader.cpp fbreader-0.99.4/fbreader/src/fbreader/FBReader.cpp
--- fbreader-0.99.4.orig/fbreader/src/fbreader/FBReader.cpp 2013-02-16 10:19:04.635087381 +0700
+++ fbreader-0.99.4/fbreader/src/fbreader/FBReader.cpp  2013-02-16 10:18:52.384100608 +0700
@@ -298,7 +298,6 @@
        bookTextView.setModel(0, 0);
        bookTextView.setContentsModel(0);
        contentsView.setModel(0);
-       myModel.reset();
        myModel = new BookModel(book);
        ZLTextHyphenator::Instance().load(book->language());
        bookTextView.setModel(myModel->bookTextModel(), book);

What happens here? myModel shared pointer resets to null pointer, and next line a new BookModel assigned to it. But in between myModel.reset() and assigning new value to myModel BookNode::highlighted() is called, which calls FBReader::currentBook(), which uses myModel, that is null now.