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 736359 - Date of 0000-00-00 in MySQL backend crashes GnuCash
Date of 0000-00-00 in MySQL backend crashes GnuCash
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Backend - SQL
2.6.3
Other Linux
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-09 20:42 UTC by Y Lavi
Modified: 2018-06-29 23:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
crash file from /var/crash (core dump removed) (152.34 KB, text/plain)
2014-10-02 17:44 UTC, Y Lavi
Details

Description Y Lavi 2014-09-09 20:42:08 UTC
On a machine running Debian with libdbd-mysql version 0.8.3-1+s-5+b1, GnuCash starts up fine, both versions 2.4.10 (wheezy) and 2.6.3 (wheezy-backports, built from 4e4a032+).

GnuCash 2.6.3 also starts up fine when connected to the same MySQL database on Windows 8.1.

However, when run on Ubuntu 14.04.1, GnuCash 2.6.3 (1:2.6.1~getdeb4~trusty from GetDeb, also built from rev 4e4a032+) segfaults after connecting to the database, before showing anything on screen. Note that libdbd-mysql on this machine is 0.9.0-2ubuntu2.

This was traced to the schedxactions table where one row had a last_occur value of 0000-00-00. When this is changed to a normal date, GnuCash starts up OK.

The MySql server version is 5.5.37-0ubuntu0.12.04.1.

Since 2.6.3 does work OK in Windows and with the older version of libdbd-mysql I guess that the issue lies in how GnuCash handles the behaviour of the newer version of libdmd-mysql specifically, and it's not a general issue with 2.6.3.

Here's the stack trace:

(gdb) run --nofile
Starting program: /usr/bin/gnucash --nofile
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdbf05700 (LWP 6773)]
[New Thread 0x7fffdb704700 (LWP 6774)]
[New Thread 0x7fffc4203700 (LWP 6777)]
Found Finance::Quote version 1.18
[New Thread 0x7fffc3902700 (LWP 6781)]
[New Thread 0x7fffc3101700 (LWP 6782)]
[New Thread 0x7fffc228d700 (LWP 6799)]
[Thread 0x7fffc3902700 (LWP 6781) exited]
[Thread 0x7fffc228d700 (LWP 6799) exited]
[New Thread 0x7fffc228d700 (LWP 6813)]
[Thread 0x7fffc228d700 (LWP 6813) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff732fdd1 in xaccSchedXactionSetLastOccurDate () from /usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgncmod-engine.so
(gdb) bt
  • #0 xaccSchedXactionSetLastOccurDate
    from /usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgncmod-engine.so
  • #1 g_object_set_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #2 g_object_set
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #3 ??
    from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so.0
  • #4 gnc_sql_load_object
    from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so.0
  • #5 ??
    from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so.0
  • #6 g_hash_table_foreach_sorted
    from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-qof.so.1
  • #7 qof_object_foreach_backend
    from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-qof.so.1
  • #8 gnc_sql_load
    from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so.0
  • #9 ??
    from /usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgncmod-backend-dbi.so
  • #10 qof_session_load
    from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-qof.so.1
  • #11 ??
    from /usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgncmod-gnome-utils.so
  • #12 gnc_ui_file_access_response_cb
    from /usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgncmod-gnome-utils.so
  • #13 g_cclosure_marshal_VOID(int0_t, void)
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #14 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #15 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #16 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #17 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #18 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #19 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #20 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #21 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #22 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #23 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #24 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #25 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #26 g_closure_invoke
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #27 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #28 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #29 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #30 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #31 gtk_propagate_event
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #32 gtk_main_do_event
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #33 ??
    from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
  • #34 g_main_context_dispatch
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #35 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #36 g_main_loop_run
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #37 gtk_main
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #38 gnc_ui_start_event_loop
    from /usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgncmod-gnome-utils.so
  • #39 _start
Continuing.
[Thread 0x7fffc3101700 (LWP 6782) exited]
[Thread 0x7ffff7faaa40 (LWP 6768) exited]
[Thread 0x7fffc4203700 (LWP 6777) exited]
[Thread 0x7fffdbf05700 (LWP 6773) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
Comment 1 John Ralls 2014-09-21 23:55:37 UTC
I'm not able to replicate this on Debian Jessie with libdbd-mysql 0.9.0-3. Could you paste in the results of 
'select * from schedxactions where guid = "...";
with the guid of the defective SX?
Comment 2 Y Lavi 2014-10-02 17:44:46 UTC
Created attachment 287615 [details]
crash file from /var/crash (core dump removed)
Comment 3 Y Lavi 2014-10-02 17:50:11 UTC
I apologise for my slow response.

Here goes:
mysql> select * from schedxactions where guid = "09fd2e62f5ba80e64d999914b13d619e";
+----------------------------------+-------+---------+------------+----------+------------+-----------+-----------+-------------+-------------+--------------+------------+----------------+----------------------------------+
| guid                             | name  | enabled | start_date | end_date | last_occur | num_occur | rem_occur | auto_create | auto_notify | adv_creation | adv_notify | instance_count | template_act_guid                |
+----------------------------------+-------+---------+------------+----------+------------+-----------+-----------+-------------+-------------+--------------+------------+----------------+----------------------------------+
| 09fd2e62f5ba80e64d999914b13d619e | Hever |       1 | 2010-01-31 | NULL     | 0000-00-00 |         0 |         0 |           0 |           0 |            0 |          0 |              1 | 9d32ac9ed92ec0807208552975721a11 |
+----------------------------------+-------+---------+------------+----------+------------+-----------+-----------+-------------+-------------+--------------+------------+----------------+----------------------------------+
1 row in set (0.00 sec)

That makes GnuCash crash. In the file in /var/crash I see:
gnucash crashed with SIGSEGV in xaccSchedXactionSetLastOccurDate()

I don't know exactly what you'll need from there so I just attached the crash file, after removing the core dump to make it much smaller.

After running
update schedxactions set last_occur = "2012-01-28" where guid = "09fd2e62f5ba80e64d999914b13d619e";
I can run GnuCash as usual again (although it warns me about not being able to get a lock the last time.

I hope that between the query result and the crash file you get something new to work on...
Comment 4 John Ralls 2014-10-06 19:23:24 UTC
OK, I can reproduce it now. It doesn't crash with a debug build, even with optimization left on, but I got enough running a release build in the debugger to see what's causing the crash.

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 5 John Ralls 2018-06-29 23:33:39 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=736359. Please update any external references or bookmarks.