THERE_BE_DRAGONS_HERE PrimitiveFailed: primitive #value:value: in BlockClosure failed 12 January 2023 4:07:44.888674 pm VM: Mac OS - x86_64 - 1000 - CoInterpreter VMMaker-tonel.1 uuid: 8daa07ff-73ae-0d00-8cc1-4e4000caac6d Jan 12 2023 StackToRegisterMappingCogit VMMaker-tonel.1 uuid: 8daa07ff-73ae-0d00-8cc1-4e4000caac6d Jan 12 2023 cc52862c - Commit: cc52862c - Date: 2023-01-12 14:40:14 +0100 Image: Pharo9.0.0 [Build information: Pharo-9.0.0+build.1580.sha.e1bb0fb7b6c4aaadd5106d19b58633c94dff1b69 (64 Bit)] BlockClosure(ProtoObject)>>primitiveFailed: Receiver: Heap sortBlock: [ :arg1 :arg2 | arg1 resumptionTick <= arg2 resumptionTick ] Arguments and temporary variables: selector: #value:value: Receiver's instance variables: outerContext: DelayBasicScheduler class>>defaultSuspendedDelaysHeap startpc: 54 numArgs: 2 BlockClosure(ProtoObject)>>primitiveFailed Receiver: Heap sortBlock: [ :arg1 :arg2 | arg1 resumptionTick <= arg2 resumptionTick ] Arguments and temporary variables: x Receiver's instance variables: outerContext: DelayBasicScheduler class>>defaultSuspendedDelaysHeap startpc: 54 numArgs: 2 BlockClosure>>value:value: Receiver: Heap sortBlock: [ :arg1 :arg2 | arg1 resumptionTick <= arg2 resumptionTick ] Arguments and temporary variables: firstArg: a Delay(16 msecs; 0 msecs remaining) secondArg: a DelayWaitTimeout(10000 msecs; (4981959/500) msecs remaining) Receiver's instance variables: outerContext: DelayBasicScheduler class>>defaultSuspendedDelaysHeap startpc: 54 numArgs: 2 Heap>>sorts:before: Receiver: a Heap(a DelayWaitTimeout(10000 msecs; (2490843/250) msecs remaining) a Delay(16 msecs; 0 ...etc... Arguments and temporary variables: element1: a Delay(16 msecs; 0 msecs remaining) element2: a DelayWaitTimeout(10000 msecs; (4980129/500) msecs remaining) Receiver's instance variables: array: an Array(a DelayWaitTimeout(10000 msecs; (9959919/1000) msecs remaining)...etc... tally: 2 sortBlock: Heap sortBlock: [ :arg1 :arg2 | arg1 resumptionTick <= arg2 res...etc... indexUpdateBlock: nil Heap>>upHeap: Receiver: a Heap(a DelayWaitTimeout(10000 msecs; (4979747/500) msecs remaining) a Delay(16 msecs; 0 ...etc... Arguments and temporary variables: anIndex: 2 value: a Delay(16 msecs; 0 msecs remaining) k: 2 kDiv2: 1 tmp: a DelayWaitTimeout(10000 msecs; (2488151/250) msecs remaining) Receiver's instance variables: array: an Array(a DelayWaitTimeout(10000 msecs; (1244028/125) msecs remaining) ...etc... tally: 2 sortBlock: Heap sortBlock: [ :arg1 :arg2 | arg1 resumptionTick <= arg2 res...etc... indexUpdateBlock: nil Heap>>add: Receiver: a Heap(a DelayWaitTimeout(10000 msecs; (1243976/125) msecs remaining) a Delay(16 msecs; 0 ...etc... Arguments and temporary variables: anObject: a Delay(16 msecs; 0 msecs remaining) Receiver's instance variables: array: an Array(a DelayWaitTimeout(10000 msecs; (4974247/500) msecs remaining) ...etc... tally: 2 sortBlock: Heap sortBlock: [ :arg1 :arg2 | arg1 resumptionTick <= arg2 res...etc... indexUpdateBlock: nil DelaySemaphoreScheduler(DelayBasicScheduler)>>scheduleAtTimingPriority Receiver: a DelaySemaphoreScheduler(254009856) on DelayMicrosecondTicker Arguments and temporary variables: x Receiver's instance variables: ticker: a DelayMicrosecondTicker runTimerEventLoop: true timerEventLoop: a Process in nil suspendedDelays: a Heap(a DelayWaitTimeout(10000 msecs; (1242868/125) msecs rem...etc... activeDelay: a Delay(16 msecs; 0 msecs remaining) suspendSemaphore: nil timingSemaphore: a Semaphore() delayToStart: a Delay(1 msecs; 0 msecs remaining) delayToStop: nil readyToSchedule: a Semaphore() readyToUnschedule: a Semaphore() DelaySemaphoreScheduler>>scheduleAtTimingPriority Receiver: a DelaySemaphoreScheduler(254009856) on DelayMicrosecondTicker Arguments and temporary variables: x Receiver's instance variables: ticker: a DelayMicrosecondTicker runTimerEventLoop: true timerEventLoop: a Process in nil suspendedDelays: a Heap(a DelayWaitTimeout(10000 msecs; (9940401/1000) msecs re...etc... activeDelay: a Delay(16 msecs; 0 msecs remaining) suspendSemaphore: nil timingSemaphore: a Semaphore() delayToStart: a Delay(1 msecs; 0 msecs remaining) delayToStop: nil readyToSchedule: a Semaphore() readyToUnschedule: a Semaphore() [ [runTimerEventLoop] whileTrue: [ |nowTick| "Warning! Stepping the following line may lock the Image. Use or ." ticker waitForUserSignalled: timingSemaphore orExpired: activeDelay. "Invoke the api back-ends, which set the transfer-variable to nil" suspendSemaphore ifNotNil: [ self suspendAtTimingPriority ]. delayToStart ifNotNil: [ self scheduleAtTimingPriority ]. delayToStop ifNotNil: [ self unscheduleAtTimingPriority ]. "Signal any expired delays" nowTick := ticker nowTick. [ activeDelay notNil and: [nowTick >= activeDelay resumptionTick] ] whileTrue: [ activeDelay timingPrioritySignalExpired. activeDelay := suspendedDelays removeFirstOrNil ]. ] ] in DelaySemaphoreScheduler(DelayBasicScheduler)>>runBackendLoopAtTimingPriority Receiver: a DelaySemaphoreScheduler(254009856) on DelayMicrosecondTicker Arguments and temporary variables: nowTick: nil Receiver's instance variables: ticker: a DelayMicrosecondTicker runTimerEventLoop: true timerEventLoop: a Process in nil suspendedDelays: a Heap(a DelayWaitTimeout(10000 msecs; (2484139/250) msecs rem...etc... activeDelay: a Delay(16 msecs; 0 msecs remaining) suspendSemaphore: nil timingSemaphore: a Semaphore() delayToStart: a Delay(1 msecs; 0 msecs remaining) delayToStop: nil readyToSchedule: a Semaphore() readyToUnschedule: a Semaphore() FullBlockClosure(BlockClosure)>>ensure: Receiver: [ [runTimerEventLoop] whileTrue: [ |nowTick| "Warning! Stepping the followin...etc... Arguments and temporary variables: aBlock: [ "When timer event loop exits, expire remaining delays." [activeDela...etc... complete: nil returnValue: nil Receiver's instance variables: outerContext: DelaySemaphoreScheduler(DelayBasicScheduler)>>runBackendLoopAtTim...etc... startpc: a CompiledBlock: [ [runTimerEventLoop] whileTrue: [ |nowTick| "...etc... numArgs: 0 receiver: a DelaySemaphoreScheduler(254009856) on DelayMicrosecondTicker DelaySemaphoreScheduler(DelayBasicScheduler)>>runBackendLoopAtTimingPriority Receiver: a DelaySemaphoreScheduler(254009856) on DelayMicrosecondTicker Arguments and temporary variables: x Receiver's instance variables: ticker: a DelayMicrosecondTicker runTimerEventLoop: true timerEventLoop: a Process in nil suspendedDelays: a Heap(a DelayWaitTimeout(10000 msecs; (4965579/500) msecs rem...etc... activeDelay: a Delay(16 msecs; 0 msecs remaining) suspendSemaphore: nil timingSemaphore: a Semaphore() delayToStart: a Delay(1 msecs; 0 msecs remaining) delayToStop: nil readyToSchedule: a Semaphore() readyToUnschedule: a Semaphore() [ self runBackendLoopAtTimingPriority ] in DelaySemaphoreScheduler(DelayBasicScheduler)>>startTimerEventLoopPriority: Receiver: a DelaySemaphoreScheduler(254009856) on DelayMicrosecondTicker Arguments and temporary variables: processorPriority: 80 Receiver's instance variables: ticker: a DelayMicrosecondTicker runTimerEventLoop: true timerEventLoop: a Process in nil suspendedDelays: a Heap(a DelayWaitTimeout(10000 msecs; (4964769/500) msecs rem...etc... activeDelay: a Delay(16 msecs; 0 msecs remaining) suspendSemaphore: nil timingSemaphore: a Semaphore() delayToStart: a Delay(1 msecs; 0 msecs remaining) delayToStop: nil readyToSchedule: a Semaphore() readyToUnschedule: a Semaphore() [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess Receiver: [ self runBackendLoopAtTimingPriority ] Arguments and temporary variables: x Receiver's instance variables: outerContext: DelaySemaphoreScheduler(DelayBasicScheduler)>>startTimerEventLoop...etc... startpc: a CompiledBlock: [ self runBackendLoopAtTimingPriority ] numArgs: 0 receiver: a DelaySemaphoreScheduler(254009856) on DelayMicrosecondTicker --- The full stack --- BlockClosure(ProtoObject)>>primitiveFailed: BlockClosure(ProtoObject)>>primitiveFailed BlockClosure>>value:value: Heap>>sorts:before: Heap>>upHeap: Heap>>add: DelaySemaphoreScheduler(DelayBasicScheduler)>>scheduleAtTimingPriority DelaySemaphoreScheduler>>scheduleAtTimingPriority [ [runTimerEventLoop] whileTrue: [ |nowTick| "Warning! Stepping the following line may lock the Image. Use or ." ticker waitForUserSignalled: timingSemaphore orExpired: activeDelay. "Invoke the api back-ends, which set the transfer-variable to nil" suspendSemaphore ifNotNil: [ self suspendAtTimingPriority ]. delayToStart ifNotNil: [ self scheduleAtTimingPriority ]. delayToStop ifNotNil: [ self unscheduleAtTimingPriority ]. "Signal any expired delays" nowTick := ticker nowTick. [ activeDelay notNil and: [nowTick >= activeDelay resumptionTick] ] whileTrue: [ activeDelay timingPrioritySignalExpired. activeDelay := suspendedDelays removeFirstOrNil ]. ] ] in DelaySemaphoreScheduler(DelayBasicScheduler)>>runBackendLoopAtTimingPriority FullBlockClosure(BlockClosure)>>ensure: DelaySemaphoreScheduler(DelayBasicScheduler)>>runBackendLoopAtTimingPriority [ self runBackendLoopAtTimingPriority ] in DelaySemaphoreScheduler(DelayBasicScheduler)>>startTimerEventLoopPriority: [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------------------------------------------------------- Processes and their stacks: Process: a Process in InputEventFetcher>>waitForInput stack: InputEventFetcher>>waitForInput InputEventFetcher>>eventLoop Processor in InputEventFetcher>>installEventLoop [ self value. Processor terminateActive ] asContext in BlockClosure>>newProcess ------------------------------ Process: a Process in AtomicSharedQueue>>waitForNewItems stack: AtomicSharedQueue>>waitForNewItems AtomicSharedQueue>>next TKTWorkerProcess>>privateNextTask workerLoop [ self executeTask: self privateNextTask ] repeat in TKTWorkerProcess>>workerLoop BlockClosure>>repeat TKTWorkerProcess>>workerLoop MessageSend>>value arg1 in TKTPharoProcessProvider>>createProcessDoing:named: [ self value. Processor terminateActive ] asContext in BlockClosure>>newProcess ------------------------------ Process: a Process in [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess stack: [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess stack: [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess stack: [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in Process>>doTerminationFromYourself stack: Process>>doTerminationFromYourself ------------------------------ Process: a Process in [delaySemaphore wait] in Delay>>wait stack: [delaySemaphore wait] in Delay>>wait FullBlockClosure(BlockClosure)>>ifCurtailed: Delay>>wait WorldState class>>doInterCycleWait [ self doInterCycleWait ] in WorldState class>>doDrawCycleWith: FullBlockClosure(BlockClosure)>>ensure: WorldState class>>doDrawCycleWith: WorldMorph class>>doOneCycle MorphicRenderLoop>>doOneCycle MorphicRenderLoop>>doOneCycleWhile: [ MorphicRenderLoop new doOneCycleWhile: [ true ] ] in MorphicUIManager>>spawnNewProcess [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in nil stack: Array(SequenceableCollection)>>do: [:logger | logger nextPutAll: 'Processes and their stacks: ';cr. Process allInstances do: [:each | | ctx | logger nextPutAll: 'Process: '; print: each; cr; nextPutAll: ' stack:'; cr; cr. ctx := each isActiveProcess ifTrue: [ thisContext sender ] ifFalse: [ each suspendedContext ]. ctx ifNotNil: [ (ctx stackOfSize: 20) do: [:s | logger print: s; cr ]]. logger nextPutAll: '------------------------------'; cr; cr. ]] in CommandLineUIManager>>quitFrom:withMessage: [ logStream := self openLog. aMonadicBlock value: logStream. ] in SmalltalkImage>>logDuring: FullBlockClosure(BlockClosure)>>ensure: SmalltalkImage>>logDuring: [ Smalltalk logError: aString inContext: aContext. " Print stacks of all current processes " Smalltalk logDuring: [:logger | logger nextPutAll: 'Processes and their stacks: ';cr. Process allInstances do: [:each | | ctx | logger nextPutAll: 'Process: '; print: each; cr; nextPutAll: ' stack:'; cr; cr. ctx := each isActiveProcess ifTrue: [ thisContext sender ] ifFalse: [ each suspendedContext ]. ctx ifNotNil: [ (ctx stackOfSize: 20) do: [:s | logger print: s; cr ]]. logger nextPutAll: '------------------------------'; cr; cr. ]]. ] in NonInteractiveUIManager(CommandLineUIManager)>>quitFrom:withMessage: FullBlockClosure(BlockClosure)>>ensure: NonInteractiveUIManager(CommandLineUIManager)>>quitFrom:withMessage: NonInteractiveUIManager(CommandLineUIManager)>>unhandledErrorDefaultAction: PrimitiveFailed(Exception)>>unhandledErrorAction UnhandledError>>defaultAction UndefinedObject>>handleSignal: UnhandledError(Exception)>>signal UnhandledError class>>signalForException: PrimitiveFailed(Exception)>>raiseUnhandledError PrimitiveFailed(Exception)>>defaultAction UndefinedObject>>handleSignal: PrimitiveFailed(Exception)>>signal PrimitiveFailed class(SelectorException class)>>signalFor: BlockClosure(ProtoObject)>>primitiveFailed: ------------------------------ Process: a Process in Process>>doTerminationFromYourself stack: Process>>doTerminationFromYourself ------------------------------ Process: a Process in SmalltalkImage>>lowSpaceWatcher stack: SmalltalkImage>>lowSpaceWatcher [ self lowSpaceWatcher ] in SmalltalkImage>>installLowSpaceWatcher [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess stack: [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in WeakArray class>>finalizationProcess stack: WeakArray class>>finalizationProcess [self finalizationProcess] in WeakArray class>>restartFinalizationProcess [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in Process>>resume stack: Process>>resume MessageTally>>spyEvery:on: MessageTally class>>spyOn:reportOtherProcesses:cutoff:openResultWindow:closeAfter: MessageTallyTest>>testSampling1 MessageTallyTest(TestCase)>>performTest [self setUp. self performTest] in MessageTallyTest(TestCase)>>runCase FullBlockClosure(BlockClosure)>>ensure: MessageTallyTest(TestCase)>>runCase [aTestCase runCase] in [ [aTestCase runCase] ensure: [ "Terminated test is not considered as completed (user just closed a debugger for example)" mainTestProcess isTerminating ifFalse: [ self handleCompletedTest ]] ] in TestExecutionEnvironment>>runTestCaseUnderWatchdog: FullBlockClosure(BlockClosure)>>ensure: [ [aTestCase runCase] ensure: [ "Terminated test is not considered as completed (user just closed a debugger for example)" mainTestProcess isTerminating ifFalse: [ self handleCompletedTest ]] ] in TestExecutionEnvironment>>runTestCaseUnderWatchdog: FullBlockClosure(BlockClosure)>>on:do: TestExecutionEnvironment>>runTestCaseUnderWatchdog: [self runTestCaseUnderWatchdog: aTestCase] in TestExecutionEnvironment>>runTestCase: FullBlockClosure(BlockClosure)>>ensure: TestExecutionEnvironment>>runTestCase: CurrentExecutionEnvironment class>>runTestCase: MessageTallyTest(TestCase)>>runCaseManaged [aTestCase runCaseManaged. aTestCase shouldPass ifTrue: [ self recordPassOf: aTestCase ] ifFalse: [ self recordUnexpectedPassOf: aTestCase ] ] in [ [aTestCase runCaseManaged. aTestCase shouldPass ifTrue: [ self recordPassOf: aTestCase ] ifFalse: [ self recordUnexpectedPassOf: aTestCase ] ] on: Exception do: [ :exc | exc recordResultOf: aTestCase inHDTestReport: self ] ] in HDTestReport>>runCase: FullBlockClosure(BlockClosure)>>on:do: ------------------------------ Process: a Process in [ [root insertSender: thisContext. currentContext jump] on: exception do: handlerAction. Processor terminateActive] in Process>>on:do: stack: [ [root insertSender: thisContext. currentContext jump] on: exception do: handlerAction. Processor terminateActive] in Process>>on:do: ------------------------------ Process: a Process in [ [ true ] whileTrue: [ semaphore wait. [self executeCallback: self nextPendingCallback] on: Exception fork: [:ex | ex pass ] ] ] in TFCallbackQueue>>forkCallbackProcess stack: [ [ true ] whileTrue: [ semaphore wait. [self executeCallback: self nextPendingCallback] on: Exception fork: [:ex | ex pass ] ] ] in TFCallbackQueue>>forkCallbackProcess [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in [self schedule. "It is critical that the following has no suspension point so that the test and the wait primitive are atomic. In addition, if the delay is no longer being waited on while entering the way we know that it is expired because the delay has already fired." beingWaitedOn ifTrue:[delaySemaphore wait] ifFalse:[expired := true]] in DelayWaitTimeout>>wait stack: [self schedule. "It is critical that the following has no suspension point so that the test and the wait primitive are atomic. In addition, if the delay is no longer being waited on while entering the way we know that it is expired because the delay has already fired." beingWaitedOn ifTrue:[delaySemaphore wait] ifFalse:[expired := true]] in DelayWaitTimeout>>wait FullBlockClosure(BlockClosure)>>ensure: DelayWaitTimeout>>wait Semaphore>>wait: [ "waiting new test case" watchDogSemaphore wait. "waiting while test completes" [timeIsGone := watchDogSemaphore wait: maxTimeForTest. testCompleted] whileFalse: [ "this subloop allows to dynamically change time limit and restart watch dog" timeIsGone ifTrue: [ "The main purpose of following condition is to ignore timeout when test is under debug. Test process is suspended only when it is debugged" mainTestProcess isSuspended ifFalse: [ mainTestProcess signalException: TestTookTooMuchTime new]] ]. ] in TestExecutionEnvironment>>watchDogLoop FullBlockClosure(BlockClosure)>>repeat TestExecutionEnvironment>>watchDogLoop [self watchDogLoop] in TestExecutionEnvironment>>startWatchDog [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess ------------------------------ Process: a Process in DelaySemaphoreScheduler>>schedule: stack: DelaySemaphoreScheduler>>schedule: Delay>>schedule Delay>>wait [ [ true ] whileTrue: [ | startTime | startTime := Time millisecondClockValue. myDelay wait. self tally: Processor preemptedProcess suspendedContext in: (observedProcess == Processor preemptedProcess ifTrue: [observedProcess] ifFalse: [nil]) "tally can be > 1 if ran a long primitive" by: (Time millisecondClockValue - startTime) // millisecs]. nil] in MessageTally>>spyEvery:on: [self value. Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess [root insertSender: thisContext. currentContext jump] in [ [root insertSender: thisContext. currentContext jump] on: exception do: handlerAction. Processor terminateActive] in Process>>on:do: FullBlockClosure(BlockClosure)>>on:do: [ [root insertSender: thisContext. currentContext jump] on: exception do: handlerAction. Processor terminateActive] in Process>>on:do: ------------------------------