GNOME Bugzilla – Bug 787095
Gnucash Crashes when opening old XML file
Last modified: 2018-06-29 23:58:56 UTC
Created attachment 358879 [details] Stack trace I'm using the current build from git-master, and when I open an XML file that I've been using since 2011, gnucash crashes. No issues with creating a new file, and then reopening it. Stack trace attached.
Can you attach the tracefile as well? What release version of GnuCash are you using?
I've attached the tracefile from running gnucash --debug. These traces are from the master branch on Github, at commit e732ff943243, but I've had the same issue on the master branch for awhile. I can test another branch to see if that helps, but my main goal was to test a build that didn't depend on libwebkitgtk-1.0-0.
Created attachment 358895 [details] tracefile from crash
No, what *stable* release are you using? I want to know what created the XML file that crashed. Is the error a segfault or something else?
2.6.17 can open and work with the file fine. It was probably originally created with something on the 2.4 branch of Gnucash, as I've been using this file continually since at least early 2013.
Every time you save an XML file you get a new file; the old one is renamed with a timestamp as a backup. So while you might have started the book in 2013 using 2.4.something, the current file was created with 2.6.17. Thanks, that's what I wanted to know. Now about the error...
Created attachment 365325 [details] stacktrace I have the same problem. I did not dive too deep into this, but apparently a path-string gets split into a vector<string>, when there is only a "/", the vector will be empty. KvpFrameImpl::set() would then call back() on that vector and segfaults.
Created attachment 365326 [details] [review] natural patch Therefore checking for an empty vector and returning nullptr in that case KvpFrameImpl::set(Path path..) seems natural.
Tested out the patch and it fixes the issue for me as well.
Applied to the unstable branch for release soon. Thanks!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=787095. Please update any external references or bookmarks.