Open eilx2 opened 6 years ago
Do you get this error with v1.4? x86 or x64 version? What is your environment? I guess Windows because of the use of ProcessWrapper but which version?
Yes, it's the v1.4 and x64 version of windows. The problem went away after restarting the PC 2 times and it hasn't come back since.
Ok. Could it be an issue with memory (out of memory a some point)?
This is probably not an issue with Launcher but with Pharo VM for Windows. Sometimes (seems quite random and affects only some users) Pharo does not get access to all libraries and only "fix" is to restart whole PC (which might or might not help - it is "random" whether you get it again). If Launcher gave you such error, you would get similar errors even if you opened any image without Launcher. Issue is most frequent on Windows 10.
I have a fix for this with a simple uffi wrapper for win32/CreateProcess that replaces ProcessWrapper. I use it in my PharoLauncher image. I'll tidy up a few things and make it public over the weekend.
Edit: still tidying up. It works perfectly fine, but some functions need to be in different classes, and the code managing processes needs to be built around a much clearer class.
Every time I try to start an image from PharoLauncher I get the error:
"PrimitiveFailed: primite #isRunning in ProcessWrapper class failed"
Here is execution stack:
Author: Marcel ProcessWrapper class(Object)>>primitiveFailed: ProcessWrapper class(Object)>>primitiveFailed ProcessWrapper class>>isRunning: ProcessWrapper>>isRunning ProcessWrapper>>ExecuteUnOptimizedIn: ProcessWrapper class(Object)>>mustBeBooleanInMagic: ProcessWrapper class(Object)>>mustBeBoolean ProcessWrapper>>waitForExit [ :processWrapperClass | ^ (processWrapperClass new useStderr; waitForExit; startWithShellCommand: aCommand; yourself) stderrStream atEnd ] in PhLProcessWrapper class>>isCommandAvailable: BlockClosure>>cull: SystemDictionary(Dictionary)>>at:ifPresent: SmalltalkImage>>at:ifPresent: PhLProcessWrapper class>>isCommandAvailable: PhLVirtualMachineManager class>>canUseSytemZip PhLVirtualMachineManager class>>unzip:to: [ | targetFile | targetFile := self privateVmStore / (self imageFormatNumber asString , '.zip'). PhLDownloadManager default download: self compatibleVmUrl toFile: targetFile. self class unzip: targetFile to: self privateVmStore / self imageFormatNumber asString ] in PhLVirtualMachineManager>>fetchCompatibleVm BlockClosure>>on:do: PhLVirtualMachineManager>>fetchCompatibleVm [ | vmPath | self fetchCompatibleVm. vmPath := self availableVirtualMachinesByImageFormat at: self imageFormatNumber asString ] in PhLVirtualMachineManager>>compatibleVm Dictionary>>at:ifAbsent: PhLVirtualMachineManager>>compatibleVm [ :stream | stream << 'cd "' << self compatibleVm executableFolderPath << '" && '. Smalltalk os isUnix ifTrue: [ stream << 'export SQUEAK_PLUGINS="" && ' ]. stream << $" << self compatibleVm executablePath << $" << (Smalltalk os isUnix ifTrue: [ ' --nodisplay ' ] ifFalse: [ ' --headless ' ]) << $" << imageFile fullName utf8Encoded asString << '" '. shouldUsePreferences ifFalse: [ stream << '--no-default-preferences ' ]. stream << 'eval ' << $" << self imageVersionFileCreationInstructions << $" ] in PhLVirtualMachineManager>>imageVersionCommandWithPreferences: String class(SequenceableCollection class)>>new:streamContents: String class(SequenceableCollection class)>>streamContents: PhLVirtualMachineManager>>imageVersionCommandWithPreferences: PhLVirtualMachineManager>>imageVersionCommand [ self imageVersionFromFileWith: self imageVersionCommand ] in [ "no version file, generate it" [ self imageVersionFromFileWith: self imageVersionCommand ] on: PhLImageVersionDeterminationError do: [ "Command probably failed, try to run without --no-default-preferences option (not available in Pharo 2)" self imageVersionFromFileWith: (self imageVersionCommandWithPreferences: true) ] ] in PhLVirtualMachineManager>>imageVersion BlockClosure>>on:do: [ "no version file, generate it" [ self imageVersionFromFileWith: self imageVersionCommand ] on: PhLImageVersionDeterminationError do: [ "Command probably failed, try to run without --no-default-preferences option (not available in Pharo 2)" self imageVersionFromFileWith: (self imageVersionCommandWithPreferences: true) ] ] in PhLVirtualMachineManager>>imageVersion BlockClosure>>cull: Context>>evaluateSignal: Context>>handleSignal: PhLImageVersionDeterminationError(Exception)>>signal PhLImageVersionDeterminationError(Exception)>>signal: PhLImageVersionDeterminationError class(Exception class)>>signal: [ PhLImageVersionDeterminationError signal: ('Cannot determine image version: image version file "{1}" not found!' format: {self imageVersionFile pathString}) ] in PhLVirtualMachineManager>>imageVersionFromFile False>>ifTrue:ifFalse: FileReference(AbstractFileReference)>>readStreamDo:ifAbsent: PhLVirtualMachineManager>>imageVersionFromFile [ self imageVersionFromFile ] in PhLVirtualMachineManager>>imageVersion BlockClosure>>on:do: PhLVirtualMachineManager>>imageVersion PhLVirtualMachineManager>>vmFileName [ :bar | bar label: 'Determining Image version'. vm := self availableVirtualMachines at: self vmFileName ifAbsent: [ bar label: 'Fetching VM to run Pharo ' , self imageVersion , ' images'; current: 25. self fetchVm. vm := self availableVirtualMachines at: self vmFileName. bar label: 'Fetching sources files for Pharo ' , self imageVersion; current: 50. self fetchSourcesFiles. bar label: 'Running the image'; current: 100. vm ] ] in PhLVirtualMachineManager>>vm [ :bar | aBlock value: bar ] in MorphicUIManager>>informUserDuring: BlockClosure>>cull: [ ^ block cull: self ] in [ self prepareForRunning. CurrentJob value: self during: [ ^ block cull: self ] ] in Job>>run [ activeProcess psValueAt: index put: anObject. aBlock value ] in CurrentJob(DynamicVariable)>>value:during: BlockClosure>>ensure: CurrentJob(DynamicVariable)>>value:during: CurrentJob class(DynamicVariable class)>>value:during: [ self prepareForRunning. CurrentJob value: self during: [ ^ block cull: self ] ] in Job>>run BlockClosure>>ensure: Job>>run MorphicUIManager(UIManager)>>displayProgress:from:to:during: MorphicUIManager>>informUserDuring: PhLVirtualMachineManager>>vm [ | vmCommand | vmCommand := (PhLVirtualMachineManager forImage: file pathString) vm. ^ PhLProcessWrapper command: (self launchCommandWith: vmCommand useSettings: usePharoSettings) ] in [ [ | vmCommand | vmCommand := (PhLVirtualMachineManager forImage: file pathString) vm. ^ PhLProcessWrapper command: (self launchCommandWith: vmCommand useSettings: usePharoSettings) ] on: PhLImageVersionDeterminationError do: [ :error | error uiAlert ] ] in PhLImage>>launchWithSettings: BlockClosure>>on:do: [ [ | vmCommand | vmCommand := (PhLVirtualMachineManager forImage: file pathString) vm. ^ PhLProcessWrapper command: (self launchCommandWith: vmCommand useSettings: usePharoSettings) ] on: PhLImageVersionDeterminationError do: [ :error | error uiAlert ] ] in PhLImage>>launchWithSettings: BlockClosure>>on:do: PhLImage>>launchWithSettings: [ aPhLImage launchWithSettings: true ] in PhLLaunchImageCommand>>launchImage: BlockClosure>>on:do: PhLLaunchImageCommand>>launchImage: PhLLaunchImageCommand>>launchSelectedImage PhLLaunchImageCommand>>execute PhLLaunchImageCommand(PhLCommand)>>executeIfApplicable PhLCommandButton>>performAction MorphicButtonAdapter>>action PluggableButtonMorph>>performAction: [ :m | (m containsPoint: evt cursorPoint) ifTrue: [ m enabled ifTrue: [ m performAction: evt ] ] ] in PluggableButtonMorph>>mouseUp: Array(SequenceableCollection)>>do: PluggableButtonMorph>>mouseUp: PluggableButtonMorph(Morph)>>handleMouseUp: MouseButtonEvent>>sentTo: PluggableButtonMorph(Morph)>>handleEvent: PluggableButtonMorph(Morph)>>handleFocusEvent: [ ActiveHand := self. ActiveEvent := anEvent. result := focusHolder handleFocusEvent: (anEvent transformedBy: (focusHolder transformedFrom: self)) ] in HandMorph>>sendFocusEvent:to:clear: BlockClosure>>on:do: WorldMorph(PasteUpMorph)>>becomeActiveDuring: HandMorph>>sendFocusEvent:to:clear: HandMorph>>sendEvent:focus:clear: HandMorph>>sendMouseEvent: HandMorph>>handleEvent: HandMorph>>processEventsFromQueue: HandMorph>>processEvents [ :h | self activeHand: h. h processEvents. self activeHand: nil ] in WorldState>>doOneCycleNowFor: Array(SequenceableCollection)>>do: WorldState>>handsDo: WorldState>>doOneCycleNowFor: WorldState>>doOneCycleFor: WorldMorph>>doOneCycle WorldMorph class>>doOneCycle [ [ WorldMorph doOneCycle. Processor yield. false ] whileFalse: [ ] ] in MorphicUIManager>>spawnNewProcess [ self value. Processor terminateActive ] in BlockClosure>>newProcess
I tried installing the 1.3 version but it still isn't working.