Hi.
I found reproducible problem with forwardBecome. It exists on Pharo and Squeak. For Pharo we get issue 17536 https://pharo.fogbugz.com/f/cases/17536/VM-Crash-when-adding-an-iVar-to-a-subclass-of-SystemAnnouncement .
Try to execute following script:
obj1 := 20@10. obj2 := 50@30.
weak := WeakValueAssociation new. weak key: obj1..
obj1 becomeForward: obj2. Smalltalk garbageCollect. weak key class. "-> SmallInteger. If you try to print 'weak key' image will crash"
Lines with become and garbage collection should be executed together. Instead anything is working correctly. So it is somehow related to stack state.
Interesting that WeakArray is working correctly. Try script with
weak := WeakArray new: 1. weak at: 1 put: obj1.
Best regards, Denis
I have seen this a few times too, where an object on the debugger stack, that should definitely not be a SmallInteger, is. And so the DNU is always, SmallInteger DNU someMessage.
But I never could reproduce it. Good find.
On Mon, Feb 8, 2016 at 11:43 AM, Denis Kudriashov dionisiydk@gmail.com wrote:
Hi.
I found reproducible problem with forwardBecome. It exists on Pharo and Squeak. For Pharo we get issue 17536.
Try to execute following script:
obj1 := 20@10. obj2 := 50@30.
weak := WeakValueAssociation new. weak key: obj1..
obj1 becomeForward: obj2. Smalltalk garbageCollect. weak key class. "-> SmallInteger. If you try to print 'weak key' image will crash"
Lines with become and garbage collection should be executed together. Instead anything is working correctly. So it is somehow related to stack state.
Interesting that WeakArray is working correctly. Try script with
weak := WeakArray new: 1. weak at: 1 put: obj1.
Best regards, Denis
vm-dev@lists.squeakfoundation.org