[Ecls-list] Segmentation faults/detected access to ...address

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Mar 14 08:46:58 UTC 2010


On Sun, Mar 14, 2010 at 2:08 AM, Seth Burleigh <seth at tewebs.com> wrote:

> What platform are you using? I updated ecl from the repository and I
> still get a segmentation fault with the new code. I did manage to avoid
> this by wrapping the code in a handler-case block and then returning nil
> on an error, but it would be nice if an error was indicated by a valuate
> that could never have been returned by the lisp code.
>
>
Seth, what you are describing is what ext:safe-eval does in the last commit
I uploaded yesterday night

(defun safe-eval (form env &optional (err-value nil err-value-p))
  (let ((output nil) (ok nil))
    (unwind-protect
         (handler-bind ((serious-condition
                         (if err-value-p
                             #'(lambda (c)
                                 (return-from safe-eval err-value))
                             #'invoke-debugger)))
           (setf output (si::eval-with-env form env)
                 ok t))
      (return-from safe-eval (if ok output err-value)))))

You not only have to recompile your code, you have to update and recompile
ECL.

The whole code is wrapped in a handler-case and returns the THIRD VALUE you
supplied to cl_safe_eval(). So if this value is not meaningful, sorry, but
it is your fault.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100314/b20cb53c/attachment.html>


More information about the ecl-devel mailing list