3.6g VM on FreeBSD 5.1

Ian Piumarta ian.piumarta at inria.fr
Wed Sep 24 01:29:44 UTC 2003


On Tue, 23 Sep 2003, Brian Brown wrote:

> The exception is an older image from the ComSwiki bundle from the
> Squeak Wiki. I was using as recently as 3.6 beta 3, which I compiled,
> but under FreeBSD 4.8. When I try to run that now, I get a Segmentation
> Fault and a core file.
>
> I'm not sure, but the ComSwiki distro might be a 3.2 image, although
> that shouldn't matter, should it?

It shouldn't, but...  The problem appears to be an off-by-1 error in
testing for Ephemeron support in the garbage collector.  The problem only
manifests itself in images without Ephemeron support filed-in.  The
attached changeset fixes the error in the VM.  (As soon as Andreas
confirms the fix I will apply it in the distributed sources and release
a set of 3.2g-3 archives.)

In the meantime either

  - file the image-side Ephemeron support as posted by Andreas into your
    affected image(s); or

  - file the attached CS into your VMMaker image, regenerate the core VM,
    recompile; or

  - find the line in src/vm/interp.c that says

	if ((lengthOf(foo->specialObjectsOop)) >= ClassEphemeron) {

    and change it manually to

	if ((lengthOf(foo->specialObjectsOop)) > ClassEphemeron) {

    then recompile.

Ian
-------------- next part --------------
'From Squeak3.6beta of ''4 July 2003'' [latest update: #5411] on 24 September 2003 at 3:19 am'!
"Change Set:		Ephemeron-ikp
Date:			24 September 2003
Author:			Ian Piumarta

Fixes an off-by-1 error when testing for Ephemeron support in the GC."!


!ObjectMemory methodsFor: 'gc -- mark and sweep' stamp: 'ikp 9/24/2003 03:17'!
markPhase
	"Mark phase of the mark and sweep garbage collector. Set the mark bits of all reachable objects. Free chunks are untouched by this process."
	"Assume: All non-free objects are initially unmarked. Root objects were unmarked when they were made roots. (Make sure this stays true!!!!)."

	| oop |
	self inline: false.
	"clear the recycled context lists"
	freeContexts _ NilContext.
	freeLargeContexts _ NilContext.

	"initialize the ephemeron queue"
	lastEphemeron := nilObj.
	theEphemeronKeyOffset := 0.
	(self lengthOf: specialObjectsOop) > ClassEphemeron ifTrue:[
		theClassEphemeron := self splObj: ClassEphemeron.
		theEphemeronKeyOffset := self fixedFieldsOfClass: theClassEphemeron.
	].

	"trace the interpreter's objects, including the active stack and special objects array"
	self markAndTraceInterpreterOops.

	"trace the roots"
	1 to: rootTableCount do: [ :i | 
		oop _ rootTable at: i.
		self markAndTrace: oop.
	].

	"tracing is done, now mark ephemerons"
	(theClassEphemeron = nilObj or:[lastEphemeron = nilObj])
		ifFalse:[self markEphemerons].
! !



More information about the Squeak-dev mailing list