Bug 258355 - KMyMoney segfaults when completing transaction directly in ledger (i.e. without transaction form)
Summary: KMyMoney segfaults when completing transaction directly in ledger (i.e. witho...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 254607 258557 261551 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-30 11:30 UTC by Michael Gorven
Modified: 2011-01-06 20:27 UTC (History)
4 users (show)

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


Attachments
KMyMoney data file (4.21 KB, application/octet-stream)
2010-12-04 12:55 UTC, Michael Gorven
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gorven 2010-11-30 11:30:50 UTC
Application: kmymoney (4.5.0)
KDE Platform Version: 4.5.1 (KDE 4.5.1)
Qt Version: 4.7.0
Operating System: Linux 2.6.35-22-generic x86_64
Distribution: Ubuntu 10.10

-- Information about the crash:
- What I was doing when the application crashed:
Entering a new transaction directly in the ledger. Crash occured when pressing Enter to complete the entry. Although I didn't test with this specific transaction, when it has happened in the past I have been able to reproduce by restarting KMyMoney and attempting to enter the same transaction. Enabling the transaction form and entering the same transaction always succeeds.
- Custom settings of the application:
Transaction form is disabled.

The crash can be reproduced some of the time.

-- Backtrace:
Application: KMyMoney (kmymoney), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f1634537760 (LWP 10291))]

