Bug 506667 - Crash on import of QIF file from HSBC
Summary: Crash on import of QIF file from HSBC
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (other bugs)
Version First Reported In: 5.2.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 506629 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-07-06 10:46 UTC by Luke Tucker
Modified: 2025-07-07 19:23 UTC (History)
1 user (show)

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


Attachments
Same QIF causing a crash (53 bytes, application/x-qw)
2025-07-06 10:46 UTC, Luke Tucker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Tucker 2025-07-06 10:46:42 UTC
Created attachment 183001 [details]
Same QIF causing a crash

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

I downloaded a QIF file from my HSBC bank account. When I try to import it, kymoney crashes.

STEPS TO REPRODUCE
1. File=>Import=>QIF
2. Profile=Default, Source=Bank Statement
3. Import

OBSERVED RESULT
kmymoney crashes with Segmentation fault


EXPECTED RESULT
Does not crash. If there is an issue with the QIF it can't deal with there should be an error message.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.2.0
KDE Plasma Version: 6.4.2
Qt Version: 6.9.1

ADDITIONAL INFORMATION
A sample QIF that causes the crash is attached. Here is a backtrace from gdb:

(gdb) bt
#0  0x00007fffb413e8e7 in QString::at (this=0x7fffffffd160, i=0) at /usr/include/qt6/QtCore/qarraydatapointer.h:120
#1  MyMoneyQifReader::processTransactionEntry (this=0x555556919df0) at /usr/src/debug/kmymoney/kmymoney-5.2.0/kmymoney/plugins/qif/import/mymoneyqifreader.cpp:1110
#2  0x00007fffb4132420 in MyMoneyQifReader::processQifEntry (this=0x555556919df0) at /usr/src/debug/kmymoney/kmymoney-5.2.0/kmymoney/plugins/qif/import/mymoneyqifreader.cpp:604
#3  MyMoneyQifReader::slotProcessData (this=0x555556919df0) at /usr/src/debug/kmymoney/kmymoney-5.2.0/kmymoney/plugins/qif/import/mymoneyqifreader.cpp:396
#4  0x00007ffff55c0e34 in QObject::event (this=<optimized out>, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1431
#5  0x00007ffff6701c70 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x555556919df0, e=0x7fffc8005020)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3303
#6  0x00007ffff5568118 in QCoreApplication::notifyInternal2 (receiver=0x555556919df0, event=event@entry=0x7fffc8005020)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1106
#7  0x00007ffff55684fb in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x7fffc8005020)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1546
#8  QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x555555911740) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1879
#9  0x00007ffff583fcf8 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1733
#10 postEventSourceDispatch (s=0x55555591c100) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#11 0x00007fffe7dc787d in g_main_dispatch (context=0x7fffcc000f00) at ../glib/glib/gmain.c:3398
#12 0x00007fffe7dc8cd7 in g_main_context_dispatch_unlocked (context=0x7fffcc000f00) at ../glib/glib/gmain.c:4249
#13 g_main_context_iterate_unlocked (context=context@entry=0x7fffcc000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#14 0x00007fffe7dc8ee5 in g_main_context_iteration (context=0x7fffcc000f00, may_block=1) at ../glib/glib/gmain.c:4379
#15 0x00007ffff583c5e2 in QEventDispatcherGlib::processEvents (this=0x5555558e65b0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#16 0x00007ffff55744b6 in QEventLoop::processEvents (this=0x7fffffffdf30, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:104
#17 QEventLoop::exec (this=0x7fffffffdf30, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:186
#18 0x00007ffff556c7c1 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1449
#19 0x0000555555616849 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kmymoney/kmymoney-5.2.0/kmymoney/main.cpp:273
Comment 1 Luke Tucker 2025-07-06 11:06:21 UTC
After looking at the source code a bit, it seems that the importer assumes there is always an "L" field. If I add "LTest" to the transaction it works.
Comment 2 Thomas Baumgart 2025-07-06 13:58:10 UTC
Git commit e3c942be03e35d74025e9bdd175f39580b0e38f1 by Thomas Baumgart.
Committed on 06/07/2025 at 13:22.
Pushed by tbaumgart into branch 'master'.

Prevent crash when no account information is provided in QIF record
FIXED-IN: 5.2.1

M  +1    -1    kmymoney/plugins/qif/import/mymoneyqifreader.cpp

https://invent.kde.org/office/kmymoney/-/commit/e3c942be03e35d74025e9bdd175f39580b0e38f1
Comment 3 Thomas Baumgart 2025-07-06 14:10:12 UTC
*** Bug 506629 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Baumgart 2025-07-07 19:23:33 UTC
Git commit 2d90c1de2de3f87b13c49c48734d430ac973900e by Thomas Baumgart.
Committed on 07/07/2025 at 19:23.
Pushed by tbaumgart into branch '5.2'.

Prevent crash when no account information is provided in QIF record
FIXED-IN: 5.2.1
(cherry picked from commit e3c942be03e35d74025e9bdd175f39580b0e38f1)

M  +1    -1    kmymoney/plugins/qif/import/mymoneyqifreader.cpp

https://invent.kde.org/office/kmymoney/-/commit/2d90c1de2de3f87b13c49c48734d430ac973900e