GNOME Bugzilla – Bug 339892
crash when importing a bad QIF file from moneydance
Last modified: 2018-06-29 21:02:39 UTC
This is Debian bug #360025 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=360025 There is a sample bad QIF file available from that bugreport (contributor does not want the full URL in the bug report itself). The backtrace produced was: Backtrace: In unknown file: ?: 5* [#<procedure #f #> #] In /opt/garfield/gnucash/share/gnucash/scm/qif-import/qif-dialog-utils.scm: 407: 6* [for-each #<procedure #f (split)> (#)] In unknown file: ?: 7* [#<procedure #f #> #] In /opt/garfield/gnucash/share/gnucash/scm/qif-import/qif-dialog-utils.scm: 409: 8* (let (# # #) (if # #)) 412: 9 (if (not xtn-is-acct) (begin (set! xtn-cat #) (set! entry #) (if # #) ...)) 413: 10 (begin (set! xtn-cat #) (set! entry #) (if # #) ...) 416: 11* (if (not entry) (set! entry (qif-import:guess-acct xtn-cat # ...))) 417: 12 (set! entry (qif-import:guess-acct xtn-cat (if # # #) gnc-acct-info)) 418: 13* [qif-import:guess-acct "Bills:Internet (Cable" (9 8) ...] In /opt/garfield/gnucash/share/gnucash/scm/qif-import/qif-guess-map.scm: 223: 14 (let* (# #) (qif-map-entry:set-qif-name! retval acct-name) ...) 224: 15* [qif-import:find-similar-acct "Bills:Internet (Cable" (9 8) ...] 258: 16 (let* (# # #) (for-each # gnc-acct-info) (for-each # same-type-accts) ...) 275: 17* [for-each #<procedure #f (gnc-acct)> (# # # # ...)] In unknown file: ?: 18* [#<procedure #f (gnc-acct)> ("Bonus" "Income:Bonus" #)] In /opt/garfield/gnucash/share/gnucash/scm/qif-import/qif-guess-map.scm: 277: 19* (if # #) 277: 20* [qif-import:possibly-matching-name? "Bills:Internet (Cable" #] 301: 21 (or (string=? # #) (string=? # #) (and # #)) In unknown file: ... ?: 22 [string-match "bills:internet (cable" "income:bonus"] ?: 23 (let ((rx #) (start #)) (regexp-exec rx str start)) ?: 24* [gsubr-apply #<primitive-procedure make-regexp> "bills:internet (cable"] <unnamed port>: In procedure make-regexp in expression (make-regexp pattern): <unnamed port>: Unmatched ( or \( The frustrating part is that gnucash identified an error in the "good" QIF file from moneydance, but misses the error in the bad file and crashes. Crash steps: File->Import->Import QIF Select bad file, click Foward. GnuCash processes the QIF without error and displays the file as loaded. Forward: Matching QIF accounts with GnuCash accounts. Checking -> Assets:Current Assets:Checking Account Citi -> Citi -> New ? -> Ticked. Forward -> crash.
From the Debian bugreport: on attempt to export/import the same db (+ few new entries) gnucash complained about "Data for number or date does not match a known format" but didn't crash (neither proceed any further) that file is under http://www.onerussian.com/ tmp/moneydanceexport_good.qif (just attach the url manually please - didn't want google to cache it... though original file is already "the history" ;-)) so I removed everything before and after ========= lines in that bug report (sorry that my emacs didn't include it as an attachement) and tried to import it (the same version of gnucash as during bug report), and I got the same crash log That file is available from http://www.onerussian.com/ tmp/moneydanceexport_bad.qif
Here's another bad QIF file that GnuCash svn doesn't catch, really small: !Type:Bank D10 Dec 2004 N PCHECK # 576 T-378.88 C* ^ This if from Debian bug 286243 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286243
"10 Dec 2004" is not a valid QIF date format.
The bug mentioned in comment 2 now has its own bug report, bug #510940, and I have provided a patch for it. The bug originally reported has to do with a bad regular expression that gets formed by the Scheme code because the account name contains an unmatched left parenthesis.
I just tried importing the Moneydance QIF from www.onerussian.com using GnuCash at SVN revision 16880. It imported without incident. It looks like this bug has been fixed.
Okay, then I'll close this as a duplicate of #510940, because it sounds like it's been fixed. *** This bug has been marked as a duplicate of 510940 ***
I think 510940 is a different bug, because the backtrace shows a completely different part of the Scheme code. But I do think this one is fixed, regardless.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=339892. Please update any external references or bookmarks.