[squeak-dev] renaming a class causes invalid super pointer CompiledMethod..!

Chris Muller asqueaker at gmail.com
Fri Jan 16 19:54:20 UTC 2015


I'm starting to suspect Environments.  The last-literal binding is not
updated after rename..

Object compile: 'test  ^''Hello from Object'''.
(Object subclass: #MyClass instanceVariableNames: ''
classVariableNames: '' poolDictionaries: '' category: 'Test') compile:
'test  ^ super halt test, ''my super call lands on itself!'''.
((Smalltalk classNamed: #MyClass) methodDictionary at: #test) explore.
self halt: 'About to rename'.
(Smalltalk classNamed: #MyClass) rename: 'MyNewAbstraction'.
((Smalltalk classNamed: #MyNewAbstraction) methodDictionary at: #test) explore.
self halt: 'About to add MyClass as subclass'.
((Smalltalk classNamed: #MyNewAbstraction) subclass: #MyClass
instanceVariableNames: '' classVariableNames: '' poolDictionaries: ''
category: 'Test').
(Smalltalk classNamed: #MyNewAbstraction) new test

On Thu, Jan 15, 2015 at 5:11 PM, Tobias Pape <Das.Linux at gmx.de> wrote:
> Hi,
>
> On 15.01.2015, at 23:48, Chris Muller <ma.chris.m at gmail.com> wrote:
>
>> I did a minor class-hierarchy refactoring today which resulted in a an
>> invalid super pointer, resulting in a confusing image lock up due to
>> tight recursion.  The script, below, demonstrates the issue in trunk:
>>
>> Object compile: 'test  ^''Hello from Object'''.
>> (Object subclass: #MyClass instanceVariableNames: ''
>> classVariableNames: '' poolDictionaries: '' category: 'Test') compile:
>> 'test  ^ super halt test, ''my super call lands on myself!'''.
>> (Smalltalk classNamed: #MyClass) rename: 'MyNewAbstraction'.
>> ((Smalltalk classNamed: #MyNewAbstraction) subclass: #MyClass
>> instanceVariableNames: '' classVariableNames: '' poolDictionaries: ''
>> category: 'Test').
>> (Smalltalk classNamed: #MyNewAbstraction) new test
>>
>> But an existing method in the original MyClass had a call to super
>> which now lands in itself, resulting in a tight recursion.
>>
>> The same script without creating the new subclass results in an
>> instant VM crash (both interpreter 2357 and cog 3205):
>>
>> Object compile: 'test  ^''Hello from Object'''.
>> (Object subclass: #MyClass instanceVariableNames: ''
>> classVariableNames: '' poolDictionaries: '' category: 'Test') compile:
>> 'test  ^ super halt test, ''my super call lands on itself!'''.
>> (Smalltalk classNamed: #MyClass) rename: 'MyNewAbstraction'.
>> (Smalltalk classNamed: #MyNewAbstraction) new test
>>
>> I even tried recompiling my entire class hierarchy which was renamed,
>> but it didn't help.
>>
>> How can this be?  I _KNOW_ I've used rename class many times in the
>> past...  A regression?
>>
>> I went all the way back to 4.2.  The above script doesn't crash the VM
>> in 4.2 or 4.3.  Squeak 4.4 and 4.5 and trunk all crash by the above
>> script.
>>
>> All of those images (4.2 -- trunk) had the problem with the super
>> pointer back to itself..
>
> I experienced this very problem in these minutes also.
>
> Best
>         -Tobias
>
>
>


More information about the Squeak-dev mailing list