[Vm-dev] Critical OSPP fix (was: OSProcess and lost SIGCHLD)

Max Leske maxleske at gmail.com
Fri Jun 12 06:59:32 UTC 2015


Hi Dave,

AFAICT this problem only exists in newer versions of the OSProcess Plugin (there’s no #forkAndExecInDirectory in my Pharo 1.3 image). So does this only affect images with that message running on Cog? I’m running Pharo 1.3 on SqueakVM 4.0.3. Just want to make sure that this isn’t something I could backport.

Cheers,
Max


> On 12 Jun 2015, at 04:26, vm-dev-request at lists.squeakfoundation.org wrote:
> 
> Eliot, Esteban:
> 
> Thiery Goubier has identified and fixed a critical bug in OSProcessPlugin. The
> issue was improper use of vfork() in a situation where fork() should be used. I
> apparently made this mistake many years ago, and I can't think of any good excuse
> for it. But I am very happy that Thiery has figured it out and fixed it after all
> this time :-)
> 
> The fix is in VMConstruction-Plugins-OSProcessPlugin-dtl.40 and updated trunk
> SVN sources.
> 
> It is important that we get this fix into the oscog and Pharo branches of OSPP,
> particularly because Thierry is running a Pharo VM and he needs the updates for
> work that he is doing there.
> 
> Thierry provided the fix in the attached MCZ, which is relative to
> VMConstruction-Plugins-OSProcessPlugin.oscog-EstebanLorenzano.43 from the Pharo
> repository. This is derived from the oscog branch of OSPP, maybe a bit out of
> date but that is not important WRT this change.
> 
> @Eliot: My suggestion would be to update to methods in UnixOSProcessPlugin method
> category 'primitives - fork and exec' to match the latest in the main branch. Alternatively
> you can copy the logic from #primitiveForkExec into the ##forkAndExecInDirectory: in
> your oscog branch (that method no longer exists in my main branch). The relevant
> snippet is:
> 
> 	pid := self fork. "cCode: 'fork()' "
> 	pid < 0
> 		ifTrue: [ self perror: 'fork'.
> 			^self primitiveFail ].
> 	pid = 0
> 		ifFalse:
> 			[ "Normal return to Smalltalk - this is the old parent process."
> 			"Enable the timer again before resuming Smalltalk."
> 			self cCode: 'setitimer (ITIMER_REAL, &saveIntervalTimer, 0L)'.
> 			interpreterProxy pop: 10; pushInteger: pid 
> 			"Pop 9 arguments plus receiver, push pid."]
> 		ifTrue:
> 			[ "This is the new child process"
> 			...
> 			
> @Esteban: You will probably want to follow Eliot's branch, but you can provide
> an immediate fix for Pharo by using Thierry's MCZ attached.
> 
> Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150612/a9c6e54a/attachment-0001.htm


More information about the Vm-dev mailing list