[Vm-dev] different behaviour for Carbon VM depending on how it's started

Michael Haupt mhaupt at gmail.com
Thu May 1 14:17:42 UTC 2008

Dear all,

today, I came across some interesting (and, so far, unsettling)
behaviour of the Carbon VM (on Mac OS X, of course).

The scenario is this: inside the image, OSProcess is used to start a
Python script that goes to daemon state after some time. The command
line passed to OSProcess>>#waitForCommand: is 'python
/path/to/script.py -some -args'.

Here's the interesting bit.

The OSProcess has an exit value of 256 (and does not work) when I
start the image the "normal" way, i.e., by double-clicking it, or by
drag-and-dropping it to a VM, or by issuing "open -a
/path/to/SqueakVM.app my.image". The VM process, as shown by "ps x",
looks like this: "/path/to/Squeak VM Opt.app/Contents/MacOS/Squeak VM
Opt -psn_0_4199425".

Conversely, when I start the same image by first starting the VM,
either by double-clicking it or by starting it directly from the
terminal command line ("open /path/to/SqueakVM.app" or
"/path/to/SqueakVM.app/Contents/MacOS/Squeak\ VM\ Opt"), and then
selecting the image from the file selection dialogue, everything is
fine. The VM process, then, looks like this: "/path/to/Squeak VM
Opt.app/Contents/MacOS/Squeak VM Opt" (i.e., without the "-psn...").

What is the difference, and why? I'm puzzled. Someone, please enlighten me. :-)



More information about the Vm-dev mailing list