[cffi-devel] protect C frames from Lisp non-local exits in callbacks

Martin Simmons martin at lispworks.com
Thu Jan 5 20:20:48 UTC 2006


>>>>> On Thu, 05 Jan 2006 13:10:59 -0600, Stephen Compall <s11 at member.fsf.org> said:

  Stephen> A brief discussion in #lisp pointed me to the EXIT-EXTENT:MINIMAL ANSI
  Stephen> issue[1].  The salient point is that there is no way to portably stop
  Stephen> all unwinding for a non-local exit at a particular point, due to this
  Stephen> case of undefined behavior:

  Stephen> ;;returns 2 under MEDIUM, is error under MINIMAL
  Stephen> (block a    
  Stephen>   (block b
  Stephen>     (unwind-protect (return-from a 1)
  Stephen>       (return-from b 2))))

  Stephen> A CL implementation that implements MEDIUM should still be fully
  Stephen> compliant with the MINIMAL decision.  Therefore, I would like to hear
  Stephen> from those with particular interest in any particular implementation
  Stephen> running CFFI: does implementation X implement EXIT-EXTENT:MEDIUM, and/or
  Stephen> does its callback definition form as exploited by cffi-sys:%defcallback
  Stephen> have some "magic" unwind stopping?

LispWorks implements MEDIUM.

-- 
Martin Simmons                              Email: martin at lispworks.com
LispWorks Ltd, St John's Innovation Centre    TEL:   +44 1223 421860
Cowley Road, Cambridge CB4 0WS, England.      FAX:   +44 870 2206189



More information about the cffi-devel mailing list