Thread 2 (Thread 0x7f161ad7a710 (LWP 10292)):
#0  0x00007f162a0551ca in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#1  0x00007f162a0592a8 in ?? () from /lib/libglib-2.0.so.0
#2  0x00007f162a05945c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#3  0x00007f162fd561e6 in QEventDispatcherGlib::processEvents (this=0x2943ea0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:417
#4  0x00007f162fd28a02 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#5  0x00007f162fd28dec in QEventLoop::exec (this=0x7f161ad79db0, flags=) at kernel/qeventloop.cpp:201
#6  0x00007f162fc332fd in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:490
#7  0x00007f162fd085f8 in QInotifyFileSystemWatcherEngine::run (this=0x31f8ba0) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f162fc3627e in QThreadPrivate::start (arg=0x31f8ba0) at thread/qthread_unix.cpp:266
#9  0x00007f1631b5a971 in start_thread () from /lib/libpthread.so.0
#10 0x00007f162ef0a94d in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f1634537760 (LWP 10291)):
[KCrash Handler]
#6  QWidgetPrivate::setWSGeometry (this=0x4625d40, dontShow=<value optimized out>) at kernel/qwidget_x11.cpp:2425
#7  0x00007f1630732850 in QWidgetPrivate::scrollChildren (this=<value optimized out>, dx=<value optimized out>, dy=<value optimized out>) at kernel/qwidget.cpp:355
#8  0x00007f1630784e39 in QWidgetPrivate::scroll_sys (this=0x4c24420, dx=49, dy=0) at kernel/qwidget_x11.cpp:2650
#9  0x00007f1630730885 in QWidget::scroll (this=0x33375e0, dx=0, dy=6) at kernel/qwidget.cpp:10138
#10 0x00007f1630c605b6 in scrollContentsBy (this=<value optimized out>, dx=0, dy=6) at ../../include/QtGui/private/../../../src/gui/itemviews/qabstractitemview_p.h:230
#11 QTableView::scrollContentsBy (this=<value optimized out>, dx=0, dy=6) at itemviews/qtableview.cpp:1254
#12 0x00007f1630b8fd50 in QAbstractScrollArea::qt_metacall (this=0x3337120, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffe14f3ff0) at .moc/release-shared/moc_qabstractscrollarea.cpp:85
#13 0x00007f1630c350b5 in QAbstractItemView::qt_metacall (this=0x4c24420, _c=49, _id=0, _a=0x0) at .moc/release-shared/moc_qabstractitemview.cpp:213
#14 0x00007f1630c6ab35 in QTableView::qt_metacall (this=0x4c24420, _c=49, _id=0, _a=0x0) at .moc/release-shared/moc_qtableview.cpp:118
#15 0x00007f1630ca7676 in QTableWidget::qt_metacall (this=0x4c24420, _c=49, _id=0, _a=0x0) at .moc/release-shared/moc_qtablewidget.cpp:135
#16 0x0000000000742910 in KMyMoneyRegister::Register::qt_metacall (this=0x4c24420, _c=49, _id=0, _a=0x0) at /build/buildd/kmymoney-4.5/obj-x86_64-linux-gnu/kmymoney/widgets/register.moc:143
#17 0x00007f162fd41b27 in QMetaObject::activate (sender=0x3334f80, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x0) at kernel/qobject.cpp:3280
#18 0x00007f1630dbd9ee in QAbstractSlider::valueChanged (this=0x4c24420, _t1=816) at .moc/release-shared/moc_qabstractslider.cpp:182
#19 0x00007f1630c5f0b6 in QTableView::updateGeometries (this=0x3337120) at itemviews/qtableview.cpp:2110
#20 0x00007f1630c2b929 in QAbstractItemView::doItemsLayout (this=0x3337120) at itemviews/qabstractitemview.cpp:1139
#21 0x00007f1630c614d6 in executePostedLayout (this=0x3337120, pos=...) at ../../include/QtGui/private/../../../src/gui/itemviews/qabstractitemview_p.h:212
#22 QTableView::indexAt (this=0x3337120, pos=...) at itemviews/qtableview.cpp:1464
#23 0x00007f1630c3ac11 in QAbstractItemView::viewportEvent (this=0x3337120, event=0x7fffe14f48a0) at itemviews/qabstractitemview.cpp:1572
#24 0x00007f162fd29507 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value optimized out>, receiver=0x33375e0, event=0x7fffe14f48a0) at kernel/qcoreapplication.cpp:847
#25 0x00007f16306dffac in QApplicationPrivate::notify_helper (this=0x28b2560, receiver=0x33375e0, e=0x7fffe14f48a0) at kernel/qapplication.cpp:4392
#26 0x00007f16306e721c in QApplication::notify (this=<value optimized out>, receiver=<value optimized out>, e=0x7fffe14f4c20) at kernel/qapplication.cpp:3984
#27 0x00007f1632b5e156 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#28 0x00007f162fd29cdc in QCoreApplication::notifyInternal (this=0x28b24c0, receiver=0x33375e0, event=0x7fffe14f4c20) at kernel/qcoreapplication.cpp:732
#29 0x00007f16306e4dbe in sendEvent (receiver=0x33375e0, event=0x7fffe14f4c20, alienWidget=0x33375e0, nativeWidget=0x2ac1f30, buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>, spontaneous=true) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#30 QApplicationPrivate::sendMouseEvent (receiver=0x33375e0, event=0x7fffe14f4c20, alienWidget=0x33375e0, nativeWidget=0x2ac1f30, buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>, spontaneous=true) at kernel/qapplication.cpp:3058
#31 0x00007f16306e526f in QApplicationPrivate::sendSyntheticEnterLeave (this=<value optimized out>, widget=<value optimized out>) at kernel/qapplication.cpp:3144
#32 0x00007f163073a76c in QWidget::~QWidget (this=0x42c54b0, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1543
#33 0x00007f162fd3bd5f in QObjectPrivate::deleteChildren (this=0x4625d40) at kernel/qobject.cpp:1957
#34 0x00007f163073b168 in QWidget::~QWidget (this=0x4c24420, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1589
#35 0x00007f1632c6469f in KTextEdit::~KTextEdit() () from /usr/lib/libkdeui.so.5
#36 0x00007f162fd3bc08 in QObject::event (this=0x4c24420, e=0x31) at kernel/qobject.cpp:1202
#37 0x00007f16307356df in QWidget::event (this=0x4c24420, event=0x4e09710) at kernel/qwidget.cpp:8646
#38 0x00007f1630b015e6 in QFrame::event (this=0x4c24420, e=0x4e09710) at widgets/qframe.cpp:557
#39 0x00007f1630b8f71b in QAbstractScrollArea::event (this=0x4c24420, e=0x4e09710) at widgets/qabstractscrollarea.cpp:996
#40 0x00007f1630b7a815 in QTextEdit::event (this=0x4c24420, e=0x4e09710) at widgets/qtextedit.cpp:1070
#41 0x00007f16306dffdc in QApplicationPrivate::notify_helper (this=0x28b2560, receiver=0x4c24420, e=0x4e09710) at kernel/qapplication.cpp:4396
#42 0x00007f16306e5aed in QApplication::notify (this=0x28b24c0, receiver=0x4c24420, e=0x4e09710) at kernel/qapplication.cpp:4277
#43 0x00007f1632b5e156 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#44 0x00007f162fd29cdc in QCoreApplication::notifyInternal (this=0x28b24c0, receiver=0x4c24420, event=0x4e09710) at kernel/qcoreapplication.cpp:732
#45 0x00007f162fd2cc22 in sendEvent (receiver=0x0, event_type=<value optimized out>, data=0x2892380) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#46 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0x2892380) at kernel/qcoreapplication.cpp:1373
#47 0x00007f162fd56653 in sendPostedEvents (s=0x28b61a0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#48 postEventSourceDispatch (s=0x28b61a0) at kernel/qeventdispatcher_glib.cpp:277
#49 0x00007f162a055342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#50 0x00007f162a0592a8 in ?? () from /lib/libglib-2.0.so.0
#51 0x00007f162a05945c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#52 0x00007f162fd56193 in QEventDispatcherGlib::processEvents (this=0x2891e90, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415
#53 0x00007f1630792a4e in QGuiEventDispatcherGlib::processEvents (this=0x4c24420, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#54 0x00007f162fd28a02 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#55 0x00007f162fd28dec in QEventLoop::exec (this=0x7fffe14f5c10, flags=) at kernel/qeventloop.cpp:201
#56 0x00007f162fd2cebb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#57 0x0000000000452d58 in main (argc=<value optimized out>, argv=<value optimized out>) at /build/buildd/kmymoney-4.5/kmymoney/main.cpp:260

