[squeak-dev] Using OSProcess
David T. Lewis
lewis at mail.msen.com
Sun Nov 21 17:31:53 UTC 2010
On Sat, Nov 20, 2010 at 10:52:20AM -0800, Eliot Miranda wrote:
> On Sat, Nov 20, 2010 at 9:07 AM, David T. Lewis <lewis at mail.msen.com> wrote:
> > As far as I know, then only part of OSProcess/CommandShell that
> > does not work in Cog is the #forkSqueak methods. Unfortunately,
> > #forkSqueak is used extensively in the unit tests, so be careful
> > about running those under Cog. But all other OSProcess and CommandShell
> > functions seem to work fine in Cog.
> Any idea what it is about forkSqueak that breaks Cog?
Aha, I found the first half of the problem. The X11 display control primitives
are now in the separate XDisplayControlPlugin, but I neglected to put a
check in #forkSqueak to make sure that the plugin is present. The result
is that when XDisplayControlPlugin is missing, the child Squeak VM is unable
to disconnect from the X11 server and continues reading and writing on the
same socket used by the parent. This produces X protocol errors followed
by a VM crash. Hard to believe that my quality control department let this
one get through ;)
I can reproduce this on an interpreter VM, so it is not a Cog issue. The
fix is in OSProcess on SqueakSource (OSProcess-dtl.58).
For Cog on Linux, I recommend including both AioPlugin and XDisplayControlPlugin
along with OSProcessPlugin.
I can't do a Cog build on my system at the moment, so if someone can confirm
that adding XDisplayControlPlugin and AioPlugin cures the Cog crash problem,
I'd appreciate the feedback.
Note that I still expect problems with forkSqueak on Cog related to restarting
the timer thread, but that will effect only the child process, and the above
should cure the VM crash issue.
More information about the Squeak-dev