Can't abandon sources

Boris Gaertner Boris.Gaertner at gmx.net
Mon Jan 5 00:10:47 UTC 2004


----- Original Message -----
From: Jim Rosenberg <jr at amanue.com>
To: squeak-dev <squeak-dev at lists.squeakfoundation.org>
Sent: Sunday, January 04, 2004 10:44 PM
Subject: Can't abandon sources


> Ugh! I'm trying to prepare an image for distribution. When I do Smalltalk
> abandonSources, I get a walkback most of the way through the progress bar
> that says
>
> Saving temp names for better decompilation
>
> I've attached a debug file, I think it includes the details about my
image.
>
> Any ideas anyone?

We saw this bug  in Squreak 3.2.
Eric Scharff reported it at Aug 07, 2002.
I answered the problem analysis that you find below.
(A poposed fix changed the format of  compiled
methods. This is *very* dangerous and we decided not
to include that into the image. Attached you find
that problematic fix again. It will *not* work in
Squeak 3.7 alpha, but it can be used in Squeak 3.6 #5424)

Greetings, Boris


---  Begin of mail from Aug 08, 2002: -----
Hello Eric,

I can confirm your observation.
This is - in my understanding - a serious bug.

The error occurs when a method with plenty of temporary variables
is transformed for use without sources.

When I verified your problem report the error happended when
this method was processed:

GeniePlugin>>primSameClassAbsoluteStrokeDistanceMyPoints:
myPointsOop otherPoints: otherPointsOop myVectors:
myVectorsOop otherVectors: otherVectorsOop
mySquaredLengths: mySquaredLengthsOop
otherSquaredLengths: otherSquaredLengthsOop
myAngles: myAnglesOop otherAngles: otherAnglesOop
maxSizeAndReferenceFlag: maxSizeAndRefFlag
rowBase: rowBaseOop rowInsertRemove: rowInsertRemoveOop
rowInsertRemoveCount: rowInsertRemoveCountOop


There are other methods that cause the same error.
These are:

CRStrokeFeature>>sameClassAbsoluteStrokeDistance:forReference:
CRStrokeFeature>>primSameClassAbsoluteStrokeDistance:forReference:

All these methods are part of Genie.

For a quick test you can simply remove Genie from your image
before you abandon the sources, but that is possibly not what
you really want.

Genie is a new feature and this may explain that we didn't see
the bug earlier. There is however nothing wrong with the methods
mentioned above. The problem is that a compression algorithm
cannot handle a very long string of temporary variable names.


Here is a description of  the bug itself:
abandonSources modifies all methods in the following
way: It creates a compressed string that contains the
names of all temporary variables of the method. That
compressed string is appended at the compiled method.

The error occurs because for each of the methods that I
mentioned above, the compressed string has a length greater
than 255 and in method CompiledMethod>>qCompress: it is
attempted to write these length values into a byte, which is
of course impossible: Values greater than 255 do not fit into
a byte.

 For the moment I assume that the mentioned method
CompiledMethod>>qCompress:  was simply not
designed to create compressed strings of a size
greater then 255, but that assumption would only imply
that we should revise that method. It would be a good
solution to use two-byte size fields, but this means that
we have to slightly modify the  format of compiled
methods and such a modification may have side-effects
that are difficult to foresee.


My first quick attempt to fix that bug ended with a failure. I
will continue my effords.

It is perhaps a feasible workaround to replace the names
of the temporary variables in the three mentioned methods
of GENIE with names that are *much* shorter but that
would be a workaround at best and I do not understand
its implications for the plugin and the VM (Sorry, I never
worked at plugin level; I use Smalltalk for not having to fight
against C :-)  )

Greetings, Boris


----- Original Message -----
From: Eric Scharff <Eric.Scharff at Colorado.EDU>
To: <squeak-dev at lists.squeakfoundation.org>
Sent: Wednesday, August 07, 2002 11:27 PM
Subject: [BUG]abandonSources in 3.2final


