[Ecls-list] More thoughts on signals, stack overflows, etc

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Tue Oct 7 21:08:49 UTC 2008


On Tue, Oct 7, 2008 at 12:54 PM, Waldek Hebisch
<hebisch at math.uni.wroc.pl> wrote:
> Maybe this is what you have in mind, but not what you wrote.  My
> reading of "harmless loop" is one that does not call non-interruptible
> functions.  Under literal reading of your proposal a) (and in the
> spirit of www.securecoding.cert.org) such loop would still contain
> checks for interrupts -- clearly performance disaster.  OTOH if
> check are linited to library calls performace impact may be
> negligible -- non-interruptible calls typically are slow anyway

Ok, you were ahead of me on the choice of what to call safe points. I
just was thinking about the fact that signals would have to be
deferred to a point which is considered safe and perhaps insert checks
for pending interrupts at certain points.

It is true that one may just constrain the non-interruptible flags to
regions which we know call unsafe C functions. I am only worried that
this quickly gets hard to maintain, and that compiled lisp code may
itself contain calls to C functions which might or might not need
protection. Let's see.

In any case I already have an implementation of the trick I mentioned
before: a single flag for preventing interrupts and which also serves
as a write barrier that is activated whenever there are pending
interrupts. I am having problems because the code only works in OS X
and it simply fails on Ubuntu with a third-party version of the
Boehm-Weiser library.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)
http://juanjose.garciaripoll.googlepages.com


More information about the ecl-devel mailing list