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 784632 - Importing of at least OFX, QIF, QFX, CSV on Windows results in a crash (in glib?). (Regression?)
Importing of at least OFX, QIF, QFX, CSV on Windows results in a crash (in gl...
Status: RESOLVED OBSOLETE
Product: GnuCash
Classification: Other
Component: Import - Other
2.6.17
Other Windows
: Normal major
: ---
Assigned To: gnucash-import-maint
gnucash-import-maint
Depends on:
Blocks:
 
 
Reported: 2017-07-06 18:14 UTC by Mikhail Titov
Modified: 2018-06-29 23:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
offending ofx file (36.36 KB, text/plain)
2017-07-06 18:14 UTC, Mikhail Titov
Details

Description Mikhail Titov 2017-07-06 18:14:34 UTC
Created attachment 355035 [details]
offending ofx file

I am unable to import either OFX, QFX, QIF, or CSV exported from Citi cards with 2.6.17. All attempts with formats mentioned but CSV result in a crash when "Select Account" window is about to be rendered. CSV goes a bit further, allowing me to set mapping and crashes when I see imported transactions.

I do not have debug build at hand, but my gut feeling is that this might be related to different underlying libraries being shipped with Windows build. The problem persists with brand new xml storage as I thought that might was messed up somehow.

P.S. I am somewhat not sure whether something changed within Citi. Usually I use AqBanking etc, but it shows "Direct debit;" prepended to every transaction. So I decided to try manual import. I did not have either of these problems with previous GnuCash versions.

P.P.S. I'm running Windows 10 Pro Insider Preview build 16232 (64 bit).

>	ntdll.dll!77def0ec()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]	
 	[External Code]	
 	libglib-2.0-0.dll!685f1b51()	Unknown
 	libglib-2.0-0.dll!685f2005()	Unknown
 	libgtk-win32-2.0-0.dll!617d1013()	Unknown
 	libgncmod-generic-import.dll!6df81d66()	Unknown
 	libgncmod-ofx.dll!0a4b3010()	Unknown
 	libofx-6.dll!0a4c3b1d()	Unknown
 	libofx-6.dll!0a4cbbbe()	Unknown
 	libofx-6.dll!0a4c9c95()	Unknown
 	libofx-6.dll!0a4ea072()	Unknown
 	libosp-5.dll!0a7413d6()	Unknown
 	libosp-5.dll!0a787f74()	Unknown
 	libosp-5.dll!0a78c871()	Unknown
 	libosp-5.dll!0a74fd37()	Unknown
 	libosp-5.dll!0a74209b()	Unknown
 	libofx-6.dll!0a4e4bba()	Unknown
 	libofx-6.dll!0a4c7d97()	Unknown
Comment 1 John Ralls 2017-07-06 19:20:08 UTC
The "Direct Debit;" noise is due to https://github.com/Gnucash/gnucash/pull/139 bleeding over into OFX. For a workaround you can edit C:\Program Files (x86)\gnucash\share\glib-2.0\schemas\gnucash\ src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml line 24, changing "true" to "false".

I was able to import your OFX file into GnuCash 2.6.17 on Windows 10 without trouble. Is the stack trace for the csv or ofx crash?
Comment 2 John Ralls 2017-07-06 19:24:54 UTC
Do earlier versions of GnuCash work? The last change of underlying libs on the Windows build was a year ago.
Comment 3 Mikhail Titov 2017-07-06 20:59:38 UTC
I was wrong about regression. I tried all the way till 2.6.10. They do not work on Windows 10 Pro Insider Preview. 2.6.17 works alright on Windows 7 Enterprise SP1 (64 bit).

I guess I'll have to build it to get a detailed stack trace unless I can get a binary with symbols from somewhere...
Comment 4 Mikhail Titov 2017-07-06 21:01:00 UTC
> Is the stack trace for the csv or ofx crash?

