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 575778 - GnuCash 2.2.9 crashes importing QIF transactions
GnuCash 2.2.9 crashes importing QIF transactions
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Import - QIF
2.2.9
Other Windows
: Normal critical
: ---
Assigned To: Charles Day
Derek Atkins
Depends on:
Blocks:
 
 
Reported: 2009-03-18 01:21 UTC by Dave Lovelace
Modified: 2018-06-29 22:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dave Lovelace 2009-03-18 01:21:06 UTC
I've just downloaded & installed GnuCash.  It says it's 2.2.9, built from r17949M on 2009-02-23.  I'm trying to import my data from Quicken 2001 Basic.  I'm running on MS Windows XP Professional.  (Not sure where to look for more detail on that.)

If I save a QIF that includes only accounts & categories, it imports fine.  It goes through a parsing step; then it asks me for a bunch of decisions about what GnuCash accounts it should use, & I accept its choices.  (Mostly just the same as the Quicken names.)  Then it asks me to click Verify, & the accounts appear after a couple of minutes.

If, however, the file contains transactions, it does everything up until the Verify step.  When I click Forward before that, the program just terminates - the main window closes, the Import window closes, & it vanishes from the taskbar.  It leaves my file locked; if I run GnuCash again, I get a warning that the file is locked & that this probably means another user has it open.  If I tell it to go ahead anyway, nothing has been added.

