After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685329 - Crashes on non-existent date
Crashes on non-existent date
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Import - QIF
2.4.x
Other Linux
: Normal normal
: ---
Assigned To: Charles Day
Derek Atkins
Depends on:
Blocks:
 
 
Reported: 2012-10-02 20:25 UTC by Gabriel Chênevert
Modified: 2018-06-29 23:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Importing this QIF file makes GnuCash crash (71 bytes, application/octet-stream)
2012-10-02 20:25 UTC, Gabriel Chênevert
Details

Description Gabriel Chênevert 2012-10-02 20:25:16 UTC
Created attachment 225623 [details]
Importing this QIF file makes GnuCash crash

A QIF file containing a transaction that occurred on a non-existent day (e.g. 2012-04-31) makes the program crash ungracefully.
Comment 1 Derek Atkins 2012-10-02 20:32:50 UTC
I'm curious what generated a QIF transaction with a bogus date?
Comment 2 Gabriel Chênevert 2012-10-03 06:08:24 UTC
Erm... Me :) With a script that exported to QIF data that I had written by hand in a text file. I reckon that's probably not going to happen very often -- but still crashing seems a bit of an overreaction...
Comment 3 Mike Evans 2012-10-03 10:39:01 UTC
Just confirming this behaviour in SVN, with the following output.

sys:1: Warning: g_date_new_dmy: assertion `g_date_valid_dmy (day, m, y)' failed
sys:1: Warning: g_date_valid: assertion `d != NULL' failed
**
gnc.engine:ERROR:Transaction.c:1740:xaccTransSetDate: assertion failed: (g_date_valid(date))
Aborted (core dumped)


Crashing does seem to be an extreme behaviour in this scenario.
Comment 4 William Cattey 2014-10-15 00:24:40 UTC
Here is a .qif file that will consistently core dump gnucash 2.6.3 on MacOS:

TBank
^
!Type:Bank
D2/31/2012
T0.00
PInitial Deposit
LEquity:OpeningBalance
^

Although we all agree that the 31st of February is not a valid date,
the correct response should be an error message, not a core dump.

This bug is two years old.  How can I help it get fixed?
Comment 5 John Ralls 2016-12-12 00:39:55 UTC
Fixed. Attempting to set a bogus date will now set today's date and write a warning in the tracefile. It doesn't seem worth the effort to reject the import or raise a dialog.
Comment 6 John Ralls 2017-09-24 22:44:52 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 7 John Ralls 2018-06-29 23:11:09 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=685329. Please update any external references or bookmarks.