GNOME Bugzilla – Bug 719726
Click on File -> Open seg-faults in gnc_uri_get_components in gnucash gnc-uri-utils.c:137
Last modified: 2018-06-29 23:22:12 UTC
Created attachment 263344 [details] gdb debug output incl. full backtrace GnuCash crashes with a segmentation fault in gnc_uri_get_components in gnucash gnc-uri-utils.c:137 when user clicks on "File" -> "Open". Note that no account hiearchy was previously created. User intents to open an existing account hierarchy and not to create a new one. Steps to Reproduce: 0) Downloaded gnucash sourcecode and built it. 1) Deleted ~/.gnucash 2) Clicked on "File" -> "Open" The application crashed. The file selector window should open and let the user define which account hiearchy to open. (Or, at least, the application should not crash.) Build 2013-12-02 on Ubuntu Linux (from git commit 7492f1460629d5d5d6570f59d9017f5ddf631b20) Occurs on Mac OS X 10.9 build 2.5.9-1 (http://downloads.sourceforge.net/sourceforge/gnucash/unstable/gnucash-Intel-2.5.9-1.dmg) as well. See attachment for the debugging trace using gdb.
I had to create a new user to replicate the crash, because the underlying problem is provoked when there is no history list and I can't find where gsettings is putting the blinking history list. The root cause of the problem is in gnc_uri_get_components() here: splituri = g_strsplit ( uri, "://", 2 ); if ( splituri[1] == NULL ) The problem is that if uri is "", g_strsplit returns a pointer to (gchar*)NULL, allocated on the heap. splituri[1] is whatever is next on the heap. The simplest fix is to check for an empty string in the initial g_return_if_fail(), pushed in r23478. As a work-around, you can run gnucash /path/to/account/file or on OSX /Applications/Gnucash.app/Contents/MacOS/Gnucash /path/to/account/file
*** Bug 720471 has been marked as a duplicate of this bug. ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=719726. Please update any external references or bookmarks.