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 353986 - gnucash crash on ofx directconnect import
gnucash crash on ofx directconnect import
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Import - AqBanking
git-master
Other All
: Normal critical
: ---
Assigned To: Christian Stimming
Christian Stimming
: 392890 416687 428387 473849 474717 490969 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-09-02 16:36 UTC by Pete
Modified: 2018-06-29 21:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pete 2006-09-02 16:36:02 UTC
Steps to reproduce:
1. start gnucash
2. get transactions through (suspect) directconnect aqbanking setup; aqbanking returns std::out_of_range error
3. gnucash crashes


Stack trace:
  • #0 raise
    from /lib/libc.so.6
  • #1 abort
    from /lib/libc.so.6
  • #2 __gnu_cxx::__verbose_terminate_handler
    from /usr/lib/libstdc++.so.6
  • #3 __gxx_personality_v0
    from /usr/lib/libstdc++.so.6
  • #4 std::terminate
    from /usr/lib/libstdc++.so.6
  • #5 __cxa_throw
    from /usr/lib/libstdc++.so.6
  • #6 std::__throw_out_of_range
    from /usr/lib/libstdc++.so.6
  • #7 libofx_proc_buffer
    at basic_string.h line 301
  • #8 ??
  • #9 ??


Other information:
Other directconnect setups work fine (other banks), but this error forces a gnucash crash.  LibOFX, Gwenhywfar, AqBanking, and Gnucash are all compiled from CVS/SVN.  I'm using ubuntu dapper on an amd64.

Below is stdout text:

3:2006/09/02 12-13-49:(null)(10461):provider.c:  735: Port is: 443
3:2006/09/02 12-13-49:gwen(10461):directory_all.c:  299: Trying "/home/user/unstable/gwenhywfar/etc/gwen-public-ca.crt"
3:2006/09/02 12-13-49:gwen(10461):directory_all.c:  306: File "gwen-public-ca.crt" found in folder "/home/user/unstable/gwenhywfar/etc"
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::erase
Comment 1 Pete 2006-09-02 16:57:27 UTC
Using Gnucash r14782, aqbanking r1055, gwenhywfar r1085.
Comment 2 Christian Stimming 2006-09-02 18:52:03 UTC
Thanks for reporting this problem. However, as you can read from the stack trace, the actual error occurs inside libofx, not in aqbanking. Can you please tell us the exact libofx version -- if from CVS, the latest date in the ChangeLog? Also, can you please recompile libofx with -g and without -O2 so that the stack trace shows a bit more details in the libofx_proc_buffer function? Apart from this, I can only guess you need to do some more error reporting at the libofx project, because neither gnucash nor aqbanking could fix a problem of libofx.
Comment 3 Pete 2006-09-02 23:56:55 UTC
The latest entry in the libofx Changelog is from 3/8/2006. Here's the more verbose trace:

  • #0 raise
    from /lib/libc.so.6
  • #1 abort
    from /lib/libc.so.6
  • #2 __gnu_cxx::__verbose_terminate_handler
    from /usr/lib/libstdc++.so.6
  • #3 __gxx_personality_v0
    from /usr/lib/libstdc++.so.6
  • #4 std::terminate
    from /usr/lib/libstdc++.so.6
  • #5 __cxa_throw
    from /usr/lib/libstdc++.so.6
  • #6 std::__throw_out_of_range
    from /usr/lib/libstdc++.so.6
  • #7 std::string::erase
    from /usr/lib/libstdc++.so.6
  • #8 libofx_proc_buffer
    at ofx_preproc.cpp line 274
  • #9 ??
  • #10 ??

I'll also report this to libofx...
Comment 4 Christian Stimming 2006-09-14 11:46:39 UTC
libofx bug is https://sourceforge.net/tracker/index.php?func=detail&aid=1551599&group_id=61170&atid=496353 but I'll continue the discussion here because bugzilla is more comfortable.

Can you add two more bits of information, please: Did you obtain this stack trace within "gdb"? If no, please see http://wiki.gnucash.org/wiki/Stack_Trace on how to do this. If yes, please run (after the crash) the following commands inside gdb:

 up 8
 print s
 print pos
 print s_buffer

