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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

johnmci
[hidden email] 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 <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===

Reply | Threaded
Open this post in threaded view
|

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

Petr-9
Hello,
I pointed this out some time in January. Andreas Raab wrote some
explanation why this happens and what might be the solution.
http://article.gmane.org/gmane.comp.lang.smalltalk.squeak.general/98022

Petr

Reply | Threaded
Open this post in threaded view
|

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

Marcus Denker
In reply to this post by johnmci

On 10.04.2006, at 18:56, John M McIntosh wrote:

> [hidden email] informed me that Squeak3.9a-7021.image  
> won't let him export a jpeg image of a morphic.
> It fails in
>
>
> 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.
>
Yes, Traits related. Adrian worked hard to fix it. We are in the  
process of testing/valitdating the fix. (I've attached it the changeset)





TraitsIVarShifting.cs (5K) Download Attachment