PWS Headless Crashes

Michael Rueger Michael.Rueger.-ND at disney.com
Wed Aug 25 20:36:18 UTC 1999


Peter William Lount wrote:

> I've added PWS class>startUp to the SystemDictionary>processStartUpList
> 
> PWS startUp
>         PWS serveOnPort: 8080 loggingTo: 'log8080.txt'.

This is due to a bug in the way Squeak handles the startup
initialization. Andreas and I chased this problem for a while until
Andreas finally found it.

The problem is, that the startup list is processed *before* the external
object array gets initialized. So when you work with e.g. Sockets in the
startup list these entries are overwritten in the clearExternal objects
leading to arbitrary crashes.

Attached is an (unofficial) fix for this. There will be an updated VM
and the corresponding fixes coming up as soon as Andreas has the time to
consolidate the 2.5 VM.

Michael


-- 

 "To improve is to change, to be perfect is to change often." 
                                            Winston Churchill
+------------------------------------------------------------+
| Michael Rueger                                             |
| Phone: ++1 (818) 623 3283        Fax:   ++1 (818) 623 3559 |
+--------Michael.Rueger.-ND at online.disney.com----------------+
'From Squeak 2.5 of August 6, 1999 on 25 August 1999 at 1:32:38 pm'!

!SystemDictionary methodsFor: 'snapshot and quit' stamp: 'ar 8/19/1999 23:23'!
snapshot: save andQuit: quit
	"Mark the changes file and close all files. If save is true, save the current state of this Smalltalk in the image file. If quit is true, then exit to the outer shell. The latter part of this method runs when resuming a previously saved image. The resume logic checks for a document file to process when starting up."

	| resuming msg sourceLink |
	save & (SourceFiles at: 2) notNil ifTrue:
		[msg _  (quit
			ifTrue: ['----QUIT----']
			ifFalse: ['----SNAPSHOT----'])
			, Date dateAndTimeNow printString.
		sourceLink _ ' priorSource: ' , LastQuitLogPosition printString.
		self assureStartupStampLogged.
		LastQuitLogPosition _ (SourceFiles at: 2) setToEnd; position.
		self logChange: msg , sourceLink.
		Transcript cr; show: msg].

	self processShutDownList.
	Cursor write show.
	save
		ifTrue: [resuming _ self snapshotPrimitive]  "<-- PC frozen here on image file"
		ifFalse: [resuming _ false].
	quit & resuming not ifTrue: [self quitPrimitive].
	Cursor normal show.
	self setGCParameters.
	resuming ifTrue: [self clearExternalObjects].
	self processStartUpList.
	resuming ifTrue: [self readDocumentFile].
	^resuming! !





More information about the Squeak-dev mailing list