That was for OFX in particular.
Comment 5 John Ralls 2017-07-07 18:05:46 UTC
A follow up on comment 1: There's a preference setting called "Use Non-SWIFT transaction text" in Preferences>Online Banking. Deselect it and the noise goes away on future imports.
Comment 6 Mikhail Titov 2017-07-08 19:22:48 UTC
Program received signal SIGSEGV, Segmentation fault.
0x7757f0ec in ?? ()
(gdb) bt
  • #0 ??
  • #1 poll_rest
  • #2 poll_rest
  • #3 g_poll
  • #4 g_main_context_poll
  • #5 g_main_context_iterate
  • #6 g_main_loop_run
  • #7 gtk_dialog_run
    at ../../gtk/gtkdialog.c line 1094
  • #8 gnc_import_select_account
  • #9 ofx_proc_account_cb
  • #10 LibofxContext::accountCallback
    at context.cpp line 70
  • #11 OfxAccountContainer::gen_event
    at ofx_container_account.cpp line 143
  • #12 _fu273___ZNSs4_Rep20_S_empty_rep_storageE
    at ofx_container_main.cpp line 175
  • #13 _fu1786___ZNSs4_Rep20_S_empty_rep_storageE
    at ofx_sgml.cpp line 264
  • #14 OpenSP::GenericEventHandler::endElement
    at GenericEventHandler.cxx line 155
  • #15 OpenSP::Parser::acceptEndTag
    at parseInstance.cxx line 1152
  • #16 OpenSP::Parser::doContent
    at parseInstance.cxx line 162
  • #17 OpenSP::Parser::parseAll
    at Parser.cxx line 254
  • #18 OpenSP::SgmlParser::parseAll
    at SgmlParser.cxx line 46
  • #19 OpenSP::ParserApp::parseAll
    at ParserApp.cxx line 97
  • #20 OpenSP::ParserEventGenerator::run
    at ParserEventGeneratorKit.cxx line 197
  • #21 _fu1633___ZNSs4_Rep20_S_empty_rep_storageE
    at ofx_sgml.cpp line 385
  • #22 _fu166___ZNSs4_Rep20_S_empty_rep_storageE
    at ofx_preproc.cpp line 385
  • #23 _fu69___ZNSs4_Rep20_S_empty_rep_storageE
    at file_preproc.cpp line 94
  • #24 _fu5__ofx_STATUS_msg
  • #25 gnc_plugin_ofx_cmd_import
  • #26 g_closure_invoke
  • #27 signal_emit_unlocked_R
  • #28 g_signal_emit_valist
  • #29 g_signal_emit
  • #30 _gtk_action_emit_activate
    at ../../gtk/gtkaction.c line 795
  • #31 _g_closure_invoke_va
  • #32 g_signal_emit_valist
  • #33 g_signal_emit
  • #34 gtk_widget_activate
    at ../../gtk/gtkwidget.c line 5041
  • #35 gtk_menu_shell_activate_item
    at ../../gtk/gtkmenushell.c line 1276
  • #36 gtk_menu_shell_button_release
    at ../../gtk/gtkmenushell.c line 703
  • #37 _gtk_marshal_BOOLEAN__BOXED
    at ../../gtk/gtkmarshalers.c line 86
  • #38 g_closure_invoke
  • #39 signal_emit_unlocked_R
  • #40 g_signal_emit_valist
  • #41 g_signal_emit
  • #42 gtk_widget_event_internal
    at ../../gtk/gtkwidget.c line 5010
  • #43 gtk_widget_event
    at ../../gtk/gtkwidget.c line 4807
  • #44 gtk_propagate_event
    at ../../gtk/gtkmain.c line 2490
  • #45 gtk_main_do_event
    at ../../gtk/gtkmain.c line 1685
  • #46 gdk_event_dispatch
    at ../../../gdk/win32/gdkevents-win32.c line 3606
  • #47 g_main_dispatch
  • #48 g_main_context_dispatch
  • #49 g_main_context_iterate
  • #50 g_main_loop_run
  • #51 gtk_main
    at ../../gtk/gtkmain.c line 1257
  • #52 gnc_ui_start_event_loop
  • #53 inner_main
  • #54 invoke_main_func
    at init.c line 367
  • #55 c_body
    at continuations.c line 349
  • #56 scm_c_catch
    at throw.c line 203
  • #57 scm_i_with_continuation_barrier
    at continuations.c line 325
  • #58 scm_c_with_continuation_barrier
    at continuations.c line 367
  • #59 scm_i_with_guile_and_parent
    at threads.c line 733
  • #60 scm_with_guile
    at threads.c line 721
  • #61 scm_boot_guile
    at init.c line 350
  • #62 main

Comment 7 Mikhail Titov 2017-07-08 19:28:58 UTC
And here is the trace for CSV import. Everything goes well until I close that import wizard window.

Program received signal SIGSEGV, Segmentation fault.
0x7757f0ec in ?? ()
(gdb) bt
  • #0 ??
  • #1 poll_rest
  • #2 poll_rest
  • #3 g_poll
  • #4 g_main_context_poll
  • #5 g_main_context_iterate
  • #6 g_main_loop_run
  • #7 gtk_main
    at ../../gtk/gtkmain.c line 1257
  • #8 gnc_ui_start_event_loop
  • #9 inner_main
  • #10 invoke_main_func
    at init.c line 367
  • #11 c_body
    at continuations.c line 349
  • #12 scm_c_catch
    at throw.c line 203
  • #13 scm_i_with_continuation_barrier
    at continuations.c line 325
  • #14 scm_c_with_continuation_barrier
    at continuations.c line 367
  • #15 scm_i_with_guile_and_parent
    at threads.c line 733
  • #16 scm_with_guile
    at threads.c line 721
  • #17 scm_boot_guile
    at init.c line 350
  • #18 main

