[Vm-dev] Re: SegmentationFault in with OmniBrowser

Ted Neward ted at tedneward.com
Wed May 23 21:14:16 UTC 2007

There are a few Java assemblers out there. And, of course, various Java
compilers have had bugs in them over the years, too, though few and far

Thing is, though, you don't even need a bad compiler or assembler to
generate .class files that violate one another. Easy proof:

public class A { public int a; }
public class B {
  public static void main(String[] args) {
    A a = new A();
    a.a = 12;

Compile both (javac A.java B.java). Now modify A to be:

public class A { private int a; }

Now just recompile A (javac A.java). Run B (java B). Boom.

So the idea that the compiler (in the traditional C/C++/Java/C# sense) can
somehow track and prevent all sorts of errors is, to my mind, a foolish and
dangerous one. A post-compilation, pre-execution verifier is a Good
Thing(TM), IMHO.

FYI, inside the .NET CLR, the verifier and the JIT compiler are deeply and
tightly twisted against one another; the JVM verifier and JIT compilers
aren't quite so incestuously combined, but still pretty closely related.

Ted Neward
Java, .NET, XML Services
Consulting, Teaching, Speaking, Writing

> -----Original Message-----
> From: vm-dev-bounces at lists.squeakfoundation.org [mailto:vm-dev-
> bounces at lists.squeakfoundation.org] On Behalf Of tim Rowledge
> Sent: Tuesday, May 22, 2007 11:04 AM
> To: Squeak Virtual Machine Development Discussion
> Subject: Re: [Vm-dev] Re: SegmentationFault in with OmniBrowser
> On 22-May-07, at 10:56 AM, Philippe Marschall wrote:
> >
> > Java has a bytecode verifyer to prevent these problems with zero
> > runtime cost (if you don't count class loading). Squeak could have the
> > same.
> Absolutely irrelevant to the problem in question. Smalltalk has a
> 'bytecode verifier' too - it's called the compiler. It too makes sure
> the bytecodes are suitable as it 'loads' them.
> The problem is that if some *other* tool is generating bytecodes it
> can make 'bad' ones that will stomp over other objects. Just as in
> java you could etc etc. At least, I assume java could have a tool to
> generate bytecodes and run them? I wouldn't really know, never having
> had anything to do with it.
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Gotta run, the cat's caught in the printer.
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 5/21/2007
> 2:01 PM

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.6/815 - Release Date: 5/22/2007
3:49 PM

More information about the Vm-dev mailing list