[squeak-dev] OSProcess [Test Failure/Success]

Ross Boylan RossBoylan at stanfordalumni.org
Fri Sep 3 00:41:22 UTC 2010


On Thu, 2010-09-02 at 15:45 -0700, Ross Boylan wrote:
> I tried with squeak4.1 and vmVersion  'Squeak3.10.2 of ''5 June
> 2008'' [latest update: #7179]', which probably was built specifically
> for Debian.  All 131 tests passed.  Unfortunately, I don't think that
> VM
> is closure enabled.
I believe the vmVersion string is misleading.  The Debian package
version is 1:4.0.3.2202-2, i.e. 4.0.  I also see
$ /usr/lib/squeak/4.0.3-2202/squeakvm -version
4.0.3-2202 #1 XShm Sat Apr 17 18:57:13 UTC 2010 gcc 4.4.3
Linux biber 2.6.26-2-amd64 #1 SMP Tue Mar 9 22:29:32 UTC 2010 i686 GNU/Linux
plugin path: /usr/lib/squeak/4.0.3-2202/ [default: /usr/lib/squeak/4.0.3-2202/]

so I think the version string just wasn't updated.  Also, I think images
that require (good) closures won't even start without the right VM.

I ran again with this VM and Cuis2.6.  Here's an updated version of one
of the problem methods:

forThisOSProcess
	"Answer a single instance corresponding to the OS process in which this 
	Smalltalk image is executing."

	"OSProcessAccessor forThisOSProcess"

	(ThisOSProcessAccessor notNil and: [ThisOSProcessAccessor isResponsibleForThisPlatform])
		ifTrue:
			[^ ThisOSProcessAccessor].
	ThisOSProcessAccessor ifNotNil: [
		ThisOSProcessAccessor changed: #invalidProcessAccessor.
		ThisOSProcessAccessor release; finalize.].
	"We are running on a different platform, so start a new accessor"
	^ ThisOSProcessAccessor := self concreteClass basicNew initialize
Unless there is some subtlety that requires assigning
ThisOSProcessAccessor, I think this is better than my earlier attempt.

I discovered one more  problem when I tried to save the image.
ifNotNilDo: is not understood in Cuis.  I hope ifNotNil: is portable,
since I used it above.  Here's a further rewrite:

ThisOSProcess class>>startUp:
startUp: resuming
	"Initialize my singleton instance, and the singleton instance of my
	OSProcessAccessor. On Unix, set the signal handler in my process
	accessor to respond to externally generated sigchld signals. This
	must be done after each image restart in order to call a primitive
	which informs the VM of the identity of the semaphore to signal.
	When not running on a Unix system, the primitive fails and the
	method has no effect. Notify dependents of the singleton instance
	if the image has restarted in a different OS process (this is not the
	case when #startUp is called after a simple image save). The
	notification is done in the initialization of my OSProcessAccessor."

	(Smalltalk at: #AioEventHandler)
		ifNotNil: [ :aio | aio startUp: resuming ].
	self initializeThisOSProcess

After all that, I can run the tests (again, excluding
UnixProcessWin32FileLockingTestCase).  43 of 127 fail.  However, every
one of the handful I check failed because of ifNotNilDo:  When I added
an implementation of that, I got 1 failure and 12 errors.  Many of the
errors failed because 
tearDown

	| d |
	OSProcessAccessor emulateWin32FileLocking: self initialCompatibilitySetting.
	d := Delay forMilliseconds: 50.
	self fileStream close.
	self remoteProcess ifNotNilDo:
		[:p | p terminate.
		[p isComplete] whileFalse: [d wait].
		self remoteProcess: nil]
has p nil and p terminate failed.  Almost certainly some setup code
assumed fork returned a process when it didn't.  The failure is in
UnixProcessUnixFileLockingTestCase(AbstractUnixProcessFileLockingTestCase)>>testCooperatingProcesses04 with the  whole doRemote: and block highlighted in the debugger.  This is probably from the same root cause.

Ross




More information about the Squeak-dev mailing list