Segmentation faults and friends.

Michael van der Gulik squeakml at gulik.co.nz
Tue Mar 28 06:18:11 UTC 2006


Hi all.

This is a rather philosophical question: is it a bug if the VM crashes, 
showing either a General Protection Fault, Segmentation Fault and core 
dump, or whatever the local operating system does?

I've discovered a few ways of generating segmentation faults (under 
Linux) using Squeak. One was playing around with CompiledMethods; I 
accidently broke a literal reference such that when the garbage 
collector ran, Squeak crashed.

This may or may not be a bug depending on whether you want to add bounds 
checking to the garbage collector, which may have a performance penalty.

Another way is the following, done in the workspace:

b := BlobMorph class.
m := Metaclass new.
m superclass: (b superclass) methodDictionary: (b methodDictionary) 
format: 2.
t := m new.
t class printIt.

In this case, format is invalid. It should be 152. Here, I was just 
being stupid.

So the question, again, is: should the VM *never* crash and protect 
against very curious, stupid programmers like myself, or should it work 
fine until the programmer becomes curious and stupid?

Michael.




More information about the Squeak-dev mailing list