ProcessWrapper BUGs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ProcessWrapper BUGs

Denis Kudriashov
Hello

I found bugs in ProcessWrapper

try

externalKiosk := ProcessWrapper new.
externalKiosk startWithCommand: 'notepad'.

Do "externalKiosk terminate" twice. And image crashed without any logs

Do "externalKiosk finalize" twice.And image crashed without any logs but not immediately.

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



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: ProcessWrapper BUGs

Levente Uzonyi-2
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