[Openmcl-devel] low level faults

Jared C. Davis jared at cs.utexas.edu
Tue Dec 2 07:59:59 PST 2014


Hi,

Suppose I do something utterly boneheaded like:

    (defun f (x)
      (declare (optimize (safety 0) (speed 3)))
      (rplacd x 1))

    (f 0)

This leads to an error like this: (on linux-x8664, at least)

    > Error: Fault during write to memory address #x-3
    > While executing: F, in process listener(1).
    > Type :POP to abort, :R for a list of available restarts.
    > Type :? for other options.

Is there a way to catch and handle this error?  It seems for instance
that (ignore-errors (f 0)) doesn't work and neither does, e.g.,:

    (handler-case
      (f 0)
      (error (condition)
             (format t "Caught error ~a~%" condition)))

Maybe I just need a handler-case for some condition other than "error"?

I understand that this kind of a fault is more serious than your
typical error that user-level code might provoke.  I imagine that
simply masking errors like this might be a terrible idea that could,
for instance, lead to memory corruption that could cause mysterious
errors later down the road, or that given other arguments F might
immediately lead to a segmentation fault or similar.

In my particular case, though, users are interacting with CCL via a
web interface and can't see the CCL console.  So if an error like this
occurs, I'd like to (try to) capture it and (try to) show it to the
user so that they know something has gone horribly wrong.

Thanks!
Jared

-- 
Jared C. Davis <jared at cs.utexas.edu>
11410 Windermere Meadows
Austin, TX 78759
http://www.cs.utexas.edu/users/jared/



More information about the Openmcl-devel mailing list