> In an attempt to create a Squeak image for the iPaq, my last step was to
> try to:
>  Smalltalk abandonSources; condenseChanges
>
> This caused an error:
>  Error: Improper store into indexable object
>
> I'd try to debug this, but I never really understood how sources, changes,
> and those wacky CompiledMethods worked. Sorry. :(
>
> Top of the stack:
>
> Error: Improper store into indexable object
> 7 August 2002 3:19:12 pm
>
> VM: Mac OS - Squeak3.2gamma of 15 January 2002 [latest update: #4857]
> Squeak VM 3.2.7b6
> Image: Squeak 3.2 [latest update: #4917]
>
> ByteArray(Object)>>error:
> Receiver: a ByteArray(189 174 182 117 56 234 109 64 99 209 20 235
> 103 83 142 166 212 11 218 241 26 5...etc...
> Arguments and temporary variables:
> aString: 'Improper store into indexable object'
> Receiver's instance variables:
> a ByteArray(189 174 182 117 56 234 109 64 99 209 20 235 103 83 142 166 212
> 11 218 241 26 5...etc...
> ByteArray(Object)>>errorImproperStore
> Receiver: a ByteArray(189 174 182 117 56 234 109 64 99 209 20 235
> 103 83 142 166 212 11 218 241 26 5...etc...
> Arguments and temporary variables:
>
> Receiver's instance variables:
> a ByteArray(189 174 182 117 56 234 109 64 99 209 20 235 103 83 142 166 212
> 11 218 241 26 5...etc...
> ByteArray(Object)>>at:put:
> Receiver: a ByteArray(189 174 182 117 56 234 109 64 99 209 20 235
> 103 83 142 166 212 11 218 241 26 5...etc...
> Arguments and temporary variables:
> index: 424
> value: 423
> Receiver's instance variables:
> a ByteArray(189 174 182 117 56 234 109 64 99 209 20 235 103 83 142 166 212
> 11 218 241 26 5...etc...
> WriteStream>>nextPut:
> Receiver: a WriteStream
> Arguments and temporary variables:
> anObject: 423
> Receiver's instance variables:
> collection: a ByteArray(189 174 182 117 56 234 109 64
> 99 209 20 235 103 83 142 ...etc...
> position: 424
> readLimit: 0
> writeLimit: 800
>
> --- The rest of the stack ---
> [] in CompiledMethod>>qCompress:
> ByteArray class(SequenceableCollection class)>>streamContents:
> CompiledMethod>>qCompress:
> CompiledMethod>>copyWithTempNames:
> [] in SystemDictionary>>abandonSources
> Set>>do:
> [] in SystemDictionary>>abandonSources
> [] in TestInterpreterPlugin class(Behavior)>>allSubclassesDoGently:
> Array(SequenceableCollection)>>do:
> TestInterpreterPlugin class(Class)>>subclassesDoGently:
> TestInterpreterPlugin class(Behavior)>>allSubclassesDoGently:
> [] in InterpreterPlugin class(Behavior)>>allSubclassesDoGently:
> Array(SequenceableCollection)>>do:
> InterpreterPlugin class(Class)>>subclassesDoGently:
> InterpreterPlugin class(Behavior)>>allSubclassesDoGently:
> [] in Object class(Behavior)>>allSubclassesDoGently:
> Array(SequenceableCollection)>>do:
> Object class(Class)>>subclassesDoGently:
> Object class(Behavior)>>allSubclassesDoGently:
> [] in ProtoObject class(Behavior)>>allSubclassesDoGently:
> Array(SequenceableCollection)>>do:
> ProtoObject class(Class)>>subclassesDoGently:
> ProtoObject class(Behavior)>>allSubclassesDoGently:
> SystemDictionary>>allBehaviorsDo:
> [] in SystemDictionary>>abandonSources
> ProgressInitiationException>>defaultAction
> ProgressInitiationException(Exception)>>signal
> ProgressInitiationException>>display:at:from:to:during:
> ProgressInitiationException class>>display:at:from:to:during:
> String>>displayProgressAt:from:to:during:
> SystemDictionary>>abandonSources
> UndefinedObject>>DoIt
> Compiler>>evaluate:in:to:notifying:ifFail:
> [] in TextMorphEditor(ParagraphEditor)>>evaluateSelection
> BlockContext>>on:do:
>
> -Eric
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abandonSourcesFix.cs
Type: application/octet-stream
Size: 3210 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040105/88ed4515/abandonSourcesFix.obj


More information about the Squeak-dev mailing list