mantis http://bugs.impara.de/view.php?id=2591 and Traits? Or some other interesting issue?

John M McIntosh johnmci at smalltalkconsulting.com
Mon Apr 10 16:56:48 UTC 2006


rick at digitaldreams3d.com informed me that Squeak3.9a-7021.image won't  
let him export a jpeg image of a morphic.
It fails in

JPEGReadWriter2(Object)>>error:
	Receiver: a JPEGReadWriter2
	Arguments and temporary variables:
		aString: 	'a primitive has failed'
	Receiver's instance variables:
		stream: 	MultiByteFileStream: '/Users/rick/Desktop/Squeak3.9a-7021/ 
System Browse...etc...

JPEGReadWriter2(Object)>>primitiveFailed
	Receiver: a JPEGReadWriter2
	Arguments and temporary variables:

	Receiver's instance variables:
		stream: 	MultiByteFileStream: '/Users/rick/Desktop/Squeak3.9a-7021/ 
System Browse...etc...

JPEGReadWriter2>>primJPEGWriteImage:onByteArray:form:quality:progressive 
JPEG:errorMgr:
	Receiver: a JPEGReadWriter2
	Arguments and temporary variables:
		aJPEGCompressStruct: 	a ByteArray(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
0 0 0 0 0 0 ...etc...
		destination: 	a ByteArray(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
0 0 0 0 0 0 ...etc...
		form: 	Form(692x525x32)
		quality: 	-1
		progressiveFlag: 	false
		aJPEGErrorMgr2Struct: 	a ByteArray(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
0 0 0 0 0 0 0...etc...
	Receiver's instance variables:
		stream: 	MultiByteFileStream: '/Users/rick/Desktop/Squeak3.9a-7021/ 
System Browse...etc...

JPEGReadWriter2>>nextPutImage:quality:progressiveJPEG:
	Receiver: a JPEGReadWriter2
	Arguments and temporary variables:
		aForm: 	Form(692x525x32)
		quality: 	-1
		progressiveFlag: 	false
		sourceForm: 	Form(692x525x32)
		jpegCompressStruct: 	a ByteArray(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
0 0 0 0 0 0 0...etc...
		jpegErrorMgr2Struct: 	a ByteArray(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
0 0 0 0 0 0 ...etc...
		buffer: 	a ByteArray(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
0 0 0 0 0 0 0...etc...
		byteCount: 	nil
	Receiver's instance variables:
		stream: 	MultiByteFileStream: '/Users/rick/Desktop/Squeak3.9a-7021/ 
System Browse...etc...



However in looking at the code when the primitive attempts to resolve  
the Form argument it calls
	interpreterProxy->success(interpreterProxy->isKindOf 
(interpreterProxy->stackValue(3), "Form"));
but when you wander down the isKindOf() logic into sqInt classNameOfIs 
(sqInt aClass, char * className)

	name = longAt((aClass + BaseHeaderSize) + (6 << ShiftForWord));
	if (!(((name & 1) == 0) && (((((usqInt) (longAt(name))) >> 8) & 15)  
 >= 8))) {
		return 0;
	}


It returns 0 at this point, which is the check to see if the class  
name in slot 6 is a string.
It is not...

Now wasn't there something about traits altering the class  
description and shifting things so that perhaps the class name isn't  
what you
expect anymore.  I'll note I tested this with a 7006 3.9a image and  
had the same problem.


--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===




More information about the Vm-dev mailing list