[squeak-dev] Re: Unix OSProcess error

David T. Lewis lewis at mail.msen.com
Fri Aug 7 02:47:40 UTC 2009


On Thu, Aug 06, 2009 at 02:36:35PM -0700, Andreas Raab wrote:
> David T. Lewis wrote:
> >Probably yes. From memory I think that 'cmd closePipes' will do what you
> >need. But I'm sure there are cleaner ways to do this, so I'll give you
> >a better answer later on when I get home a few hours from now. I guess
> >it's time I started carrying one of Bert's Squeak-on-a-stick solutions
> >on my keychain ;)
> 
> A quick test seems to indicate that no specific cleanup is required 
> after the command - I didn't see any extra open handles after running it 
> several times.

Check that file handle count once again. I expect that you will be seeing
one extra file handle left open each time you run the external shell script
(but you are running a different version of OSProcess from my latest, so
I'm not 100% sure).  Adding the "cmd closePipes" will do the necessary
cleanup; I just checked this on my system at home. In other words, do your
wait loop like this:

  [cmd isComplete not and:[(Time millisecondsSince: start) < deadline]]
        whileTrue:[(Delay forMilliseconds: 100) wait].
  cmd closePipes.
  cmd isComplete ifFalse:[^self error: 'timeout'].


> However, there was an odd error earlier on the server in 
> question which I had ignored but might turn out related. The error was 
> "unsupported primitive, plugin may be out of date" (stack trace below) 
> and I am wondering whether that might have killed the grimReaperProcess 
> and led to the accumulation of the handles (no clue what might actually 
> cause that error; the plugin is up-to-date).

Oh-oh, I'm not so sure about that. The "unsupported primitive, plugin may
be out of date" message comes from UnixOSProcessAccessor>>isAtEndOfFile in
an older version of OSProcess, which means that your OSProcess and CommandShell
packages are a bit out of date. Latest versions are:

  OSProcess versionString ==> '4.3.8'
  CommandShell versionString ==> '4.4.1'

But that's probably not the problem. I suspect that the error message is
correct, and your OSPP plugin actually *is* out of date. You can query
the running plugin for its version string, which on an up to date OSPP
would be this:

  OSProcess accessor osppModuleVersionString ==> '4.3.3'

If you have something very much older, it may be causing problems.

In particular, make sure that it's not version 4.2.6, which is the very
out of date version (December 2007) that seems to have been included in
Ian's most recent build. This is the down side of the "maintain everything
as external modules" theory I guess. I had suggested to Ian that he do an
update "with the latest VMMaker" to get the closure support in place, but
I didn't say anything about updating other externally maintained plugins.
I guess that means that I need to educate myself about MonticelloConfigurations
one of these days.

In summary:
 - Add "cmd closePipes" to make sure that pipe handles are getting cleaned up.
   I'm fairly sure that this will correct the file handle leak.
 - Check "OSProcess accessor osppModuleVersionString" to make sure you
   really are running an up to date version.
 - (Optional) Load the latest OSProcess and CommandShell from SqueakSource.

Dave




More information about the Squeak-dev mailing list