Subject: Crashing in maxima 5.13.0 on Debian amd64
From: Robert Dodier
Date: Mon, 24 Dec 2007 09:29:49 -0700
On 12/24/07, dlakelan <dlakelan at street-artists.org> wrote:
> Based on the responses both on and off list, I'm guessing that this code
> somehow activates a bug in either the GCL garbage collector, or the
> interpreter.
Dan, after looking at it some more, it appears the problem is in $SIGN,
or one of its callees, which is called to evaluate
if(nextval < curval or randnum < exp(-(nextval-curval)/temp))
It appears that in some cases, evaluating randnum < exp(...) eventually
calls some factorization code and gets stuck there.
(Maybe you could obviate the factorization stuff by evaluating exp(...)
to a number before making the comparison. Or maybe the comparison
should be like arithmetic, and coerce the non-float part to a float.
I guess we have a choice to make here.)
E.g. in a cvs version near 5.13.0 the following gets stuck somewhere
below PFACTORANY:
($SIGN
'((MPLUS SIMP) -0.557004213428695
((MEXPT SIMP) $%E
((MTIMES SIMP) -0.0922430377976618 ((MEXPT SIMP) 2 ((RAT SIMP) 33 50))
((MEXPT SIMP) 5 ((RAT SIMP) 33 50))))))
Incidentally trace output shows this:
(PFACTORANY '(#:|%e^(2^(33/50)*5^(33/50)/14039)16000| 1295 5682 0 -10201))
which seems to indicate the rationalized expression on which
PFACTORANY gets stuck.
But in a version near 5.14.0, PFACTORANY is not called, and $SIGN returns $POS.
I didn't look at the cvs log but I wouldn't be surprised if the sign
and/or factorization code was changed between 5.13.0 and 5.14.0.
HTH
Robert