Re: [Pharo-dev] Shouldn't new:0 fail for non-indexable classes
2017-08-09 22:14 GMT+02:00 Eliot Miranda: > Hi Nicolai, > > On Tue, Aug 8, 2017 at 12:10 PM, Nicolai Hess > wrote: > >> see fogbugz 20246 (https://pharo.fogbugz.com/f/c >> ases/20246/Segfault-calling-new-0) >> >> Create a class with a single instance variable. >> >> call >> >> AClass new:0 >> >> -> segfaults (on windows latest vm). >> I can reproduce this on squeak (Squeak5.1-16549-32bit). It does not crash >> right away, but >> I was able to crash it by debugging into the new: call. >> >> from the comment of Behavior>>#new: , I would expect the error: >> >> self error: self printString, ' cannot have variable sized instances' >> > > Quite right. Squeak and Pharo used to have a funky class DirectoryEntry > that was expected to be able to be instantiated with DirectoryEntry new: > 0. The (Spur) VM bug is that the object was being filled with 0's instead > of nil. I've fixed the Spur VM to now fail for any non-indexable class > since, AFAICT, DirectoryEntry is no longer used in this way. > Thank you! > > _,,,^..^,,,_ > best, Eliot >
Re: [Pharo-dev] Shouldn't new:0 fail for non-indexable classes
Hi Nicolai, On Tue, Aug 8, 2017 at 12:10 PM, Nicolai Hesswrote: > see fogbugz 20246 (https://pharo.fogbugz.com/f/ > cases/20246/Segfault-calling-new-0) > > Create a class with a single instance variable. > > call > > AClass new:0 > > -> segfaults (on windows latest vm). > I can reproduce this on squeak (Squeak5.1-16549-32bit). It does not crash > right away, but > I was able to crash it by debugging into the new: call. > > from the comment of Behavior>>#new: , I would expect the error: > > self error: self printString, ' cannot have variable sized instances' > Quite right. Squeak and Pharo used to have a funky class DirectoryEntry that was expected to be able to be instantiated with DirectoryEntry new: 0. The (Spur) VM bug is that the object was being filled with 0's instead of nil. I've fixed the Spur VM to now fail for any non-indexable class since, AFAICT, DirectoryEntry is no longer used in this way. _,,,^..^,,,_ best, Eliot
[Pharo-dev] Shouldn't new:0 fail for non-indexable classes
see fogbugz 20246 ( https://pharo.fogbugz.com/f/cases/20246/Segfault-calling-new-0) Create a class with a single instance variable. call AClass new:0 -> segfaults (on windows latest vm). I can reproduce this on squeak (Squeak5.1-16549-32bit). It does not crash right away, but I was able to crash it by debugging into the new: call. from the comment of Behavior>>#new: , I would expect the error: self error: self printString, ' cannot have variable sized instances'