Christoph Thiede uploaded a new version of Chronology-Core to project The Trunk: http://source.squeak.org/trunk/Chronology-Core-jar.90.mcz
==================== Summary ====================
Name: Chronology-Core-jar.90 Author: jar Time: 5 January 2024, 12:03:49.89018 pm UUID: 498e4b92-020c-2442-bb24-ad77536e626f Ancestors: Chronology-Core-mt.88
fix a bug in #valueWithin:onTimeout: see https://github.com/squeak-smalltalk/squeak-object-memory/issues/108
Issue: the method starts a watchdog at high priority before entering the ensure: method. But the active process may terminate before entering the ensure: inside valueWithin:onTimeout:, and thus the cleanup ensure argument block will not be executed during the unwind. As a result the watchod will assume the active process has not completed the watched block and will erroneously signal the TimedOut exception and a failure (BCR exception) inside #signalException will follow.
=============== Diff against Chronology-Core-mt.88 ===============
Item was changed: ----- Method: BlockClosure>>valueWithin:onTimeout: (in category '*chronology-core') ----- valueWithin: aDuration onTimeout: timeoutBlock "Evaluate the receiver. If the evaluation does not complete in less than aDuration evaluate the timeoutBlock instead"
| theProcess delay watchdog tag |
aDuration <= Duration zero ifTrue: [^ timeoutBlock value ].
"the block will be executed in the current process" theProcess := Processor activeProcess. delay := aDuration asDelay. tag := self.
"make a watchdog process" watchdog := [ delay wait. "wait for timeout or completion" theProcess ifNotNil:[ theProcess signalException: (TimedOut new tag: tag)] ] newProcess.
"Watchdog needs to run at high priority to do its job (but not at timing priority)" watchdog priority: Processor timingPriority-1.
"catch the timeout signal" + ^ [ [watchdog resume. "start up the watchdog" + self value] ensure:[ "evaluate the receiver" - ^ [ watchdog resume. "start up the watchdog" - self ensure:[ "evaluate the receiver" theProcess := nil. "it has completed, so ..." delay delaySemaphore signal. "arrange for the watchdog to exit" ]] on: TimedOut do: [ :e | e tag == tag ifTrue:[ timeoutBlock value ] ifFalse:[ e pass]].!
packages@lists.squeakfoundation.org