[squeak-dev] stack manipulation on signaled Exception (was Re: On the rejection of Promises due to errors)

Robert Withers robert.withers at pm.me
Tue Jun 23 13:06:03 UTC 2020

Hi Jakob,

I have new ideas, in thinking on this problem, one per point I made.

On 6/23/20 8:40 AM, Robert Withers wrote:

> I removed catch-all error handling from the PriorityVat>>#processSends. I then added to the error handling in EventualMessageSend>>#value to open a debugger after smashing the resolver.
>> value
>> | value |
>> [value := receiver
>> perform: selector
>> withArguments: (self collectArguments: arguments)
>> inSuperclass: receiver class.
>> self resolver notNil
>> ifTrue: [ self resolver resolve: value ] ]
>> on: Exception
>> do: [:ex |
>> self resolver notNil
>> ifTrue: [self resolver smash: ex].
>> Processor activeProcess signalException: ex].
> I have a couple of issues with this:
> - When I close the debugger, the EventualProcess with the stack that ended up in this exception is terminated. I would need this process to restart and continue, after clearing the stack from this exception. I am unsure how to make that happen. Any suggestions are MOST WELCOME!

> - I would like to copy the stack to the side and restart the Vat's eventLoop right away so that it does not deadlock the event loop process. And so continue processing message sends.

> -
> - The stack in the Debugger is not opened on the stack frame that causes the failure. I would like to rewind the stack to the bolded line, where the exception is produced, in this case it would be the method: ZeroDivide(Exception)>>signal. Is this not where the Debugger should be opened? Again, I am unsure how to do this and all suggestions are MOST WELCOME!
>>> --- The full stack ---
>>> EventualProcess(Process)>>signalException:
>>> [] in EventualMessageSend>>value
>>> FullBlockClosure(BlockClosure)>>cull:
>>> [] in Context>>handleSignal:
>>> FullBlockClosure(BlockClosure)>>ensure:
>>> Context>>handleSignal:
>>> ZeroDivide(Exception)>>signal
>>> SmallInteger>>/
>>> [] in EventualMessageSend>>value
>>> FullBlockClosure(BlockClosure)>>on:do:
>>> EventualMessageSend>>value
>>> PriorityVat>>processSends
>>> [] in EventualProcess>>setupContext

> -
> - With the stack copied to the side, I want to massage the stack so the top frame is the Exception's frame where the Exception gets signaled. Then I would like to remove the frames below the frame that causes the Exception signal or perhaps the stack down to the EventualMessageSend>>#value. This is the stack I envision opening in a Debugger:
>> ZeroDivide(Exception)>>signal
>> SmallInteger>>/
>> [] in EventualMessageSend>>value
>> FullBlockClosure(BlockClosure)>>on:do:
>> EventualMessageSend>>value

What do you think? How can I do each of these?

> - Copy stack
> - Restart eventLoop
> - Prune stack
> - Open Debugger

K, r
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200623/e16757b4/attachment.html>

More information about the Squeak-dev mailing list