Bug 243439 - Crash after online update
Summary: Crash after online update
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 14:38 UTC by allan
Modified: 2012-04-02 11:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description allan 2010-07-02 14:38:27 UTC
Version:           unspecified (using KDE 4.3.5) 
OS:                Linux

While reading another bug that mentioned online update, I did attempt an online update on an account that used to have that capability,but now doesn't.  It is not mapped, but update all accounts was enabled.  Unmap was disabled.  The update failed as expected, but that was followed by a crash.

It is reproducible.

Application: KMyMoney (kmymoney), signal: Segmentation fault
[Current thread is 1 (Thread 0xb4482700 (LWP 8191))]

Thread 2 (Thread 0xb05e1b70 (LWP 8218)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb65df0c2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb5df96dc in wait (time=<value optimized out>, this=<value optimized out>) at thread/qwaitcondition_unix.cpp:85
#3  QWaitCondition::wait (time=<value optimized out>, this=<value optimized out>) at thread/qwaitcondition_unix.cpp:159
#4  0xb5deebc2 in QThreadPoolThread::run (this=0x8a04608) at concurrent/qthreadpool.cpp:140
#5  0xb5df8623 in QThreadPrivate::start (arg=0x8a04608) at thread/qthread_unix.cpp:188
#6  0xb65da6e5 in start_thread () from /lib/libpthread.so.0
#7  0xb65da600 in ?? () from /lib/libpthread.so.0

Thread 1 (Thread 0xb4482700 (LWP 8191)):
[KCrash Handler]
#6  QTemporaryFile::fileName (this=0x0) at io/qtemporaryfile.cpp:665
#7  0xb089a39f in KOfxDirectConnectDlg::slotOfxFinished (this=0x90036d0) at /home/aga/Plugin/kmymoney/kmymoney/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp:193
#8  0xb089b91f in KOfxDirectConnectDlg::qt_metacall (this=0x90036d0, _c=InvokeMetaMethod, _id=37, _a=0xbfe217c8)
    at /home/aga/Plugin/kmymoney/build/kmymoney/plugins/ofximport/dialogs/kofxdirectconnectdlg.moc:76
#9  0xb5f05864 in QMetaObject::activate (sender=0x99bd7a8, from_signal_index=7, to_signal_index=7, argv=0xbfe217c8) at kernel/qobject.cpp:3113
#10 0xb5f06585 in QMetaObject::activate (sender=0x99bd7a8, m=0xb62cdd68, local_signal_index=3, argv=0xbfe217c8) at kernel/qobject.cpp:3187
#11 0xb6128695 in KJob::result(KJob*) () from /usr/lib/libkdecore.so.5
#12 0xb6128ba9 in KJob::emitResult() () from /usr/lib/libkdecore.so.5
#13 0xb63dc1ff in KIO::SimpleJob::slotFinished() () from /usr/lib/libkio.so.5
#14 0xb63dc726 in KIO::TransferJob::slotFinished() () from /usr/lib/libkio.so.5
#15 0xb63da2e4 in KIO::TransferJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#16 0xb5f05864 in QMetaObject::activate (sender=0x9bb8030, from_signal_index=8, to_signal_index=8, argv=0x0) at kernel/qobject.cpp:3113
#17 0xb5f06585 in QMetaObject::activate (sender=0x9bb8030, m=0xb65cbf64, local_signal_index=4, argv=0x0) at kernel/qobject.cpp:3187
#18 0xb64aeff5 in KIO::SlaveInterface::finished() () from /usr/lib/libkio.so.5
#19 0xb64b3164 in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib/libkio.so.5
#20 0xb64af50a in KIO::SlaveInterface::dispatch() () from /usr/lib/libkio.so.5
#21 0xb64a0a65 in KIO::Slave::gotInput() () from /usr/lib/libkio.so.5
#22 0xb64a30d4 in KIO::Slave::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#23 0xb5f05864 in QMetaObject::activate (sender=0x934b430, from_signal_index=4, to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3113
#24 0xb5f06585 in QMetaObject::activate (sender=0x934b430, m=0xb65c88a0, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3187
#25 0xb63a04e5 in KIO::Connection::readyRead() () from /usr/lib/libkio.so.5
#26 0xb63a23ca in ?? () from /usr/lib/libkio.so.5
#27 0xb63a2517 in KIO::Connection::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#28 0xb5efe04a in QMetaCallEvent::placeMetaCall (this=0x8916838, object=0x934b430) at kernel/qobject.cpp:477
#29 0xb5eff796 in QObject::event (this=0x934b430, e=0x8916838) at kernel/qobject.cpp:1111
#30 0xb55358fc in QApplicationPrivate::notify_helper (this=0x86e6650, receiver=0x934b430, e=0x8916838) at kernel/qapplication.cpp:4065
#31 0xb553d34e in QApplication::notify (this=0x86e65c0, receiver=0x934b430, e=0x8916838) at kernel/qapplication.cpp:3605
#32 0xb6aad521 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#33 0xb5eef32e in QCoreApplication::notifyInternal (this=0x86e65c0, receiver=0x934b430, event=0x8916838) at kernel/qcoreapplication.cpp:610
#34 0xb5eeffdc in sendEvent (event=<value optimized out>, receiver=<value optimized out>) at kernel/qcoreapplication.h:213
#35 QCoreApplicationPrivate::sendPostedEvents (event=<value optimized out>, receiver=<value optimized out>) at kernel/qcoreapplication.cpp:1247
#36 0xb5ef019c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1140
#37 0xb5f1b4dd in sendPostedEvents () at kernel/qcoreapplication.h:218
#38 postEventSourceDispatch () at kernel/qeventdispatcher_glib.cpp:276
#39 0xb49e54c2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#40 0xb49e8d98 in ?? () from /usr/lib/libglib-2.0.so.0
#41 0xb49e8ebe in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#42 0xb5f1b011 in QEventDispatcherGlib::processEvents (this=0x86cbf58, flags=...) at kernel/qeventdispatcher_glib.cpp:407
#43 0xb55d729a in QGuiEventDispatcherGlib::processEvents (this=0x86cbf58, flags=...) at kernel/qguieventdispatcher_glib.cpp:202
#44 0xb5eed98d in QEventLoop::processEvents (this=0xbfe22480, flags=) at kernel/qeventloop.cpp:149
#45 0xb5eeddd9 in QEventLoop::exec (this=0xbfe22480, flags=...) at kernel/qeventloop.cpp:201
#46 0xb5a15081 in QDialog::exec (this=0x90036d0) at dialogs/qdialog.cpp:498
#47 0xb088b56b in OfxImporterPlugin::updateAccount (this=0x9135f28, acc=..., moreAccounts=false) at /home/aga/Plugin/kmymoney/kmymoney/plugins/ofximport/ofximporterplugin.cpp:645
#48 0x080a5da5 in KMyMoneyApp::slotAccountUpdateOnlineAll (this=0x876b608) at /home/aga/Plugin/kmymoney/kmymoney/kmymoney.cpp:6825
#49 0x080e21b5 in KMyMoneyApp::qt_metacall (this=0x876b608, _c=InvokeMetaMethod, _id=103, _a=0xbfe22988) at /home/aga/Plugin/kmymoney/build/kmymoney/kmymoney.moc:499
#50 0xb5f05864 in QMetaObject::activate (sender=0x88906b0, from_signal_index=5, to_signal_index=6, argv=0xbfe22988) at kernel/qobject.cpp:3113
#51 0xb5f05d41 in QMetaObject::activate (sender=0x88906b0, m=0xb5d8f108, from_local_signal_index=1, to_local_signal_index=2, argv=0xbfe22988) at kernel/qobject.cpp:3207
#52 0xb552f0c5 in QAction::triggered (this=0x88906b0, _t1=false) at .moc/release-shared/moc_qaction.cpp:236
#53 0xb55306f2 in QAction::activate (this=0x88906b0, event=Trigger) at kernel/qaction.cpp:1167
#54 0xb596ea37 in QMenuPrivate::activateCausedStack (this=0x87e3b60, causedStack=..., action=0x88906b0, action_e=Trigger, self=true) at widgets/qmenu.cpp:967
#55 0xb5975378 in QMenuPrivate::activateAction (this=0x87e3b60, action=0x88906b0, action_e=Trigger, self=true) at widgets/qmenu.cpp:1060
#56 0xb5975f18 in QMenu::mouseReleaseEvent (this=0x88582b0, e=0xbfe23090) at widgets/qmenu.cpp:2259
#57 0xb6b9d78d in KMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.5
#58 0xb558cbac in QWidget::event (this=0x88582b0, event=0xbfe23090) at kernel/qwidget.cpp:7554
#59 0xb59781b4 in QMenu::event (this=0x88582b0, e=0xbfe23090) at widgets/qmenu.cpp:2358
#60 0xb55358fc in QApplicationPrivate::notify_helper (this=0x86e6650, receiver=0x88582b0, e=0xbfe23090) at kernel/qapplication.cpp:4065
#61 0xb553dbbb in QApplication::notify (this=0x88582b0, receiver=0x88582b0, e=0xbfe23090) at kernel/qapplication.cpp:3767
#62 0xb6aad521 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#63 0xb5eef32e in QCoreApplication::notifyInternal (this=0x86e65c0, receiver=0x88582b0, event=0xbfe23090) at kernel/qcoreapplication.cpp:610
#64 0xb553cbdc in sendSpontaneousEvent (event=<value optimized out>, receiver=<value optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:216
#65 QApplicationPrivate::sendMouseEvent (event=<value optimized out>, receiver=<value optimized out>) at kernel/qapplication.cpp:2924
#66 0xb55adc86 in QETWidget::translateMouseEvent (this=0x88582b0, event=0xbfe246bc) at kernel/qapplication_x11.cpp:4343
#67 0xb55acd7e in QApplication::x11ProcessEvent (this=0x86e65c0, event=0xbfe246bc) at kernel/qapplication_x11.cpp:3428
#68 0xb55d7b68 in x11EventSourceDispatch (s=0x86e9870, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#69 0xb49e54c2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#70 0xb49e8d98 in ?? () from /usr/lib/libglib-2.0.so.0
#71 0xb49e8ebe in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#72 0xb5f1b011 in QEventDispatcherGlib::processEvents (this=0x86cbf58, flags=...) at kernel/qeventdispatcher_glib.cpp:407
#73 0xb55d729a in QGuiEventDispatcherGlib::processEvents (this=0x86cbf58, flags=...) at kernel/qguieventdispatcher_glib.cpp:202
#74 0xb5eed98d in QEventLoop::processEvents (this=0xbfe24974, flags=) at kernel/qeventloop.cpp:149
#75 0xb5eeddd9 in QEventLoop::exec (this=0xbfe24974, flags=...) at kernel/qeventloop.cpp:201
#76 0xb5ef0270 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#77 0xb5535774 in QApplication::exec () at kernel/qapplication.cpp:3525
#78 0x0808eb27 in main (argc=1, argv=0xbfe24df4) at /home/aga/Plugin/kmymoney/kmymoney/main.cpp:277


Reproducible: Always

Steps to Reproduce:
Open an account that has not been mapped.
Click on Account/Update all Accounts, which attempted to download.
A crash occurs.


Actual Results:  
Crash

Expected Results:  
Graceful failure of update attempt

The account I used had previously been mapped, but now does not show 'Unmap'.
Comment 1 Alvaro Soliverez 2010-07-03 19:11:01 UTC
Did you click on Update account or in Update All Accounts??
Comment 2 allan 2010-07-03 19:18:10 UTC
(In reply to comment #1)
> Did you click on Update account or in Update All Accounts??

As I said, "Click on Account/Update all Accounts".  Update Account was not enabled.
Comment 3 allan 2010-07-05 02:09:56 UTC
When I just did a save after some editing, I received a consistency check warning that a couple of accounts needed to be edited for the recent password fix.  These two accounts are with the same institution as the account that I was using when the crash occurred.  Both still are mapped, and showing to be updateable. The institution no longer provides an OFX service, and I had unmapped two accounts, but not two other less frequently used ones.  I mention this in case it ties in with the crash.

Oh, Bu****!  Another crash.  I was unmapping/editing these two accounts when it happened.  I'll raise another bug tomorrow, as it's probably not related.
Comment 4 allan 2010-07-05 12:44:45 UTC
This second crash occurred twice, but this morning, didn't.

I was trying to unmap an account and also edit and close it to move the password.
After clicking unmap, unmap still was showing in the context menu, and I tried again.  Today, after unmapping, the context menu was correct, and there was no crash.

I can't now check for the original type of crash as I no longer have a mapped account
Comment 5 Alvaro Soliverez 2010-07-16 02:46:27 UTC
Are you able to reproduce this crash or it doesn't happen anymore after unmapping all accounts?
Comment 6 allan 2010-07-22 02:15:39 UTC
(In reply to comment #5)
> Are you able to reproduce this crash or it doesn't happen anymore after
> unmapping all accounts?

On doing a save I found that I still had a couple of mapped accounts.  Also, I have two other accounts with this bank which are now unmapped.

With the two that are still mapped, I can select 'Update account' and get a clean '404' error.  Remember, the bank no longer offers an OFX service.  If instead, I select 'Update ALL accounts', the crash still occurs.  I suppose this suggests that the latter is attempting to update accounts that are not mapped, which presumably, it shouldn't?

Shall I leave the mapped accounts mapped, in case you wish a test?
Comment 7 Alvaro Soliverez 2010-07-22 02:31:23 UTC
What if you press the Update All accounts from other places? Does the crash still happen?
Comment 8 allan 2010-07-22 11:48:56 UTC
When I click Account>Update all accounts, initially I get a dialog that the http request failed, with '404'.  Another connect attempt occurs with another similar dialog.  The first attempt resulted in a crash, but the second didn't. The third and fourth attempts failed after the first dialog box.

The menu 'Update' does nothing apparent.

Accounts view, followed by update all accounts worked once, but the second crashed.

A final attempt from Ledger view in an unmapped account, update all accounts got past the first dialog box but failed on the second, which may be a credit card account.
Comment 9 Thomas Baumgart 2010-07-23 11:00:14 UTC
This 'works on the first but fails on the second' problem could be related to https://bugs.kde.org/show_bug.cgi?id=245233 which I just fixed. Can you update from SVN and see if the problem is still persistant?

To comment #6: yes, please do leave those accounts mapped for now.
Comment 10 Mike Wolfe 2010-07-23 11:11:32 UTC
I created a Bugzilla account and left a comment, but FYI, your fix 
appears to have worked.  Thanks!

-Mike


Thomas Baumgart wrote:
> https://bugs.kde.org/show_bug.cgi?id=243439
>
>
>
>
>
> --- Comment #9 from Thomas Baumgart <ipwizard users sourceforge net>  2010-07-23 11:00:14 ---
> This 'works on the first but fails on the second' problem could be related to
> https://bugs.kde.org/show_bug.cgi?id=245233 which I just fixed. Can you update
> from SVN and see if the problem is still persistant?
>
> To comment #6: yes, please do leave those accounts mapped for now.
>
>
Comment 11 allan 2010-07-23 13:36:14 UTC
(In reply to comment #9)
> This 'works on the first but fails on the second' problem could be related to
> https://bugs.kde.org/show_bug.cgi?id=245233 which I just fixed. Can you update
> from SVN and see if the problem is still persistant?
> 
> To comment #6: yes, please do leave those accounts mapped for now.

Hello Thomas

Now on Version 3.98.2-svn1153479, but, no, sad to say, it still crashes at the same point.
Comment 12 Thomas Baumgart 2010-07-24 16:53:20 UTC
To me it looks like m_tmpFile is zero in KOfxDirectConnectDlg::slotOfxFinished() for whatever reason (see frames #6 and #7) in the backtrace in the description of the bug. I have no clue why that can happen.

I tried to duplicate it here, but to no avail. I tried to get the 404 from a normal web-server which I received, but did not encounter any crash.
Comment 13 Alvaro Soliverez 2010-07-29 03:15:48 UTC
SVN commit 1156368 by asoliverez:

Checked whether temp file actually exists when checking for connection errors.

Please try again whether the crash persists.

BUG:243439

 M  +2 -0      kofxdirectconnectdlg.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1156368
Comment 14 allan 2010-07-29 11:49:28 UTC
(In reply to comment #13)
> SVN commit 1156368 by asoliverez:
> 
> Checked whether temp file actually exists when checking for connection errors.
> 
> Please try again whether the crash persists.
> 
> BUG:243439
> 
>  M  +2 -0      kofxdirectconnectdlg.cpp  
> 
> 
> WebSVN link: http://websvn.kde.org/?view=rev&revision=1156368

Numerous attempts to 'Update' and 'Update All' succeeded.  Spot on!

Thanks.
Comment 15 Thomas Baumgart 2010-08-09 21:28:49 UTC
SVN commit 1161121 by tbaumgart:

Now really solve the problem. The temp file was not created in the case that a second account was updated at the same institution during an 'Update All' action and the HTTP(S) connection was not closed in between. In this case, the KIO slave does not emit the connected signal which was used to create the temp file. We resolve the issue by creating the temp file when we receive the first batch of data.

BUG: 243439
CCMAIL: brendan@coupeware.com

 M  +23 -28    kofxdirectconnectdlg.cpp  
 M  +0 -1      kofxdirectconnectdlg.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1161121
Comment 16 allan 2010-08-10 11:44:04 UTC
(In reply to comment #15)
> SVN commit 1161121 by tbaumgart:
> 
> Now really solve the problem. The temp file was not created in the case that a
> second account was updated at the same institution during an 'Update All'
> action and the HTTP(S) connection was not closed in between. In this case, the
> KIO slave does not emit the connected signal which was used to create the temp
> file. We resolve the issue by creating the temp file when we receive the first
> batch of data.
> 
> BUG: 243439
> CCMAIL: brendan@coupeware.com
> 
>  M  +23 -28    kofxdirectconnectdlg.cpp  
>  M  +0 -1      kofxdirectconnectdlg.h  
> 
> 
> WebSVN link: http://websvn.kde.org/?view=rev&revision=1161121

Yes, that seems to have nailed it!  Several attempts all produced '404' responses, with no crash.  Many thanks.