I'm hoping to avoid buying a new version of Quicken, & GnuCash sounds good.  But importing about 15 years' worth of transactions is needed.  I'm really hoping you can help.  Thank you.
Comment 1 Dave Lovelace 2009-03-18 10:50:04 UTC
Where I said "Verify", I should have said "Apply".  Sorry.
Comment 2 palfrey 2009-03-18 15:30:33 UTC
(In reply to comment #0)
> If, however, the file contains transactions, it does everything up until the
> Verify step.  When I click Forward before that, the program just terminates -
> the main window closes, the Import window closes, & it vanishes from the
> taskbar.  It leaves my file locked; if I run GnuCash again, I get a warning
> that the file is locked & that this probably means another user has it open. 
> If I tell it to go ahead anyway, nothing has been added.

The problem is that this would be a crash in GnuCash, and so we need to get more information about exactly where the crash occurred. If this was under Linux, I'd ask for a stack trace (which is fairly easy to do under Linux, and generally the tools are already installed). If you're willing to do so however, there's instructions at http://wiki.gnucash.org/wiki/Windows#Debugging_with_gdb about getting a stack trace under Windows. They're not too awful, but do require a bit more work on your part. Thanks!
Comment 3 Dave Lovelace 2009-03-18 17:28:10 UTC
Thank you.
(1)  I have more information, to correct something that seemed to be true but I've now found to be false.  I'd tried cutting down to smaller & smaller date ranges for transactions, & it had crashed every time.  While waiting for your answer, I tried limiting it to a couple of days' worth (only two transactions).  GnuCash loaded this without crashing.  It seems possible that QIF file size is relevant, or else that some group of transactions (scattered well through my data) causes the crash.

(2) The instructions for getting a stack trace could use some work.  (For one thing, ".cmd" not ".bat".  For another, when I clicked on "Select" for the QIF file, it seemed to just hang.  I finally went back to the gdb window, & it was telling me to press return to continue or q return to quit.)

(3) After I continued it, it crashed as usual.  I did bt in the gdb window, & got "No stack."  I'm not sure what to do next, & I need to work on other stuff, so I'll quit it.  But I'll paste in below a lot of stuff that was showing on the screen.  (The window's buffer had overrun, or I'd give it all to you.  This probably isn't helpful, but just in case, I'm doing it.)

Thanks for any help you can give.

-- Dave

---Type <return> to continue, or q <return> to quit---
gdb: child_resume.SetThreadContext: thread 3108.0xe04
ContinueDebugEvent (cpid=3108, ctid=3588, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3444 code=EXIT_THREAD_DEBUG_EVENT)
ContinueDebugEvent (cpid=3108, ctid=3444, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=9bc code=CREATE_THREAD_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0x9bc
ContinueDebugEvent (cpid=3108, ctid=2492, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3588 code=LOAD_DLL_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0xe04
ContinueDebugEvent (cpid=3108, ctid=3588, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3588 code=LOAD_DLL_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0xe04
ContinueDebugEvent (cpid=3108, ctid=3588, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3588 code=LOAD_DLL_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0xe04
ContinueDebugEvent (cpid=3108, ctid=3588, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3588 code=LOAD_DLL_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0xe04
ContinueDebugEvent (cpid=3108, ctid=3588, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3588 code=LOAD_DLL_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0xe04
ContinueDebugEvent (cpid=3108, ctid=3588, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=b1c code=CREATE_THREAD_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0xb1c
ContinueDebugEvent (cpid=3108, ctid=2844, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=2492 code=EXIT_THREAD_DEBUG_EVENT)
ContinueDebugEvent (cpid=3108, ctid=2492, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=d18 code=CREATE_THREAD_DEBUG_EVENT)
gdb: child_resume.SetThreadContext: thread 3108.0xd18
ContinueDebugEvent (cpid=3108, ctid=3352, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=2844 code=EXIT_THREAD_DEBUG_EVENT)
ContinueDebugEvent (cpid=3108, ctid=2844, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3352 code=EXIT_THREAD_DEBUG_EVENT)
ContinueDebugEvent (cpid=3108, ctid=3352, DBG_CONTINUE);
gdb: kernel event for pid=3108 tid=3588 code=EXIT_PROCESS_DEBUG_EVENT)

Program exited with code 02.
ContinueDebugEvent (cpid=3108, ctid=3588, DBG_CONTINUE);
gdb: child_close, inferior_ptid=3588
(gdb) bt
No stack.
(gdb)
Comment 4 Dave Lovelace 2009-03-19 18:25:56 UTC
I wrote an awk (gawk) program to convert a tab-delimited file to a QIF file.  After some initial debugging, I imported the file.  It took several hours (not sure how long, as I finally left it unattended.  It pointed up need for some more debugging of my conversion program (as well as some previously-unnoticed anomalies in the Quicken data, which we'll be fixing).  But I won't have time to do this & run it (with a several-hour import) for quite a while.

What was the problem with the gdb run?  Why would it show "No stack"?  Is there something else I need to set?  I'd like to use Quicken's QIF file instead of trying to debug a conversion program.  Thanks.  (I used gdb for a while, but it was many years ago, & I really remember nothing about it.)
Comment 5 Phil Longstaff 2009-04-27 15:23:38 UTC
Please check my understanding: you exported the QIF file from Quicken and want to import it into gnucash.  You start with a blank gnucash file.  If the QIF file contains just accounts, you can import it and create new gnucash accounts to match the QIF account names.  However, if the QIF file also contains transactions, it crashes.  Is this correct?

If you repeat this procedure, does the problem happen every time or just occasionally?

The most useful thing you could provide would be an example file which demonstrates the problem.  15 years of data would be a huge file.  Can you find a smaller file which has the problem.  Can you export the data in 2 pieces (first 7 1/2 years, then second 7 1/2 years), then import the 1st half then the 2nd half and see if it still happens?  Maybe try again and just import the 2nd half (does it include all of the accounts needed?).  Once you narrow down to which half, can you narrow down again?
Comment 6 Charles Day 2009-04-27 17:17:29 UTC
I'm a little confused as to the timing of the crash. As far as I can recall, there isn't an "Apply" button. Do you mean "Finish"?

Also, you said the crash occurs after you click "forward". What is the title of the window (or the principal label within the window) just before you click "forward"?

Can you find a gnucash trace file that matches up with the crash? The filename starts with "gnucash.trace" and should be in \windows\temp (if not, you may have to search your entire system for gnucash.trace*)

There will be multiple trace files, so you'll have to reproduce the crash and pick the latest one, or else look through them for error messages and/or backtraces.
Comment 7 Brian 2009-08-25 18:55:12 UTC
I'm having the exact same problem importing a QIF export from Quicken 2007 (Mac) into GnuCash 2.2.9 (the new Mac binary distribution Sourceforge).  The import fails on the very last step.

8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] Backtrace: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] In unknown file: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]    ?:  0* [qif-import:update-security-hash # # # ...] 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] In /Applications/GnuCash-Intel.app/Contents/Resources/share/gnucash/scm/qif-import/qif-dialog-utils.scm: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  745:  1* (let ((names #)) (hash-fold (lambda # #) #f ...) ...) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  746:  2* [hash-fold #<procedure #f (qif-name map-entry p)> #f ...] 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] In unknown file: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]    ?:  3* [#<procedure #f #> "Investments:CIFRA" # #f] 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] In /Applications/GnuCash-Intel.app/Contents/Resources/share/gnucash/scm/qif-import/qif-dialog-utils.scm: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  748:  4* (let ((security-name #)) (if (and security-name # # ...) (let # #)) #f) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  751:  5* (if (and security-name # # ...) (let # #)) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  759:  6  (let ((existing-gnc-acct #) (book #)) (if (and # #) (let # #) ...)) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]     ... 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  777:  7  (let* (# # #) (if # #) (hash-set! security-hash security-name #) ...) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  781:  8* [qif-ticker-map:lookup-type #<qif-ticker-map stocks: (# # # ...)> "CIFRA"] 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] In /Applications/GnuCash-Intel.app/Contents/Resources/share/gnucash/scm/qif-import/qif-objects.scm: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  679:  9  (let (#) (for-each # #) retval) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  680: 10* [for-each #<procedure #f (symbol)> (# # # # ...)] 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] In unknown file: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]    ?: 11  (if (null? rest) (letrec ((lp #)) (lp list1)) ...) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]     ... 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]    ?: 12  (begin (f (car l)) (lp (cdr l))) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]    ?: 13* [#<procedure #f #> #] 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] In /Applications/GnuCash-Intel.app/Contents/Resources/share/gnucash/scm/qif-import/qif-objects.scm: 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  682: 14  (if (string=? name #) (begin # #)) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]     ... 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  685: 15  (if (string=? retval "") (set! retval #f)) 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098]  685: 16* [string=? #f ""] 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] /Applications/GnuCash-Intel.app/Contents/Resources/share/gnucash/scm/qif-import/qif-objects.scm:685:18: In procedure string=? in expression (string=? retval ""): 
8/25/2009 2:16:58 PM [0x0-0x94094].org.gnucash.GnuCash[1098] /Applications/GnuCash-Intel.app/Contents/Resources/share/gnucash/scm/qif-import/qif-objects.scm:685:18: Wrong type argument in position 1 (expecting STRINGP): #f
Comment 8 Charles Day 2009-08-25 21:05:28 UTC
Thanks for that nice backtrace. Fix committed in r18279.

To test this, could you replace your installed copy of qif-objects.scm (make a backup first) with the one found here:
http://svn.gnucash.org/trac/browser/gnucash/trunk/src/import-export/qif-import/qif-objects.scm?rev=18279&format=txt

Then restart GnuCash. Does that fix the problem?
Comment 9 Charles Day 2009-08-25 21:08:25 UTC
When you click the link in comment 8, just watch out that it doesn't tack on a ".txt" to the filename. The file needs to be named: qif-objects.scm
Comment 10 Brian 2009-08-25 21:39:01 UTC
Fixed. Awesome!

I did a quick and dirty import and the process completed. Even with a more careful import it looks like a fair amount of cleanup will be needed, but I expected that (it is 15 years of data subjected to Intuit Quicken's abuse).

As an aside: Very glad to see a binary distribution for the Mac!  With Quicken on it's heels this is the perfect time for GnuCash to makes some noise.
Comment 11 Charles Day 2009-08-25 22:57:40 UTC
Sweet, glad the fix worked for you.
Comment 12 John Ralls 2018-06-29 22:19:33 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=575778. Please update any external references or bookmarks.