Bug 367925 - kbibtex crash after reloading bib file
Summary: kbibtex crash after reloading bib file
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: General (other bugs)
Version First Reported In: 0.6
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2016-08-28 14:32 UTC by Nico Kruber
Modified: 2016-11-26 21:53 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Kruber 2016-08-28 14:32:50 UTC
Application: kbibtex (0.6)
KDE Platform Version: 4.14.23
Qt Version: 4.8.6
Operating System: Linux 4.7.2-2-default x86_64
Distribution: "openSUSE Leap 42.1 (x86_64)"

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

I had KBibtex open and changed the file in background (with kwrite), saved it and kbibtex showed the file-changed dialogue. I let it reload the file and it seamed to reload correctly but it crashed when I wanted to filter the entries

-- Backtrace:
Application: KBibTeX (kbibtex), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f8111551780 (LWP 6288))]

Thread 5 (Thread 0x7f80ab1af700 (LWP 6294)):
#0  0x00007f810902bd14 in g_mutex_unlock (mutex=0x7f80a40009a0) at gthread-posix.c:1348
#1  0x00007f8108fe8f20 in g_main_context_acquire (context=0x7f80a40009a0) at gmain.c:3196
#2  0x00007f8108fe9d25 in g_main_context_iterate (context=context@entry=0x7f80a40009a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3758
#3  0x00007f8108fe9f7c in g_main_context_iteration (context=0x7f80a40009a0, may_block=1) at gmain.c:3869
#4  0x00007f810bd39fde in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7f80a40008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:452
#5  0x00007f810bd0bd4f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7f80ab1aee20, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f810bd0c045 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7f80ab1aee20, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f810bc094df in QThread::exec() (this=this@entry=0x3bbed80) at thread/qthread.cpp:538
#8  0x00007f810bced653 in QInotifyFileSystemWatcherEngine::run() (this=0x3bbed80) at io/qfilesystemwatcher_inotify.cpp:265
#9  0x00007f810bc0bbbf in QThreadPrivate::start(void*) (arg=0x3bbed80) at thread/qthread_unix.cpp:349
#10 0x00007f810823f0a4 in start_thread (arg=0x7f80ab1af700) at pthread_create.c:309
#11 0x00007f810b54302d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7f80b0aa8700 (LWP 6291)):
#0  0x00007f810b53abfd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f8108fe9e64 in g_main_context_iterate (priority=2147483647, n_fds=1, fds=0x7f80ac0013e0, timeout=9878, context=0x7f80ac0009a0) at gmain.c:4103
#2  0x00007f8108fe9e64 in g_main_context_iterate (context=context@entry=0x7f80ac0009a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3803
#3  0x00007f8108fe9f7c in g_main_context_iteration (context=0x7f80ac0009a0, may_block=1) at gmain.c:3869
#4  0x00007f810bd39fde in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7f80ac0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:452
#5  0x00007f810bd0bd4f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7f80b0aa7e60, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f810bd0c045 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7f80b0aa7e60, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f810bc094df in QThread::exec() (this=<optimized out>) at thread/qthread.cpp:538
#8  0x00007f810bc0bbbf in QThreadPrivate::start(void*) (arg=0x2d4adf0) at thread/qthread_unix.cpp:349
#9  0x00007f810823f0a4 in start_thread (arg=0x7f80b0aa8700) at pthread_create.c:309
#10 0x00007f810b54302d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7f80b9954700 (LWP 6290)):
#0  0x00007f810824303f in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f811061cb3d in JSC::BlockAllocator::blockFreeingThreadMain() () at /usr/lib64/libQtWebKit.so.4
#2  0x00007f81108d1a06 in WTF::wtfThreadEntryPoint(void*) () at /usr/lib64/libQtWebKit.so.4
#3  0x00007f810823f0a4 in start_thread (arg=0x7f80b9954700) at pthread_create.c:309
#4  0x00007f810b54302d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f80fa257700 (LWP 6289)):
#0  0x00007f810824303f in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f81108a9eb6 in WTF::TCMalloc_PageHeap::scavengerThread() () at /usr/lib64/libQtWebKit.so.4
#2  0x00007f81108a9ee9 in  () at /usr/lib64/libQtWebKit.so.4
#3  0x00007f810823f0a4 in start_thread (arg=0x7f80fa257700) at pthread_create.c:309
#4  0x00007f810b54302d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f8111551780 (LWP 6288)):
[KCrash Handler]
#6  0x00007f810df4a152 in QHash<QString, QVariant>::findNode(QString const&, unsigned int*) const (this=this@entry=0x4017f70, akey=..., ahp=ahp@entry=0x0) at /usr/include/QtCore/qhash.h:884
#7  0x00007f810df49235 in File::property(QString const&) const (akey=..., this=0x4017f70) at /usr/include/QtCore/qhash.h:874
#8  0x00007f810df49235 in File::property(QString const&) const (this=0x33104c0, key=...) at /usr/src/debug/kbibtex-0.6/src/data/file.cpp:213
#9  0x00007f810e8c1aa2 in FieldLineEdit::FieldLineEditPrivate::reset(Value const&) (text=..., this=0x3810d20) at /usr/src/debug/kbibtex-0.6/src/gui/field/fieldlineedit.cpp:387
#10 0x00007f810e8c1aa2 in FieldLineEdit::FieldLineEditPrivate::reset(Value const&) (this=0x3810d20, value=...) at /usr/src/debug/kbibtex-0.6/src/gui/field/fieldlineedit.cpp:151
#11 0x00007f810e8be6c9 in FieldLineEdit::reset(Value const&) (this=<optimized out>, value=...) at /usr/src/debug/kbibtex-0.6/src/gui/field/fieldlineedit.cpp:425
#12 0x00007f810e8bb540 in FieldInput::reset(Value const&) (value=..., this=0x3807d10) at /usr/src/debug/kbibtex-0.6/src/gui/field/fieldinput.cpp:155
#13 0x00007f810e8bb540 in FieldInput::reset(Value const&) (this=this@entry=0x38073d0, value=...) at /usr/src/debug/kbibtex-0.6/src/gui/field/fieldinput.cpp:290
#14 0x00007f810e8bb981 in FieldInput::setMonth(int) (this=0x38073d0, month=<optimized out>) at /usr/src/debug/kbibtex-0.6/src/gui/field/fieldinput.cpp:339
#15 0x00007f810bd210fa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x3816c40, m=m@entry=0x7f810c06ec60 <QSignalMapper::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffeefa8e4b0) at kernel/qobject.cpp:3576
#16 0x00007f810bd2881e in QSignalMapper::mapped(int) (this=this@entry=0x3816c40, _t1=9) at .moc/release-shared/moc_qsignalmapper.cpp:114
#17 0x00007f810bd28926 in QSignalMapper::map(QObject*) (this=0x3816c40, sender=0x3819a80) at kernel/qsignalmapper.cpp:266
#18 0x00007f810bd210fa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x3819a80, m=m@entry=0x7f810ccf54a0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffeefa8e620) at kernel/qobject.cpp:3576
#19 0x00007f810c24c652 in QAction::triggered(bool) (this=this@entry=0x3819a80, _t1=false) at .moc/release-shared/moc_qaction.cpp:276
#20 0x00007f810c24e003 in QAction::activate(QAction::ActionEvent) (this=this@entry=0x3819a80, event=event@entry=QAction::Trigger) at kernel/qaction.cpp:1257
#21 0x00007f810c677399 in QMenuPrivate::activateCausedStack(QList<QPointer<QWidget> > const&, QAction*, QAction::ActionEvent, bool) (this=this@entry=0x3816e00, causedStack=..., action=action@entry=0x3819a80, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1037
#22 0x00007f810c67b8e9 in QMenuPrivate::activateAction(QAction*, QAction::ActionEvent, bool) (this=0x3816e00, action=0x3819a80, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1129
#23 0x00007f810c2a1c5a in QWidget::event(QEvent*) (this=this@entry=0x3816dd0, event=event@entry=0x7ffeefa8ec60) at kernel/qwidget.cpp:8389
#24 0x00007f810c67f73b in QMenu::event(QEvent*) (this=0x3816dd0, e=0x7ffeefa8ec60) at widgets/qmenu.cpp:2480
#25 0x00007f810c25279c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x2bd5140, receiver=receiver@entry=0x3816dd0, e=e@entry=0x7ffeefa8ec60) at kernel/qapplication.cpp:4565
#26 0x00007f810c258e1a in QApplication::notify(QObject*, QEvent*) (this=this@entry=0x7ffeefa901e0, receiver=receiver@entry=0x3816dd0, e=e@entry=0x7ffeefa8ec60) at kernel/qapplication.cpp:4108
#27 0x00007f810d674e3a in KApplication::notify(QObject*, QEvent*) (this=0x7ffeefa901e0, receiver=0x3816dd0, event=0x7ffeefa8ec60) at /usr/src/debug/kdelibs-4.14.23/kdeui/kernel/kapplication.cpp:311
#28 0x00007f810bd0d18d in QCoreApplication::notifyInternal(QObject*, QEvent*) (this=0x7ffeefa901e0, receiver=receiver@entry=0x3816dd0, event=event@entry=0x7ffeefa8ec60) at kernel/qcoreapplication.cpp:953
#29 0x00007f810c258613 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#30 0x00007f810c258613 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (receiver=receiver@entry=0x3816dd0, event=event@entry=0x7ffeefa8ec60, alienWidget=alienWidget@entry=0x0, nativeWidget=nativeWidget@entry=0x3816dd0, buttonDown=buttonDown@entry=0x7f810cd31298 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:3173
#31 0x00007f810c2ca01c in QETWidget::translateMouseEvent(_XEvent const*) (this=this@entry=0x3816dd0, event=event@entry=0x7ffeefa8efa0) at kernel/qapplication_x11.cpp:4464
#32 0x00007f810c2c875c in QApplication::x11ProcessEvent(_XEvent*) (this=0x7ffeefa901e0, event=event@entry=0x7ffeefa8efa0) at kernel/qapplication_x11.cpp:3653
#33 0x00007f810c2ef5f2 in x11EventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x2bdc090, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#34 0x00007f8108fe9c84 in g_main_context_dispatch (context=0x2bd0530) at gmain.c:3122
#35 0x00007f8108fe9c84 in g_main_context_dispatch (context=context@entry=0x2bd0530) at gmain.c:3737
#36 0x00007f8108fe9ed8 in g_main_context_iterate (context=context@entry=0x2bd0530, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
#37 0x00007f8108fe9f7c in g_main_context_iteration (context=0x2bd0530, may_block=1) at gmain.c:3869
#38 0x00007f810bd39fbe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x2bbecf0, flags=...) at kernel/qeventdispatcher_glib.cpp:450
#39 0x00007f810c2ef6a6 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#40 0x00007f810bd0bd4f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffeefa8f380, flags=...) at kernel/qeventloop.cpp:149
#41 0x00007f810bd0c045 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffeefa8f380, flags=...) at kernel/qeventloop.cpp:204
#42 0x00007f810c67e4a7 in QMenu::exec(QPoint const&, QAction*) (this=0x3816dd0, p=..., action=action@entry=0x0) at widgets/qmenu.cpp:2124
#43 0x00007f810c688b6f in QPushButtonPrivate::_q_popupPressed() (this=0x3814bb0) at widgets/qpushbutton.cpp:592
#44 0x00007f810bd210fa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x3814020, m=m@entry=0x7f810cd1f1e0 <QAbstractButton::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3576
#45 0x00007f810c89b3e0 in QAbstractButton::pressed() (this=this@entry=0x3814020) at .moc/release-shared/moc_qabstractbutton.cpp:206
#46 0x00007f810c5ff866 in QAbstractButtonPrivate::emitPressed() (this=this@entry=0x3814bb0) at widgets/qabstractbutton.cpp:562
#47 0x00007f810c5ffe0c in QAbstractButton::mousePressEvent(QMouseEvent*) (this=0x3814020, e=0x7ffeefa8f9a0) at widgets/qabstractbutton.cpp:1098
#48 0x00007f810c2a1acb in QWidget::event(QEvent*) (this=0x3814020, event=0x7ffeefa8f9a0) at kernel/qwidget.cpp:8385
#49 0x00007f810c25279c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x2bd5140, receiver=receiver@entry=0x3814020, e=e@entry=0x7ffeefa8f9a0) at kernel/qapplication.cpp:4565
#50 0x00007f810c258e1a in QApplication::notify(QObject*, QEvent*) (this=this@entry=0x7ffeefa901e0, receiver=receiver@entry=0x3814020, e=e@entry=0x7ffeefa8f9a0) at kernel/qapplication.cpp:4108
#51 0x00007f810d674e3a in KApplication::notify(QObject*, QEvent*) (this=0x7ffeefa901e0, receiver=0x3814020, event=0x7ffeefa8f9a0) at /usr/src/debug/kdelibs-4.14.23/kdeui/kernel/kapplication.cpp:311
#52 0x00007f810bd0d18d in QCoreApplication::notifyInternal(QObject*, QEvent*) (this=0x7ffeefa901e0, receiver=receiver@entry=0x3814020, event=event@entry=0x7ffeefa8f9a0) at kernel/qcoreapplication.cpp:953
#53 0x00007f810c258613 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#54 0x00007f810c258613 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (receiver=receiver@entry=0x3814020, event=event@entry=0x7ffeefa8f9a0, alienWidget=alienWidget@entry=0x3814020, nativeWidget=nativeWidget@entry=0x377a8a0, buttonDown=buttonDown@entry=0x7f810cd31298 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:3173
#55 0x00007f810c2c9ceb in QETWidget::translateMouseEvent(_XEvent const*) (this=this@entry=0x377a8a0, event=event@entry=0x7ffeefa8fd10) at kernel/qapplication_x11.cpp:4530
#56 0x00007f810c2c875c in QApplication::x11ProcessEvent(_XEvent*) (this=0x7ffeefa901e0, event=event@entry=0x7ffeefa8fd10) at kernel/qapplication_x11.cpp:3653
#57 0x00007f810c2ef5f2 in x11EventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x2bdc090, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#58 0x00007f8108fe9c84 in g_main_context_dispatch (context=0x2bd0530) at gmain.c:3122
#59 0x00007f8108fe9c84 in g_main_context_dispatch (context=context@entry=0x2bd0530) at gmain.c:3737
#60 0x00007f8108fe9ed8 in g_main_context_iterate (context=context@entry=0x2bd0530, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
#61 0x00007f8108fe9f7c in g_main_context_iteration (context=0x2bd0530, may_block=1) at gmain.c:3869
#62 0x00007f810bd39fbe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x2bbecf0, flags=...) at kernel/qeventdispatcher_glib.cpp:450
#63 0x00007f810c2ef6a6 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#64 0x00007f810bd0bd4f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffeefa900e0, flags=...) at kernel/qeventloop.cpp:149
#65 0x00007f810bd0c045 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffeefa900e0, flags=...) at kernel/qeventloop.cpp:204
#66 0x00007f810bd11499 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1225
#67 0x00007f810c250f6c in QApplication::exec() () at kernel/qapplication.cpp:3823
#68 0x000000000041ac47 in main(int, char**) (argc=<optimized out>, argv=0x7ffeefa90318) at /usr/src/debug/kbibtex-0.6/src/program/program.cpp:70

