GnuCash
Contact   Instructions
Bug 797002 - Program crashes when exporting tax data in txf format.
Summary: Program crashes when exporting tax data in txf format.
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: TXF Export (show other bugs)
Version: 3.4
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: import
QA Contact: import
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-01 11:32 EST by Marilyn Kistler
Modified: 2019-01-03 11:46 EST (History)
6 users (show)

See Also:


Attachments
trace file from gnucash crash (115 bytes, text/plain)
2019-01-01 17:46 EST, Marilyn Kistler
no flags Details
Fix shadowed keyword. (9.18 KB, patch)
2019-01-02 23:05 EST, John Ralls
jralls: committed+
Details
Fix bad format string. (1.15 KB, patch)
2019-01-02 23:05 EST, John Ralls
jralls: committed+
Details
Replacement taxtxf.scm (187.96 KB, text/plain)
2019-01-02 23:11 EST, John Ralls
no flags Details

Description Marilyn Kistler 2019-01-01 11:32:55 EST
Ran Tax Schedule Report and TXF Export. Selected Export -> TXF. Selected target dir and gave filename. Clicked Export button. Program crashes. Creates empty file.
Comment 1 John Ralls 2019-01-01 14:28:11 EST
Try this after quitting GnuCash: Start Notepad with Administrator privileges, then open C:\Program Files (x86)\gnucash\share\gnucash\scm\gnucash\report\taxtxf.scm.

Got to line 590 and replace "!0,2f" with "~0,2f". Save the file as plain text. Restart GnuCash and try the export again.
Comment 2 Marilyn Kistler 2019-01-01 17:05:40 EST
I made the change you suggested. Program still crashes at the same place. 

                                     (format #f "~0,2f" (gnc-numeric-to-double
Comment 3 John Ralls 2019-01-01 17:26:42 EST
Rats. Please attach a trace file (https://wiki.gnucash.org/wiki/Tracefile) from the crash.
Comment 4 Marilyn Kistler 2019-01-01 17:46:27 EST
Created attachment 373090 [details]
trace file from gnucash crash
Comment 5 tim.quinn 2019-01-02 08:54:52 EST
I saw the same problem on Mac High Sierra with 3.3 and 3.4. I tried the same suggestion from Chris Lam via the mailing list, also with no change in behavior -- same failure except the error message shows the tilde instead of the excl. point.
Comment 6 John Ralls 2019-01-02 23:05:30 EST
Created attachment 373095 [details]
Fix shadowed keyword.
Comment 7 John Ralls 2019-01-02 23:05:57 EST
Created attachment 373096 [details]
Fix bad format string.
Comment 8 John Ralls 2019-01-02 23:11:35 EST
Created attachment 373097 [details]
Replacement taxtxf.scm

I think the problem is that taxtxf.scm shadows the format builtin with a let variable. The first patch renames the let variable to format_type, the second fixes the bad format string as described in comment 1. Since applying patches requires development tools I've also attached a copy of taxtxf.scm with the changes incorporated. Please copy it over the one in GnuCash and see if that fixes the crash.
Comment 9 Marilyn Kistler 2019-01-03 09:48:09 EST
This fixed it. Thank you.
Comment 10 tim.quinn 2019-01-03 10:49:12 EST
Also fixed the problem for me. Thanks.

Note You need to log in before you can comment on or make changes to this bug.