[squeak-dev] debugging PipeableOSProcess

David T. Lewis lewis at mail.msen.com
Thu Mar 6 12:35:37 UTC 2008


On Wed, Mar 05, 2008 at 11:30:31PM -0600, Jimmie Houchin wrote:
> Hello Dave,
> 
> Thanks for the help.
> 
> As per your other message, I had already tried alt-. to attempt to
> interrupt the UI and enter a debugger, but the image does not respond.
> It just stays locked. :)
> 
> I tried searching the image for how to use the other parts of the
> PipeableOSProcess command, input: output: errorPipelineStream:, but
> didn't find any. So I do not know how to do what you describe.
> 
> While writing this I went ahead and killed wget. Then Squeak interrupted
> the UI and had a debugger. It had:
> 
> in UnixOSProcessAccesser>>grimReaperProcess

One note on the grimReaperProcess. If you accidentally kill this
process (by stopping it in a debugger and exiting the debugger for
example), the external process handling will stop working. You will
need to restart it, which can be done by stopping and start Squeak.

> Any help on how to use the stdout and stderr pipes would be greatly
> appreciated.

Jimmie,

Try using an object explorer. You can "drill down" into this to see
the pipes, the process proxy, and so forth. The pipes are implemented
by ExternalPipe, OSPipe and InternalPipe, which are all implementations
of Stream.

I'm not sure what is causing your wget process to hang up, but just
as a suggestion you might try using ProxyPipeline class>>command: rather
than PipeableOSProcess class>>command: to run the wget command. The
difference is that the latter uses a real Unix shell (/bin/bash) to
run the wget command, while ProxyPipeline uses a Smalltalk simulation
of the shell to directly run the wget program with no /bin/bash
involved at all. It might be worth a try to see if taking the extra
/bin/bash process out of the equation makes a difference.

(Note, ProxyPipeline is a container for one or more connected
processes, so use an object explorer to see how it is working.
For your wget example, it will be a container with one instance
of PipeableOSProcess, and that instance of PipeableOSProcess
will be running the wget OS process rather than running a
/bin/bash process. Also, ProxyPipeline implements streaming
protocol itself, so you can read from its output and error pipes
directly as if it were a PipeableOSProcess.)

Dave





More information about the Squeak-dev mailing list