QIF Import fails out of CVS
Derek Atkins
warlord@MIT.EDU
13 Feb 2001 11:51:30 -0500
It might be a garbage-collection problem. I ran it under gdb and it
dies at a slightly different time (but under similar circumstances).
Namely, it asks me whether this file is in USD, and _then_ it dies.
It wasn't doing this before. Weird.
Anyways, I set a breakpoint in gweap_double_to_gnc_numeric and this is
what I get as I walk through the code:
Breakpoint 1, gwrap_double_to_gnc_numeric (scm_param0=1083809880,
scm_param1=2, scm_param2=6494) at gnc.c:11188
11188 SCM_ASSERT((scm_number_p(scm_param0) == SCM_BOOL_T),scm_param0,SCM_ARG1,gwrap_double_to_gnc_numeric_s);
(gdb) n
11189 SCM_ASSERT(gnc_gh_gint64_p(scm_param1),scm_param1,SCM_ARG2,gwrap_double_to_gnc_numeric_s);
(gdb)
11190 SCM_ASSERT(((scm_integer_p(scm_param2) == SCM_BOOL_T) && (scm_geq_p(scm_param2, gw__module_gw_runtime_scm_intmin) == SCM_BOOL_T) && (scm_leq_p(scm_param2, gw__module_gw_runtime_scm_intmax) == SCM_BOOL_T)),scm_param2,SCM_ARG3,gwrap_double_to_gnc_numeric_s);
(gdb)
11197 param0= gh_scm2double(scm_param0);
(gdb)
11198 param1 = gnc_scm_to_gint64(scm_param1);
(gdb) step
gnc_scm_to_gint64 (num=2) at gnc-helpers.c:594
594 SCM magnitude = scm_abs(num);
(gdb) n
595 SCM upper = scm_ash(magnitude, SCM_MAKINUM(-32));
(gdb)
601 if (upper_mask == SCM_BOOL_F)
(gdb)
608 SCM lower = scm_logand(magnitude, upper_mask);
(gdb) step
Backtrace:
...
So, as you can see, the problem happens in gnc_scm_to_gint64 when it
calls scm_logand().
-derek
grib@gnumatic.com (Bill Gribble) writes:
> On Tue, Feb 13, 2001 at 11:27:27AM -0500, Derek Atkins wrote:
> > 30* [#<procedure (n)> -19.59]
> > 31 (if n (gnc:double-to-gnc-numeric n GNC-DENOM-AUTO ...) ...)
> > 32 [gnc:double-to-gnc-numeric -19.59 0 ...]
> > /usr/gnucash/share/gnucash/scm/qif-import/qif-to-gnc.scm:362:24: In procedure gnc:double-to-gnc-numeric in expression (gnc:double-to-gnc-numeric n GNC-DENOM-AUTO ...):
> > /usr/gnucash/share/gnucash/scm/qif-import/qif-to-gnc.scm:362:24: Wrong type argument in position 2: 4294967295
>
> This makes no sense to me, and makes me think there's a garbage
> collection problem going on somewhere in there (the value it had
> problems with is defined to be 0 in gnc-numeric.scm).
>
> Let me poke around some more to make sure I'm not unprotecting
> something at an inopportune time. I don't see the problem under
> guile1.4 at all, and it's generally pickier about this than 1.3.
>
> b.g.
>
>
>
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord@MIT.EDU PGP key available