This bug may be a duplicate of or related to bug 247877, bug 254607.

Possible duplicates by query: bug 254607, bug 247877.

Reported using DrKonqi
Comment 1 Cristian Oneț 2010-12-02 20:04:39 UTC
Could you give some more specific hints to reproduce this since just entering transactions directly in the ledger doesn't help me reproduce this crash. Also it would be nice if you could try version 4.5.1 to see if the crash is still occurring.
Comment 2 Michael Gorven 2010-12-02 22:01:11 UTC
The crash is related to scrolling of the ledger and the edit mode entry box. I can reliably crash with the following operations:

Start KMyMoney2
Click "Current Account" on home page (Asset account)
Scroll to bottom of ledger with trackpad
Click on empty row at bottom of ledger (goes into edit mode)
Click in payer/receiver, type "unk", select "Unknown" from drop down list
Click in category, type "sun", select Sundry from drop down list
Click in comment box, type "foo"
Click on ledger scroll bar up button (below scroll bar)
Click in comment box to focus
Press Enter

I have four more backtraces which look similar to the above one (can attach if they'll be useful).
Comment 3 Cristian Oneț 2010-12-03 08:54:35 UTC
I think this sequence to reproduce it will be enough, thanks. I'll let you know if I still can't reproduce it with all these steps.
Comment 4 Cristian Oneț 2010-12-03 22:37:43 UTC
Sorry but I still couldn't reproduce this using those same steps.
Comment 5 Jack 2010-12-03 22:47:50 UTC
I was also unable to reproduce in 4.5.0.  I had different payee and category names, but I assume it should not matter.  I assume by comment box you mean the memo field.

I don't know why it would matter - but have you run a consistency check on your data?
Comment 6 Michael Gorven 2010-12-04 12:52:05 UTC
Consistency check says that my data is consistent, and yes, I meant the memo field. I've created a new KMyMoney file and can also crash it with that, so it doesn't seem to be my data.
Comment 7 Michael Gorven 2010-12-04 12:55:13 UTC
Created attachment 54076 [details]
KMyMoney data file

To reproduce the crash with the attached data file:

Open test.kmy
Click "Current" on the home page
Resize the window so that a scroll bar appears on the right
Scroll to the bottom
Click on the empty line
Click on the down arrow of the category drop down and select "Sundry"
Click in the memo field
Click the scroll bar up button once
Click in the memo field
Press Enter
Comment 8 Cristian Oneț 2010-12-04 13:18:34 UTC
Still with all that info I cand reproduce the crash. See the video at http://kmymoney2.sourceforge.net/258355.ogv do you notice any differences between what I do an what are you seeing on your version.
Could you also try to upgrade to 4.5.1?
Comment 9 allan 2010-12-04 13:51:19 UTC
(In reply to comment #6)
> Consistency check says that my data is consistent, and yes, I meant the memo
> field. I've created a new KMyMoney file and can also crash it with that, so it
> doesn't seem to be my data.

If it still fails with a new file, I'd rename or delete the resource file (
~/.kde4/share/config/kmymoneyrc).  I think the .kde4 will be .kde on Ubuntu.

Allan
Comment 10 Michael Gorven 2010-12-07 16:24:40 UTC
Removing the resource files (kmymoneyrc and kmymoney2rc) doesn't help, and 4.5.1 (compiled by myself with 4.5-2 debianisation) still crashes. That video looks basically the same, although it scrolls up higher than mine does. Screencast: http://mene.za.net/~mgorven/kmymoney-crash.ogv
Comment 11 Cristian Oneț 2010-12-07 16:55:29 UTC
(In reply to comment #10)
> Removing the resource files (kmymoneyrc and kmymoney2rc) doesn't help, and
> 4.5.1 (compiled by myself with 4.5-2 debianisation) still crashes. That video
> looks basically the same, although it scrolls up higher than mine does.
> Screencast: http://mene.za.net/~mgorven/kmymoney-crash.ogv

Yes, in your case the last item seems to be missing while editing the new transaction. I'll take a look at what could be the cause of that because that could be the source of the crash. Thanks for posting your screencast.
Comment 12 Cristian Oneț 2010-12-07 19:34:53 UTC
I finally managed to reproduce this on Qt 4.7.1.
Comment 13 Michael Gorven 2010-12-07 20:31:50 UTC
Great! I had similar crashes while I was running Ubuntu Lucid (which has Qt 4.6.2), although I can't easily check if it's the same issue or not.
Comment 14 Cristian Oneț 2010-12-07 21:57:20 UTC
SVN commit 1204535 by conet:

BUG: 258355
Hide the edit widgets before removing them because if the widgets are visible while they are being removed (actually scheduled for deleteLater()) some events will be sent to the register (during the actual delete process) which will cause a crash by accessing the widgets which where already deleted. This was happening somewhere deep in Qt's code and I found this to be the best workaround for it.

 M  +3 -1      register.cpp  
 M  +3 -1      transactionform.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1204535
Comment 15 Cristian Oneț 2010-12-07 21:58:19 UTC
SVN commit 1204536 by conet:

BUG: 258355
Hide the edit widgets before removing them because if the widgets are visible while they are being removed (actually scheduled for deleteLater()) some events will be sent to the register (during the actual delete process) which will cause a crash by accessing the widgets which where already deleted. This was happening somewhere deep in Qt's code and I found this to be the best workaround for it.
Merged into the stable branch.

 M  +3 -1      register.cpp  
 M  +3 -1      transactionform.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1204536
Comment 16 Cristian Oneț 2010-12-07 22:11:44 UTC
*** Bug 258557 has been marked as a duplicate of this bug. ***
Comment 17 Cristian Oneț 2010-12-08 13:02:57 UTC
*** Bug 254607 has been marked as a duplicate of this bug. ***
Comment 18 Cristian Oneț 2011-01-06 20:27:48 UTC
*** Bug 261551 has been marked as a duplicate of this bug. ***