Skip to content
Tcl Source Code View Ticket
Login

View Ticket

can NRE break limits and script cancellation?

Open2035893fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-08-02 12:25:01
Understand and makes sure that NRE, and in particular the ability to run arbitrary code in the callbacks, did not open gaping holes in those mechanisms. 

If it did, FIX it.
dkfplain2009-03-25 16:14:58
What they can't do is run arbitrary Tcl code (at least for limits) since they'll hit the traps again.
mistachkinplain2009-03-25 17:19:14
I do not understand NRE well enough yet to know if it can somehow bypass script cancellation.  Are there specific things to look for (e.g. perhaps, things that are not covered by the current tests)?
msoferplain2009-05-12 22:43:16
The issue is: during cancellation every callback is run - necessary for cleanup. If a callback launches a new evaluation, it will not run (as the intrep is marked as being cancelled or beyond its limits). If a callback launches some long-running or cpu-eating C code ... cancellation is postponed until it returns! 

Not too different from what would happen if you try to cancel or pass a limit while running some C code. The one diff is: the first scenario will not cancel until a return to Tcl happens; in the new scenario Tcl thinks it has already cancelled before bad stuff happens.

So the new problem is: we now have a new way for a C extension to refuse being cancelled!
Log in (anonymous is fine) to add a comment.