Bug 484454

Summary: KMyMoney from master branch crashes on second and further start
Product: [Applications] kmymoney Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 5.2
Attachments: Screenshot with backtrace
Screenshot with backtrace
More detailed stacktrace generated on Linux
Disassembly of LedgerView::slotSettingsChanged

Description Ralf Habacker 2024-03-25 14:36:44 UTC
Created attachment 167739 [details]
Screenshot with backtrace

STEPS TO REPRODUCTION
1. download from
https://cdn.kde.org/ci-builds/office/kmymoney/master/windows/kmymoney-master-3149-windows-cl-msvc2019-x86_64.7z
2. unpack the archive
3. enter the unzipped directory and start bin/kmymoney

OBSERVED RESULT
From second and further start  kmymoney crashes. For a backtrace see the appended screenshot.

EXPECTED RESULT
kmymoney should not crash

SOFTWARE/OS VERSIONS
Windows: 10
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Comment 1 Ralf Habacker 2024-03-25 14:42:43 UTC
Created attachment 167741 [details]
Screenshot with backtrace
Comment 2 Ralf Habacker 2024-03-25 14:46:24 UTC
Created attachment 167742 [details]
More detailed stacktrace generated on Linux

As the debug symbols for the windows builds are not source indexed (Windbg reported this), a more detailed back trace has been generated on Linux.
Comment 3 Ralf Habacker 2024-03-25 14:55:26 UTC
Created attachment 167743 [details]
Disassembly of LedgerView::slotSettingsChanged

void LedgerView::slotSettingsChanged()
{
# crash
    updateGeometries();
    Q_EMIT settingsChanged();

    d->setFonts();
    d->resetMaxLineCache();
...

The crash happens before calling updateGeometries()  on accessing the virtual table of class LedgerView, which is a virtual method, which means that the this pointer is corrupted or invalid at this time.
Comment 4 Thomas Baumgart 2024-03-27 17:36:24 UTC
Git commit a9f68ecf29e046bd24066bc8b2c13a80085fbe75 by Thomas Baumgart.
Committed on 27/03/2024 at 17:36.
Pushed by tbaumgart into branch 'master'.

Prevent using uninitialized ui widgets
FIXED-IN: 5.2

M  +4    -1    kmymoney/views/ktagsview.cpp

https://invent.kde.org/office/kmymoney/-/commit/a9f68ecf29e046bd24066bc8b2c13a80085fbe75