This is something for kristjan to look into when he gets the time :)<span></span><br><br>On Tuesday, April 17, 2012, Gil Colgate wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Did this meet with anyone's approval?<br><br><div class="gmail_quote">On Mon, Apr 9, 2012 at 11:43 AM, Gil Colgate <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'gcolgate@gmail.com');" target="_blank">gcolgate@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here is a fix for the exception handler, I included just the .patch.<br><br> This corrects the problems with python having a different exception the environment when the item is called again.<br> <br>
In the previous code, whenever a python tasklet was suspended the top
of the exception chain was saved. This very well could be a pointer into
code above the python stack into the main program. When the python
tasklet is called again, it's stack is put back *in the same place*, but
the environment above the stack *might be different*. This would cause
the exception chain to screw up in the part where the exception chain
points above the stack. This was the cause of the broken exception chain
bug.<br>
<br> <br> If a tasklet has none of it's own exception
chains, we will discover this by reading the exception list and seeing
that the address is above the stack, so we don't need to save or restore
it it.<br>
<br> If, on the other hand, the tasklet has a chain we save it.
When restoring it we look at the current chain and insert the chain from
the restored stack into it at the appropriate spot, so that the
tasklet's chain points correctly into it's parent's change.<br>
<br> Stack slicing: Stackless in general has a problem with stack
slicing. This code will work in when the stack is sliced (I tested it
with 2K stack slices and try-catches everywhere) but certain exceptions
that belonged to inactive stack slices will not be executed since they
are not currently linked into the chain.
</blockquote></div><br>
</blockquote>