bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Has bignumber support changed since 1.4?


From: Crowder, Brian
Subject: RE: Has bignumber support changed since 1.4?
Date: Thu, 13 Sep 2001 16:34:22 -0700

I managed to fix my crash, btw, by adding a cast to numbers.h at line 64,

#define SCM_MOST_POSITIVE_FIXNUM (long)((1L << (SCM_I_FIXNUM_BIT - 1)) - 1)

I think the MSVC compiler was interpreting this as unsigned (and thus
interpreting SCM_MOST_NEGATIVE_FIXNUM as unsigned).  This causes the
creation of INUM-sized bignums (because NO numbers are SCM_FIXABLE()), which
in turn causes (specifically) scm_sum() to send inappropriate parameters to
scm_addbig() (nx is BIGGER THAN SCM_NUMDIGS(bigy)!!!)

All of this put together was causing scm_addbig() not to create enough space
for "z", and then overwriting a small piece of memory (which is detected in
MSVC's debug build during free() -- thus the failed GC)

If anyone has anymore questions about this, please let me know.

Thanks,
  Brian

-----Original Message-----
From: Dirk Herrmann [mailto:address@hidden
Sent: Monday, September 10, 2001 3:12 PM
To: Crowder, Brian
Cc: Guile Bug Mailing List
Subject: RE: Has bignumber support changed since 1.4?


On Mon, 10 Sep 2001, Crowder, Brian wrote:

> The (gc) in the homeworld.scm code will cause a crash on Win32, with a
> guile-1.5.1 I built...  (admittedly, the build is probably a bit sketchy,
> but I used the same technique on 1.4.1 and it worked okay --- configure
> under Cygwin tools, and then plug resulting files into MSVC project).

Sorry, but your code example is not very helpful.  Could you please try to
produce a _minimum_ but _complete_ piece of code that allows to reproduce
the error?  Since you are working with smobs, it is very likely that there
is something wrong with your smob code.

And, btw., bignums start at 536870912, at least on linux.  You can find
the corresponding constant by executing (+ most-positive-fixnum 1) at the 
guile prompt.

Best regards
Dirk Herrmann



reply via email to

[Prev in Thread] Current Thread [Next in Thread]