Comment 8 John Ralls 2017-07-08 20:10:28 UTC
Both stack-smashes like Gwenhywfar in bug 781476 . Can you build glib yourself? If so, try building it with -fno-omit-frame-pointer.
Comment 9 Mikhail Titov 2017-07-10 17:10:12 UTC
I confirm, it looks like it is working with -fno-omit-frame-pointer. Here is what I did.

1) I got https://gensho.ftp.acc.umu.se/pub/gnome/sources/glib/2.42/glib-2.42.2.tar.xz so that I would not have to rebuild the rest thank to shared objects (dll). And unpacked it into /c/gcdev/123/glib-2.42.2

2) From there, I did
PKG_CONFIG=/c/gcdev/gnome/bin/pkg-config CC="gcc -ggdb3" CFLAGS="-fno-omit-frame-pointer -O0" ./configure --enable-debug=yes --prefix=c:/gcdev/gnome

The reason for -Og is because of https://sourceforge.net/p/mingw/bugs/2322/ as I found at http://trac.wxwidgets.org/ticket/17762#comment:9 . Otherwise there is no _strnicmp and alike.

3) PATH=$PATH:/c/gcdev/gnome/bin make install
Comment 10 Mikhail Titov 2017-07-10 17:22:48 UTC
I messed up the configure line in the previous message. It should read as

PKG_CONFIG=/c/gcdev/gnome/bin/pkg-config CC="gcc -ggdb3" CFLAGS="-Og -fno-omit-frame-pointer" ./configure --enable-debug=yes --prefix=c:/gcdev/gnome

Note -Og instead of -O0. It does not build with the latter.

P.S. /c/gcdev/gnome/bin is on the PATH for glib-compile-resources.exe dependencies during the make step.

Here is the error produced due to gcc bug (?) I mentioned

  CC       libglib_2_0_la-gconvert.lo
In file included from gconvert.c:33:0:
win_iconv.c: In function 'make_csconv':
win_iconv.c:914:9: error: implicit declaration of function '_stricmp' [-Werror=implicit-function-declaration]
         if (_stricmp(p + 2, "nocompat") == 0)
         ^
win_iconv.c: In function 'name_to_codepage':
win_iconv.c:1007:5: error: implicit declaration of function '_strnicmp' [-Werror=implicit-function-declaration]
     else if (_strnicmp(name, "cp", 2) == 0)
     ^
cc1.exe: some warnings being treated as errors
make[4]: *** [libglib_2_0_la-gconvert.lo] Error 1

P.P.S. C:\gcdev\gnucash\build\bin\gnucash-launcher.cmd misses another
set PATH=c:\gcdev\icu-mingw32\lib;%PATH%  . I guess it is C:\gcdev\gnucash-on-windows.git\install-impl.sh to patch. Other than this and -DCMAKE_BUILD_TYPE=Debug , gnucash-on-windows does magic building things!
Comment 11 Mikhail Titov 2017-07-10 18:02:54 UTC
I apologize for making the noise. Apparently I got yet another update for Windows Insider to build 16237. Original GnuCash 2.6.17 imports things just as fine. There is no way for me to rollback changes AFAIK :( I'll keep updating if things happen again.

P.S. Thanks for AqBanking settings tip. No noise in import anymore.
Comment 12 John Ralls 2017-07-10 20:54:37 UTC
I guess I shouldn't be surprised that it's a Windows problem, but that kind of thing makes life pretty difficult for application developers, especially those not using Microsoft's tools... though I suppose Microsoft has an interest in discouraging them.

The _stricmp/_strncmp errors being present only in unoptimized code is weird.

-fno-anything and -O0 is redundant. -O0 turns off all optimizations, and with gcc later optimization flags override earlier ones, so -fno-omit-frame-pointer -Og either turns omit-frame-pointer back on or -fno-omit-frame-pointer doesn't do anything because -Og doesn't turn it on anyway. The gcc documentation doesn't list what -Og turns on and I don't feel like wading through their source code to figure it out. What I actually wanted you to try was -fno-omit-frame-pointer with otherwise default (-O2) optimization, which you'd do either by not specifying a -Ox flag or by saying -O2 -fno-omit-frame-pointer.

All moot now, of course.
Comment 13 John Ralls 2018-06-29 23:57:55 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=784632. Please update any external references or bookmarks.