On Wed, 28 Jul 2010, Denis Kudriashov wrote:
> Hello
>
> I found bugs in ProcessWrapper
>
> try
>
> externalKiosk := ProcessWrapper new.
> externalKiosk startWithCommand: 'notepad'.
>
> Do "externalKiosk terminate" twice. And image crashed without any logs
Terminate is the hard way to kill a process. You don't have to use it, if
your process can terminate in another way. There's a workaround for this
issue in ProcessWrapperTests >> #tearDown :
process isRunning ifTrue: [ process terminate ].
>
> Do "externalKiosk finalize" twice.And image crashed without any logs but not
> immediately.
#finalize is not something that you're intended to send. It's a
private method, part of the finalization logic.
>
> Besides I found that multiple starting and terminating ProcessWrapper and
> then saving image can corrupt it. And restarting image crashed by some
> failure of finalization process in ProcessWrapper plugin. (I see it in crash
> log).
>
> I test it in Pharo 1.1 with stardart and cog VM
>
It works fine in Squeak trunk (at least for me). I don't know if it works
in Pharo, since WeakRegistry works differently than in Squeak.
Btw removing the finalization logic is a bad idea because it's totally ok
to not send #terminate at all. Without proper finalization you're leaking
resources (memory, semaphores, etc) in this case.
Levente
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project