[VM][OSPP] bug alert: OSProcess breaks with recent SVN source tree

David T. Lewis lewis at mail.msen.com
Sun Jun 12 16:08:08 UTC 2005


Problem:
OSProcess fails when running on a VM built from the latest source tree.

Triggering event:
Change to SQFile struct in FilePlugin.h to resolve an alignment problem.

Action required (for Ian and/or me):
Before building a Unix VM with OSPP for general distribution, change
UnixOSProcessPlugin class>>concreteClass to remove a kludge I put in a few
years ago. The de-kludged method UnixOSProcessPlugin class>>concreteClass is:

  concreteClass
      self hasInterpreterGetThisSession
         ifTrue:
            ["Preferred technique, requires modified Interpreter"
            ^ UnixOSProcessPluginInterpreterGetThisSession].
      self hasThisSessionAccessorInFilePlugin
         ifTrue:
            ["Not a bad way to do it if VMMaker changes have been loaded"
            ^ UnixOSProcessPluginDynamicThisSession].
      ^ UnixOSProcessPluginStaticThisSession   "The old way to do it"

(well, I suppose it's a bit of a stretch to call this "de-kludged" ;)

Background:
In OSPP, I have several possible ways of obtaining the SQFile->sessionID
(this value is required when creating an OSPipe, which is modeled to look
like a pair of connected FileStreams, or when creating the file streams for
stdin, stdout, stderr). One way that works with the current sources is to
get it from the FilePlugin. If I remember right, this caused a problem in
that it required FilePlugin to be built internally, or something like that
(I don't remember exactly what the concern was). In any case, I decided to
punt, and I have OSPP set up to deliberately fail its primitiveGetSession,
and let OSProcess figure it out by pulling the sessionID out of some existing
FileStream instance (e.g. the changes file). This removed the dependency
between FilePlugin and OSPP, but will fail if the SQFile structure changes.

This worked fine for a long time, but now the SQFile struct has changed
(sessionID is in a different slot to fix an alignment problem), and in any
case it is not going to work with a 64 bit image. Thus I now need to go back
to obtaining the sessionID from a primitive call.

This will of course require an update to OSPP on SqueakMap, but I'm just now
starting to look at the 64bit issues (not much so far :)), so I am not going
to put out any OSPP releases right away unless there is an immediate need.

Note: The right thing to do is to have a global sessionID that can be used
by any plugin that requires it, which currently is FilePlugin, SocketPlugin,
and OSProcessPlugin. It probably is also a good idea to make the value
available through a primitive, similar to the way we obtain system time
or timezone offset. That would make sessionID available to the image for
purposes of e.g. identifying unique Squeak sessions on the internet.

Dave




More information about the Vm-dev mailing list