[VM-dev] Problem when waiting on delay during ensure block

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[VM-dev] Problem when waiting on delay during ensure block

Denis Kudriashov

I found interesting problem. Following script will never return:

s := Semaphore new.
p1 := [ 
    [ 100 seconds asDelay wait ] ensure: [ s waitTimeoutMSecs: 50 ]
     ] fork.
100 milliSeconds asDelay wait.
p1 terminate.

If you will interrupt it by cmd+. It will show debugger. If you will close it new debugger will be opened on Unwind error. And in Squeak any attempt to close it will open same debugger again and again.

I thing it is important bug. It shows that we are able to write quite simple code which will be impossible to terminate. For example #ensure: part could include business logic to send some remote notifications which will use delays. And during debug it will be easy to get this scenario.

In Pharo it is more worth because unwind error leads to infinite recursion for opening debuggers and image crash after minutes.

Best regards,