Reported using DrKonqi
Comment 1 Thomas Fischer 2016-08-29 08:04:05 UTC
I can reproduce the crash, although not when filtering the results, but when closing KBibTeX.
Comment 2 Thomas Fischer 2016-08-29 20:30:42 UTC
I prepared a potential fix for this crash. It is not (yet) in KBibTeX's main repository but in my personal one: http://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/06be489a73b57ad06038d604a434adc26c2a3e52
Please test if this commit fixes your problem.
Comment 3 Thomas Fischer 2016-09-09 17:28:15 UTC
> Please test if this commit fixes your problem.
Have you managed to test if the commit fixes your problem? I am planning to make a release of KBibTeX 0.6.1 and would like to see this bug fixed and closed.
Comment 4 Thomas Fischer 2016-11-26 21:53:37 UTC
Git commit 90a55671b0e5f7b4d186367871c20cf3b902129f by Thomas Fischer.
Committed on 24/11/2016 at 21:04.
Pushed by thomasfischer into branch 'kbibtex/0.6'.

Fixing crash when open file got modified externally

Fixing a crash that would happen when closing a file or KBibTeX
or when changing the filter criteria (depending on bug reporter),
but only if file was modified externally (e.g. in KWrite/Kate)
and the file monitor in KBibTeX detected this modification and
the user confirmed to reload the affected file.

This commit refactors the FileSettings dock/panel to not use a
potentially stale File object, but to retrieve an always(?)
current File object from the currently shown central FileView.

M  +0    -10   src/gui/widgets/filesettingswidget.cpp
M  +0    -2    src/gui/widgets/filesettingswidget.h
M  +13   -15   src/program/docklets/filesettings.cpp
M  +2    -3    src/program/docklets/filesettings.h

https://commits.kde.org/kbibtex/90a55671b0e5f7b4d186367871c20cf3b902129f