Bug 370227 - Crash on exit
Summary: Crash on exit
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: onlinebanking (show other bugs)
Version: 4.8.0
Platform: Compiled Sources macOS
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords: drkonqi, triaged
: 364725 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-10-07 00:38 UTC by Marko Käning
Modified: 2018-11-12 16:04 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (7.97 KB, text/plain)
2017-07-19 19:31 UTC, MK
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marko Käning 2016-10-07 00:38:04 UTC
Application: kmymoney (4.7.90)
KDE Platform Version: 4.14.3 (Compiled from sources)
Qt Version: 4.8.7
Operating System: Darwin 13.4.0 x86_64
Distribution (Platform): MacPorts Packages

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

After downloading transactions from two banks I saved my data and then exited the application. At exit KMM just crashed.


- System:
   + Mac OSX 10.9.5
   + MacPorts-based KDE4 installation
   + Port kmymoney4-devel

-- Backtrace:
Application: KMyMoney (kmymoney), signal: Segmentation fault: 11
(lldb) process attach --pid 3843
Process 3843 stopped
Executable module set to "/Applications/MacPorts/KDE4/kmymoney.app/Contents/MacOS/kmymoney".
Architecture set to: x86_64-apple-macosx.
(lldb) set set term-width 200
(lldb) thread info
thread #1: tid = 0x2cdb6, 0x00007fff9191ce20 libsystem_kernel.dylib`__wait4 + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP

