GNOME Bugzilla – Bug 736359
Date of 0000-00-00 in MySQL backend crashes GnuCash
Last modified: 2018-06-29 23:33:39 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
+ Trace 234078
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)
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?
Created attachment 287615 [details] crash file from /var/crash (core dump removed)
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...
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.
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.