GNOME Bugzilla – Bug 389740
crash on QIF import with german umlaut (guile-1.8)
Last modified: 2018-06-29 21:19:37 UTC
GnuCash:gnucash-2.0.2-34.i586.rpm (r14936 2006-12-22) crash with QIF file import with german umlaut (äöüÄÖÜß). QIF example: !Type:Bank D18.12.06 T-0,01 MDT ZAHNÄRZTL. RECHENZENTRUM: RG-NR xxxx/12 A. HÖLSCHER DATUM 16.12.2006, 18.40 UHR 1.TAN 123456 PDT ZAHNÄRZTL. RECHENZENTRUM: RG-NR xxxx/12 A. HÖLSCHER DATUM 16.12.2006, 18.40 UHR 1.TAN 123456 ^
Hi. A couple of questions: 1) HOW does it crash? What's the stack trace? 2) Is the QIF file in ISO-8859-1 or UTF-8?
sorry for the missing information: 1) on console: "throw from within critical section." I installed bug-buddy and it send the bug report 389983 (I hope this is what you call a stack trace. I am not a programmer) 2) I'm not sure how to find out. Some enviroment variables: RC_LANG: de_DE@euro (all RC_LC*: undefined) CONSOLE_ENCODING: UTF-8 AUTO_DETECT_UTF8: no Thank you for the very quick response!
Hi, No, that's not what I meant in this case... In THIS case what I was hoping for what the "scheme" backtrace that should have been printed in the terminal where you started gnucash. The stack trace in bug #389983 shows me that the scheme interpreter is throwing an exception, but I need to see the actual exception that it threw. This would either get printed into the terminal where you started gnucash, or MAYBE printed into /tmp/gnucash.trace. But more likely it would be printed on the terminal. As for the QIF encoding, what do you get from: file /path/to/file.qif (not that that would tell us completely), but it's at least a hint.
Created attachment 78943 [details] test QIF file
Created attachment 78944 [details] /temp/gnucash.trace
I attached a test QIF file and the stack trace from /tmp/gnucash.trace I think the file command is of no help: /home/ah # file Giro-Konto.qif Giro-Konto.qif: Assembler source
Yeah, no help at all. So nothing was printed on the terminal where you run "gnucash &"?
Hi Derek, yes, that's right, only: "throw from within critical section."
Hmm. I can't reproduce this problem. When I try with either 2.0 or trunk the import succeeds just fine. I do see the "invalid UTF8" but no crashes. I'm using FC5, with guile-1.6.7-8.fc5
How can I help to find the problem? (SuSE 10.2, guile-1.8.1-24) With older versions (the one that came with SuSE 10.1) I had no problem with umlauts.
Um... I'm afraid my scheme skills aren't that strong. If you were able to extract a Scheme Backtrace then maybe I'd have a hint of where to look. I'll see what I can test on an FC6 VM I've got.
There was a crash in QIF import with guile-1.8 (as present on opensuse 10.2) that has been fixed in gnucash-2.0.3. Can you please upgrade and check again? Thanks.
*** Bug 389983 has been marked as a duplicate of this bug. ***
I installed ftp://ftp.gwdg.de/pub/linux/misc/suser-crauch/10.2/RPMS/i686/gnucash-2.0.3-0.rauch.1.i686.rpm This version crashes as soon as I press the ok button to acknowledge the qif file to import. I will attach gnucash.trace. The version 2.0.2 crashed later after doing all the account assignments. Normally my qif files are in iso8859-15. If I convert them to UTF-8 (iconv) there is no problem with the import function.
Created attachment 79173 [details] trace for gnucash-2.0.3
forgot to mention guile is: guile-1.8.1-24
I installed the new release 2.0.4: ftp://ftp.gwdg.de/pub/linux/misc/suser-crauch/10.2/RPMS/i686/gnucash-2.0.4-0.rauch.1.i686.rpm same behavior as with 2.0.3: crash as soon as I choose the qif file for import
I still cannot reproduce this here with FC5 and guile 1.6.7
Does not reproduce on r15387 on Windows XP.
*** Bug 412696 has been marked as a duplicate of this bug. ***
*** Bug 411365 has been marked as a duplicate of this bug. ***
*** Bug 412216 has been marked as a duplicate of this bug. ***
*** Bug 416910 has been marked as a duplicate of this bug. ***
*** Bug 418992 has been marked as a duplicate of this bug. ***
*** Bug 419472 has been marked as a duplicate of this bug. ***
*** Bug 422283 has been marked as a duplicate of this bug. ***
*** Bug 423070 has been marked as a duplicate of this bug. ***
*** Bug 424882 has been marked as a duplicate of this bug. ***
*** Bug 425468 has been marked as a duplicate of this bug. ***
*** Bug 427783 has been marked as a duplicate of this bug. ***
*** Bug 428359 has been marked as a duplicate of this bug. ***
*** Bug 428403 has been marked as a duplicate of this bug. ***
*** Bug 428776 has been marked as a duplicate of this bug. ***
Hi! I have the same problem with FC6, gnucash-2.0.5-1.fc6 and guile-1.8.0-8.20060831cvs on an x86 with all updates. Everything was installed with yum from the base and updates repository. My bank generates a .qif and I try to import it. It crashes after pressing the forward button at the dialog where i choose my currency (EURO). It is reproducable every time. I have installed bug buddy and the details of it are pasted at the bottom. WORKAROUND: I have found that it crashes only if there is a special character in the .qif (in my case these are central european - ISO8859-2 or CP1250). So I removed the special characters and it worked (but i think only because when i saved the file it saved it as utf8). Then i tried converting the .qif file to UTF8 with: iconv --from-code=CP1250 --to-code=UTF-8 filename.qif -o filename_utf8.qif and it worked too. So Andreas Hölscher could also try converting it from his encoding to utf8 and see if it works. I hope this helps. P.S.: Sorry for the long thread... This is what i get in the terminal: ----------------------------------- [peterf@dfg ~]$ gnucash throw from within critical section. BUG-BUDDY details: --------------------------------------------- Distribution: Fedora Core release 6 (Zod) Gnome Release: 2.16.3 2007-01-31 (Red Hat, Inc) BugBuddy Version: 2.16.0 System: Linux 2.6.20-1.2933.fc6 #1 SMP Mon Mar 19 11:38:26 EDT 2007 i686 X Vendor: The X.Org Foundation X Vendor Release: 70101000 Selinux: Enforcing Accessibility: Disabled Memory status: size: 121458688 vsize: 0 resident: 121458688 share: 0 rss: 45539328 rss_rlim: 0 CPU usage: start_time: 1176409926 rtime: 0 utime: 1065 stime: 0 cutime:1025 cstime: 0 timeout: 40 it_real_value: 0 frequency: 9 Backtrace was generated from '/usr/bin/gnucash' (no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1208174896 (LWP 26279)] (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) 0x00a83402 in __kernel_vsyscall ()
+ Trace 127278
Thread 1 (Thread -1208174896 (LWP 26279))
----------- .xsession-errors (178565 sec old) --------------------- Resource id: 0x1a5 kwin: X_SetInputFocus(0x2818084): BadMatch (invalid parameter attributes) X Error: BadPixmap (invalid Pixmap parameter) 4 Major opcode: 54 Minor opcode: 0 Resource id: 0x1431c53 X Error: BadMatch (invalid parameter attributes) 8 Major opcode: 158 Minor opcode: 6 Resource id: 0x1a5 kdeinit: Got EXEC_NEW 'kio_http' from launcher. DCOP: register 'anonymous-31220' -> number of clients is now 14 kdeinit: Got EXEC_NEW 'kio_http' from launcher. ...Too much output, ignoring rest... --------------------------------------------------
*** Bug 429696 has been marked as a duplicate of this bug. ***
*** Bug 434077 has been marked as a duplicate of this bug. ***
I can reproduce under Mandriva, using guile 1.8.1 and gnucash 2.0.5 The only message is "throw from within critical section." Here is the stacktrace :
+ Trace 131425
Start of the full bt :
+ Trace 131426
*** Bug 434695 has been marked as a duplicate of this bug. ***
*** Bug 434197 has been marked as a duplicate of this bug. ***
*** Bug 435676 has been marked as a duplicate of this bug. ***
*** Bug 439362 has been marked as a duplicate of this bug. ***
Thank you, Pascal. Your backtrace showed the error already.
+ Trace 134797
The problem is the following: In src/import-export/qif-import/qif-file.scm, line 74 (qif-file:read-file), we call (gnc-utf8-strip-invalid value) ;; changes value in-place This leaves the guile string in an unstable state, because it thinks it still has the length of 72 bytes, whereas the last bytes are zero ones. strings.c:scm_to_locale_stringn does the following: len = scm_i_string_length (str); res = scm_malloc (len + ((lenp==NULL)? 1 : 0)); memcpy (res, scm_i_string_chars (str), len); if (lenp == NULL) { res[len] = '\0'; if (strlen (res) != len) { free (res); scm_misc_error (NULL, "string contains #\\nul character: ~S", scm_list_1 (str)); } } so len==72, strlen(res)==70. How do we fix that best?
Hmm... I think that we need to change gnc-utf8-strip-invalid to not change the value in place. So the scheme would change to: (set! value (gnc:utf8-string-invalid value)) And we'd have to wrap a new function that doesn't modify the argument but instead creates a new string and returns it.
*** Bug 441123 has been marked as a duplicate of this bug. ***
*** Bug 441929 has been marked as a duplicate of this bug. ***
Oops, there is also gnc_utf8_strip_invalid_strdup :-) Fixed by r16135 for GnuCash 2.1.3. Thanks for the reports, help and patience.
*** Bug 394783 has been marked as a duplicate of this bug. ***
*** Bug 397137 has been marked as a duplicate of this bug. ***
*** Bug 442434 has been marked as a duplicate of this bug. ***
*** Bug 445751 has been marked as a duplicate of this bug. ***
*** Bug 446742 has been marked as a duplicate of this bug. ***
*** Bug 448549 has been marked as a duplicate of this bug. ***
*** Bug 450685 has been marked as a duplicate of this bug. ***
*** Bug 453515 has been marked as a duplicate of this bug. ***
*** Bug 454821 has been marked as a duplicate of this bug. ***
*** Bug 457586 has been marked as a duplicate of this bug. ***
*** Bug 473118 has been marked as a duplicate of this bug. ***
*** Bug 477028 has been marked as a duplicate of this bug. ***
*** Bug 477699 has been marked as a duplicate of this bug. ***
*** Bug 495014 has been marked as a duplicate of this bug. ***
*** Bug 498552 has been marked as a duplicate of this bug. ***
*** Bug 507132 has been marked as a duplicate of this bug. ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=389740. Please update any external references or bookmarks.