[Vm-dev] Cog + Pi + OSProcess
David T. Lewis
lewis at mail.msen.com
Mon Jul 18 04:10:05 UTC 2016
On Sun, Jul 17, 2016 at 12:52:21PM -0400, David T. Lewis wrote:
> On Wed, Jun 08, 2016 at 11:42:57AM -0700, tim Rowledge wrote:
> > I finally got a moment to look at this - not that I really have much clue about the whole unix process thing - and it appears that something is odd with the compiled code in the plugin.
> > My test is very simple - run the UnixProcess class>listDirectory example. It exits with a segfault and the forkAndExec??? method as the last thing on the stack.
> > I build a debug vm (and had some fun with asserts and the ARM fp offset in the process, all fixed now) and??? it doesn???t fail. I???ve tried compiling the plugin with varying levels of optimisation, since we???ve fairly regularly seen problems there, and even at -O0 it fails. So debug -> OK, no-debug -> boom. Nice.
> > Ideas?
> Hi Tim,
> It looks like the oscog branch of OSPP is broken. I tried OSProcess on
> my new Raspberry Pi, and it fails as you describe. I recompiled using
> source from my unaltered main branch of the plugin, and it works fine.
> A quick fix is to just copy the generated source from the interpreter VM
> (src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c) and use it in your
> Spur VM build.
> #forkSqueak is still broken (no display opens for the child Squeak) but
> that seems to be a problem elsewhere in the platforms code. It used to work
> in Cog, but I have not hunted down the regression.
Well here is a milestone. I just made my first git pull request to fix the
broken #forkSqueak problem so that "UnixProcess forkSqueak" will open a
forked child Squeak with a new X11 display window:
And I think that my memory was probably failing me. After looking through
the changes history, I don't think this ever worked in Cog. But it should
work now :-)
So with this patch, and if you also use the trunk OSProcessPlugin instead of
the oscog version, then you should have a reasonably functional OSProcess and
CommandShell on your Raspberry Pi.
Best of all, the OSProcess and CommandShell unit tests will once again
entertain you with lots of child process Squeak windows opening and closing
all over your screen.
More information about the Vm-dev