(lldb) bt all
* thread #1: tid = 0x2cdb6, 0x00007fff9191ce20 libsystem_kernel.dylib`__wait4 + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff9191ce20 libsystem_kernel.dylib`__wait4 + 8
    frame #1: 0x00000001035409be libkdeui.5.dylib`KCrash::startProcess(int, char const**, bool) + 286
    frame #2: 0x000000010353fae9 libkdeui.5.dylib`KCrash::defaultCrashHandler(int) + 1209
    frame #3: 0x00007fff92c0e5aa libsystem_platform.dylib`_sigtramp + 26
    frame #4: 0x000000010fbc6f37 libgwenhywfar.60.dylib`GWEN_List1_GetFirst + 5
    frame #5: 0x000000010fbc515f libgwenhywfar.60.dylib`GWEN_Inherit_FindData + 52
    frame #6: 0x0000000104ed006a dir.so`GWEN_ConfigMgrDir_LockGroup + 76
    frame #7: 0x000000010fcc2754 libaqbanking.35.dylib`AB_Banking_LockSharedConfig + 70
    frame #8: 0x000000010fcee7a5 libaqbanking.35.dylib`AB_Gui_WriteDialogPrefs + 207
    frame #9: 0x000000010fc3ff85 libgwenhywfar.60.dylib`GWEN_Dialog_free + 89
    frame #10: 0x000000010fc44144 libgwenhywfar.60.dylib`GWEN_Gui_Internal_ProgressEnd + 999
    frame #11: 0x000000010fcbdb3e libaqbanking.35.dylib`AB_Banking_ExecuteJobs + 2257
    frame #12: 0x000000010f718ad2 kmm_kbanking.so`KMyMoneyBanking::executeQueue(AB_IMEXPORTER_CONTEXT*) + 82
    frame #13: 0x000000010f7189e5 kmm_kbanking.so`KBankingPlugin::executeQueue() + 165
    frame #14: 0x000000010f718589 kmm_kbanking.so`KBankingPlugin::updateAccount(MyMoneyAccount const&, bool) + 2089
    frame #15: 0x0000000100dcdae4 kmymoney`KMyMoneyApp::slotAccountUpdateOnline() + 468
    frame #16: 0x0000000100dddbcb kmymoney`KMyMoneyApp::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 2107
    frame #17: 0x00000001049eb06b QtCore`QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2363
    frame #18: 0x00000001039756a9 QtGui`QAction::activate(QAction::ActionEvent) + 233
    frame #19: 0x0000000103cff004 QtGui`QAbstractButtonPrivate::click() + 84
    frame #20: 0x0000000103cffde8 QtGui`QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 88
    frame #21: 0x0000000103dcb7cf QtGui`QToolButton::mouseReleaseEvent(QMouseEvent*) + 15
    frame #22: 0x00000001039d2a1c QtGui`QWidget::event(QEvent*) + 716
    frame #23: 0x0000000103cffcf3 QtGui`QAbstractButton::event(QEvent*) + 179
    frame #24: 0x0000000103dcbc7b QtGui`QToolButton::event(QEvent*) + 171
    frame #25: 0x000000010397e7eb QtGui`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 251
    frame #26: 0x0000000103980775 QtGui`QApplication::notify(QObject*, QEvent*) + 2949
    frame #27: 0x00000001049d2186 QtCore`QCoreApplication::notifyInternal(QObject*, QEvent*) + 118
    frame #28: 0x000000010397f1fb QtGui`QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) + 475
    frame #29: 0x000000010392b902 QtGui`qt_mac_handleMouseEvent(NSEvent*, QEvent::Type, Qt::MouseButton, QWidget*, bool) + 1298
    frame #30: 0x00007fff8b6c8145 AppKit`-[NSWindow sendEvent:] + 781
    frame #31: 0x0000000103922de1 QtGui`-[QCocoaWindow sendEvent:] + 113
    frame #32: 0x00007fff8b6695d4 AppKit`-[NSApplication sendEvent:] + 2021
    frame #33: 0x0000000103927d21 QtGui`-[QNSApplication sendEvent:] + 97
    frame #34: 0x00007fff8b4b99f9 AppKit`-[NSApplication run] + 646
    frame #35: 0x000000010393116b QtGui`QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 2027
    frame #36: 0x00000001049cf4ff QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 495
    frame #37: 0x00000001049d2737 QtCore`QCoreApplication::exec() + 199
    frame #38: 0x0000000100d7af01 kmymoney`runKMyMoney(KApplication*, KStartupLogo*) + 2753
    frame #39: 0x0000000100d7a05e kmymoney`main + 9374
    frame #40: 0x00007fff9448a5fd libdyld.dylib`start + 1

  thread #2: tid = 0x2cdbf, 0x00007fff9191d662 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
    frame #0: 0x00007fff9191d662 libsystem_kernel.dylib`kevent64 + 10
    frame #1: 0x00007fff8cfd4421 libdispatch.dylib`_dispatch_mgr_invoke + 239
    frame #2: 0x00007fff8cfd4136 libdispatch.dylib`_dispatch_mgr_thread + 52

  thread #3: tid = 0x2ce3e, 0x00007fff9191c9aa libsystem_kernel.dylib`__select + 10, name = 'com.apple.CFSocket.private'
    frame #0: 0x00007fff9191c9aa libsystem_kernel.dylib`__select + 10
    frame #1: 0x00007fff8d39ca03 CoreFoundation`__CFSocketManager + 867
    frame #2: 0x00007fff91fff899 libsystem_pthread.dylib`_pthread_body + 138
    frame #3: 0x00007fff91fff72a libsystem_pthread.dylib`_pthread_start + 137
    frame #4: 0x00007fff92003fc9 libsystem_pthread.dylib`thread_start + 13

  thread #4: tid = 0x2ce49, 0x00007fff91918a1a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #0: 0x00007fff91918a1a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fff91917d18 libsystem_kernel.dylib`mach_msg + 64
    frame #2: 0x00007fff8d350f15 CoreFoundation`__CFRunLoopServiceMachPort + 181
    frame #3: 0x00007fff8d350539 CoreFoundation`__CFRunLoopRun + 1161
    frame #4: 0x00007fff8d34fe75 CoreFoundation`CFRunLoopRunSpecific + 309
    frame #5: 0x00007fff8b66605e AppKit`_NSEventThread + 144
    frame #6: 0x00007fff91fff899 libsystem_pthread.dylib`_pthread_body + 138
    frame #7: 0x00007fff91fff72a libsystem_pthread.dylib`_pthread_start + 137
    frame #8: 0x00007fff92003fc9 libsystem_pthread.dylib`thread_start + 13
(lldb) detach
Process 3843 detached
(lldb) (lldb) quit

Possible duplicates by query: bug 369926, bug 369262, bug 369238, bug 369237, bug 369002.

Reported using DrKonqi
Comment 1 Christian David 2016-10-30 10:43:30 UTC
Here KMyMoney is used with Qt 4 and gwenhyfar with Qt 5 – if libkdeui.5.dylib is KF 5 based. This is probably the reason for the crash.

Can you check if my assumption is correct?
Comment 2 Marko Käning 2016-10-30 13:36:09 UTC
No, this is a purely non-KF5'ish installation (still)! :-)

Don't know why libkdeui has version number 5 though.

I guess this needs to be figured out.
Comment 3 Marko Käning 2016-10-30 14:07:13 UTC
René, do you have an idea why there is a libkdeui.5.dylib in a qt4-mac-build of kmymoney4-devel? Is the 5 really an indication for KF5, I am really not sure about that now!
Comment 4 RJVB 2016-10-30 14:24:20 UTC
The kdelibs libraries have always had a 5 version, confusingly.