and give us the complete output. Thanks. 

The error is clearly caused by the command s_buffer.erase(pos+6) as "pos+6" is probably larger than the size of the s_buffer. However, it isn't obvious how this could be caused. The command should probably be prefixed by an if(s_buffer.size()>pos+6).
Comment 5 Christian Stimming 2006-09-20 10:01:17 UTC
Also, can you try to fix this by editing the libofx file libofx/lib/ofx_preproc.cpp and change the line 274 so that it reads

  // erase everything after the /OFX tag
  if(s_buffer.size()>pos+6) s_buffer.erase(pos+6);

Then compile and install libofx, and check whether the error still occurs.
Comment 6 Pete 2006-09-27 05:41:15 UTC
After some wrestling to recompile libofx (I needed to uninstall gengetopt to get the problem libofx to compile again), here is the gdb dump.  Gnucash still crashes.

(gdb) up 8
  • #8 libofx_proc_buffer
    at ofx_preproc.cpp line 274
  • #0 raise
    from /lib/libc.so.6
  • #1 abort
    from /lib/libc.so.6
  • #2 __gnu_cxx::__verbose_terminate_handler
    from /usr/lib/libstdc++.so.6
  • #3 __gxx_personality_v0
    from /usr/lib/libstdc++.so.6
  • #4 std::terminate
    from /usr/lib/libstdc++.so.6
  • #5 __cxa_throw
    from /usr/lib/libstdc++.so.6
  • #6 std::__throw_out_of_range
    from /usr/lib/libstdc++.so.6
  • #7 std::string::erase
    from /usr/lib/libstdc++.so.6
  • #8 libofx_proc_buffer
    at ofx_preproc.cpp line 274
  • #9 ??
  • #10 ??


If I change ofx_preproc.cpp as you suggested, gnucash simply gives an Information box that says "The HBCI import returned no transactions for the selected time period."  Nothing crashes.

Interestingly, the same actions don't produce a crash if I use [the latest] libofx 25/8/06, gwenhywfar r1090, aqbanking r1068, and gnucash r14892.  An Error box pops up that says "Error executing backend's queue.  What shall I do? Continue/Abort."

Thanks for all your help,
Pete
Comment 7 Christian Stimming 2006-09-27 11:04:50 UTC
Thanks for the additional details. The crash should be fixed in libofx and/or in aqbanking soon. 

But I guess additionally you would like to be able to retrieve your account statments. For this, we need additional ofx-directconnect debugging, which is available if you define the environment variable AQOFX_LOG_COMM to some value. THen, the ofx-directconnect code of aqbanking will create the log file /tmp/ofx.log, which might give you some hints about why there is a server error.
Comment 8 Christian Stimming 2006-11-02 10:51:34 UTC
The crash is fixed in libofx-CVS (which will hopefully some day become libofx 0.8.3) by this change http://libofx.cvs.sourceforge.net/libofx/libofx/lib/ofx_preproc.cpp?r1=1.15&r2=1.16
Comment 9 Christian Stimming 2007-01-05 09:28:50 UTC
*** Bug 392890 has been marked as a duplicate of this bug. ***
Comment 10 Christian Stimming 2007-01-09 08:45:34 UTC
libofx 0.8.3 is released which fixes this crash.
Comment 11 nkrish 2007-03-11 19:49:44 UTC
*** Bug 416687 has been marked as a duplicate of this bug. ***
Comment 12 Christian Stimming 2007-04-17 12:12:39 UTC
*** Bug 428387 has been marked as a duplicate of this bug. ***
Comment 13 Andreas Köhler 2007-09-08 00:01:54 UTC
*** Bug 474717 has been marked as a duplicate of this bug. ***
Comment 14 Christian Stimming 2007-10-27 09:30:35 UTC
*** Bug 473849 has been marked as a duplicate of this bug. ***
Comment 15 Andreas Köhler 2007-10-28 11:15:18 UTC
*** Bug 490969 has been marked as a duplicate of this bug. ***
Comment 16 John Ralls 2018-06-29 21:12:15 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=353986. Please update any external references or bookmarks.