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 787095 - Gnucash Crashes when opening old XML file
Gnucash Crashes when opening old XML file
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Engine
git-master
Other Linux
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2017-08-31 17:16 UTC by Scott Wehrenberg
Modified: 2018-06-29 23:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stack trace (4.87 KB, text/plain)
2017-08-31 17:16 UTC, Scott Wehrenberg
  Details
tracefile from crash (128.99 KB, text/plain)
2017-08-31 22:16 UTC, Scott Wehrenberg
  Details
stacktrace (15.48 KB, text/x-log)
2017-12-10 15:15 UTC, Andreas Müller
  Details
natural patch (499 bytes, patch)
2017-12-10 15:27 UTC, Andreas Müller
committed Details | Review

Description Scott Wehrenberg 2017-08-31 17:16:43 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.
Comment 1 John Ralls 2017-08-31 21:58:11 UTC
Can you attach the tracefile as well?

What release version of GnuCash are you using?
Comment 2 Scott Wehrenberg 2017-08-31 22:16:10 UTC
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.
Comment 3 Scott Wehrenberg 2017-08-31 22:16:38 UTC
Created attachment 358895 [details]
tracefile from crash
Comment 4 John Ralls 2017-08-31 22:52:27 UTC
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?
Comment 5 Scott Wehrenberg 2017-09-01 15:24:01 UTC
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.
Comment 6 John Ralls 2017-09-01 15:56:00 UTC
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...
Comment 7 Andreas Müller 2017-12-10 15:15:29 UTC
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.
Comment 8 Andreas Müller 2017-12-10 15:27:27 UTC
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.
Comment 9 Scott Wehrenberg 2017-12-11 20:40:45 UTC
Tested out the patch and it fixes the issue for me as well.
Comment 10 John Ralls 2018-02-23 00:01:08 UTC
Applied to the unstable branch for release soon. Thanks!
Comment 11 John Ralls 2018-06-29 23:58:56 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=787095. Please update any external references or bookmarks.