Bug 440059

Summary: kmymoney crashes after closing
Product: [Frameworks and Libraries] frameworks-kconfigwidgets Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.65.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 5.65.0 (2021-10-26)
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 426400    

Description Ralf Habacker 2021-07-20 08:16:35 UTC
SUMMARY
Running a kmymoney snapshot from https://kmymoney.org/snapshots.php results into a crash after closing kmymoney.


STEPS TO REPRODUCE
1. Download portable 32bit package from https://kmymoney.org/snapshots.php#kmymoney5-aq6-master
2. unpack with 7z and start kmymoney
3. open a kmymoney file and close the application

OBSERVED RESULT
kmymoney crashes


EXPECTED RESULT
kmymoney should not crash

SOFTWARE/OS VERSIONS
Windows: 10
KDE Frameworks Version: 5.65.0
Qt Version: 5.11

ADDITIONAL INFORMATION
After downloading debug symbols from the mentioned site, unpacking inside the location where the kmymoney application has been unpacked an attaching gdb to a running kmymoney it returns the following information:

Thread 1 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 10736.0x13c4]
QExplicitlySharedDataPointer<KSharedConfig>::~QExplicitlySharedDataPointer (this=<optimized out>, __in_chrg=<optimized out>) at /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtCore/qshareddata.h:169
169     /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtCore/qshareddata.h:
      inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
(gdb) bt
#0  QExplicitlySharedDataPointer<KSharedConfig>::~QExplicitlySharedDataPointer (this=<optimized out>, __in_chrg=<optimized out>) at /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtCore/qshareddata.h:169
#1  0x01a9c12a in libstdc++-6!__gnu_debug::_Safe_unordered_container_base::_M_swap(__gnu_debug::_Safe_unordered_container_base&) from H:\Downloads\kmymoney5-5.1.99+git.1f8cd6b4b\bin\libstdc++-6.dll
#2  0x0097fc68 in ?? ()
#3  0x4c5a4851 in ?? ()
#4  0x8a001c00 in ?? ()
#5  0x2d465455 in ?? ()
#6  0x00000038 in ?? ()
#7  0x4c584853 in ?? ()
#8  0x80001d00 in ?? ()
#9  0x06f47fc8 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Comment 1 Ralf Habacker 2021-09-16 09:14:45 UTC
After removing `thread_local` on https://invent.kde.org/frameworks/kconfigwidgets/-/blob/master/src/kcolorscheme.cpp#L269 there is no crash anymore.
Comment 2 Ralf Habacker 2024-08-06 17:49:39 UTC
Fixed with adding a patch to kconfigwidget at 2021-10-26, see https://build.opensuse.org/request/show/927491