[Top][All Lists]

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

Re: [Gcl-devel] (random tester) Error in FUNCALL [or a callee]: Caught f

From: Camm Maguire
Subject: Re: [Gcl-devel] (random tester) Error in FUNCALL [or a callee]: Caught fatal error [memory may be damaged]
Date: 14 Nov 2003 12:00:37 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, Paul, and thanks as always for your reports!  Just wanted
to say that both of these are due to a mishandling of the variable
compiler::*ccb-vs* only when the safety optimize setting is set to 3.
Paradoxically, safety 3 compilation is likely less robust than the
other settings due to lack of use and consequent bug
reports/feedback.  I'll try to commit a fix shortly.  It is similar in
origin to the last fix regarding labels.  Briefly, the compiler counts
how many "closure boundaries" separate the variable from the
reference, and uses this number in locating the variable in the
environment.  One of the compiler functions is missing a rebinding of
*ccb-vs*, aka &aux (*ccb-vs* *ccb-vs*), causing the number to be
incorrect.  Just in case anyone else would like to look into it as

One day I'd really like your and others advice on some lisp
programming dos and donts.  In particular, I frequently don't
understand why global special variables are used in place of
explicitly passed arguments.  My understanding of the rules governing
lexical and dynamic binding are still a bit primitive, with the latter
in my mind basically being equivalent to protecting a body of code
with an assignment to a C global and a save of the original value on
entry, and a restore of the old value on exit.

Take care,

"Paul F. Dietz" <address@hidden> writes:

> Here's another example where memory is getting corrupted
> somehow in a compiled function with flet/labels.  Again,
> this only shows up when I've loaded gclload1.lsp.
> (load "gclload1.lsp")
> (defparameter *fn*
>    '(lambda (a)
>       (labels ((%f6 (f6-1 f6-2)
>                  (handler-case
>                   (labels ((%f2 nil (logior a)))
>                     (if (eql (%f2) (%f2))
>                         2829254 -10723))
>                   (error (c) (error c))
>                   )))
>         (funcall #'%f6 10 20)
>         )))
> (print (funcall (compile nil *fn*) -1139481))
> (The handler-case, if removed, causes the bug to go away.)
>       Paul
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

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