GNOME Bugzilla – Bug 685329
Crashes on non-existent date
Last modified: 2018-06-29 23:11:09 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.
I'm curious what generated a QIF transaction with a bogus date?
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...
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.
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?
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.
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
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.