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 672760 - Postponed transaction applied invalid date, causing segfault upon opening data file
Postponed transaction applied invalid date, causing segfault upon opening dat...
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Scheduled Transactions
2.4.x
Other Mac OS
: Normal critical
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
: 543212 677651 680036 729065 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-24 18:12 UTC by JS
Modified: 2018-06-29 23:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Details of failure screenshot (387.82 KB, image/png)
2012-03-24 18:12 UTC, JS
Details

Description JS 2012-03-24 18:12:55 UTC
Created attachment 210522 [details]
Details of failure screenshot

I postponed a transaction in the "Since Last Run" window.  GC continued to work normally until I closed the file.  Upon reopening that data file, the program would crash immediately.

I ran GC (2.4.7) in Linux to test via a terminal, and it segfaulted.  I ran a trace and found the following error:

13:35:18  CRIT <GLib> g_date_new_dmy: assertion `g_date_valid_dmy (day, m, y)' failed

As my data file is SQLite, I opened the file and looked for any invalid date fields.  Slots was normal, but the scheduled transactions contained an erroneous line.

The attached screenshot shows the offending entry.

After changing this manually, the file opens as normal in Linux.  I have the file on a shared drive, so I closed in Linux and tried to open it in OSX (2.4.9).  I then get the libdbi error message and the file still will not open.  I looked at the listed bug in the error message but it was not helpful for my purposes.
Comment 1 Geert Janssens 2014-09-27 16:36:39 UTC
Thank you for your report. GnuCash 2.4.x however is no longer supported. Can you still reproduce this crash with gnucash 2.6.3 ?
Comment 2 John Ralls 2015-01-11 01:26:02 UTC
This is confirmed in the maint branch thanks to a report to the mailing list from Peter Kiessling, though perhaps with a different root cause: In this case setting a transaction to run "until" some date also causes it to retrieve invalid dates.

I can fix the crash, but the fix bypasses painting the transaction dates on the calendar.
Comment 3 John Ralls 2015-01-11 01:48:19 UTC
Nope, I'm wrong: The cause was the same, it's just that changing the end to forever or 1 instance or something masked the problem. When I looked at the actual SX record in the file I found:
  <sx:deferredInstance>
    <sx:last>
      <gdate>3924-07-17</gdate>
    </sx:last>
    <sx:rem-occur>1953068037</sx:rem-occur>
    <sx:instanceCount>25964</sx:instanceCount>
  </sx:deferredInstance>
Removing it by hand allows the SX editor to load without error.
Comment 4 John Ralls 2015-01-13 19:29:48 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.

It was a memory issue, no surprise. See afaec37 for details.
Comment 5 John Ralls 2015-09-21 22:55:00 UTC
*** Bug 677651 has been marked as a duplicate of this bug. ***
Comment 6 John Ralls 2015-09-21 22:57:15 UTC
*** Bug 543212 has been marked as a duplicate of this bug. ***
Comment 7 John Ralls 2015-09-21 22:58:44 UTC
*** Bug 680036 has been marked as a duplicate of this bug. ***
Comment 8 John Ralls 2015-09-21 23:00:40 UTC
*** Bug 729065 has been marked as a duplicate of this bug. ***
Comment 9 John Ralls 2017-09-24 22:43:27 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 10 John Ralls 2018-06-29 23:07:37 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=672760. Please update any external references or bookmarks.