If that gaelicish library is built against Qt5 then I'd indeed expect crashes, but not just on exit. There should be an abort much earlier in that case.
Comment 5 Marko Käning 2016-10-30 14:29:20 UTC
No, it's definitely built without KF5, as this is from a standard MacPorts install of port kmymoney4-devel which doesn't know anything about the KF5 world up to now. :)
Comment 6 Thomas Baumgart 2016-10-30 16:11:29 UTC
AqBanking/Gwenhywfar still had a dialog open somewhere. That is causing the crash. I wonder, if you can reproduce it by leaving an AqBanking dialog open and then exit from KMyMoney.
Comment 7 Christian David 2016-10-30 16:21:29 UTC
Then my assumption is wrong – seems to be too simple to be true :(
Comment 8 RJVB 2016-10-30 17:19:47 UTC
Do those supposed still-open dialogs have a QObject-based proxy/wrapper class?

One source of UI-related crashes on OS X is deleting object instances representing UI elements that still have events pending, which can include events due to closing the UI element. In a nutshell, that's at least partly due to a mismatch between ObjC's memory management model (which uses refcounting; [foo release] isn't usually immediate) and C++'s model where `delete foo` has immediate effect.
Qt provides the QObject::deleteLater() method for that.

Note that deleteLater() only works on pointers, but the side-effects of immediate free can also arise when a non-pointer instance goes out of scope; in that case code has to be rewritten to use a pointer...
Comment 9 Marko Käning 2016-10-30 21:55:42 UTC
(In reply to RJVB from comment #8)
> Qt provides the QObject::deleteLater() method for that.

I remember this from some patches you submitted a long time ago. Wasn't it in KDevelop?
Yeah, I guess this needs some investigation. Will do what Thomas asked me to, i.e. close KMM with an AqBanking-window still open.
Comment 10 Marko Käning 2016-10-30 23:17:55 UTC
(In reply to Thomas Baumgart from comment #6)
> AqBanking/Gwenhywfar still had a dialog open somewhere. That is causing the
> crash. I wonder, if you can reproduce it by leaving an AqBanking dialog open
> and then exit from KMyMoney.

Yes, I could provoke it by letting the online-update dialog open when exiting the application. That triggered the exact same backtrace as posted here.
Comment 11 Christoph Feck 2016-11-02 15:43:14 UTC
kdelibs.so version 5 is KDE Platform 4, because there was an ABI break in the early 1.x versions due to a new Qt 2 version. This means kdelibs.so.4 was actually KDE 3, etc.
Comment 12 Marko Käning 2016-11-09 23:19:51 UTC
So, what are we going to do about this crash now?

Which delete()'s exactly should I replace by deleteLater()?
Comment 13 RJVB 2016-11-10 00:33:57 UTC
Looking at the backtrace again I'm not sure that this is a likely result of using delete instead of deleteLater, but you could begin by checking that AqBanking dialog. If it's a KDE dialog it could be a prime candidate for using deleteLater.

In fact, I suspect the bug is in gwenhywfar, possible AqBanking, not in KMM. Though it may be possible to avoid the crash by deferring a KMM exit request until the ongoing operation is finished or aborted properly.
Comment 14 Marko Käning 2016-11-16 07:53:15 UTC
*** Bug 364725 has been marked as a duplicate of this bug. ***
Comment 15 MK 2017-07-19 19:31:22 UTC
Created attachment 106738 [details]
New crash information added by DrKonqi

kmymoney (4.8.0) on KDE Platform 4.14.22 using Qt 4.8.7

- What I was doing when the application crashed:
Called aqbanking to download statements. Closed kmymoney while aqbanking was working still.

-- Backtrace (Reduced):
#6  0x00007f070b17cad9 in GWEN_List1_GetFirst () from /usr/local/lib/libgwenhywfar.so.60
#7  0x00007f070b17ab6e in GWEN_Inherit_FindData () from /usr/local/lib/libgwenhywfar.so.60
#8  0x00007f0709a1ec80 in GWEN_ConfigMgrDir_LockGroup () from /usr/local/lib/gwenhywfar/plugins/60/configmgr/dir.so
#9  0x00007f070aaa2b66 in AB_Banking_LockSharedConfig () from /usr/local/lib/libaqbanking.so.35
[...]
#11 0x00007f070b1fa605 in GWEN_Dialog_free () from /usr/local/lib/libgwenhywfar.so.60
Comment 16 Thomas Baumgart 2017-09-14 12:06:57 UTC
Can some retry this with current master? We have made some fixes that should avoid this crash on exit behavior.
Comment 17 Andrew Crouthamel 2018-10-21 05:01:21 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 18 Bug Janitor Service 2018-11-12 16:04:14 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!