[kaffe] RandomAccessFile causes StackOverflowError

Ito Kazumitsu ito.kazumitsu at hitachi-cable.co.jp
Tue Apr 1 16:07:01 PST 2003


In message "Re: [kaffe] RandomAccessFile causes StackOverflowError"
    on 03/03/28, Ito Kazumitsu <ito.kazumitsu at hitachi-cable.co.jp> writes:

> > The attached program causes StackOverflowError when run with
> > kaffe

> And here is a patch.

The problem is simple.

The attached programs go into an infinite loop as is easily seen.
And kaffe's read() of java.io.RandomAccessFile and some others
have the same kind of bug.

bash$ cat Foo.java
public class Foo {
    public void f() {
        System.err.println("This is Foo f()");
        f(0);
    }
    public void f(int n) {
        System.err.println("This is Foo f(int)");
    }
}
bash$ cat Bar.java
public class Bar extends Foo {
    public void f() {
        System.err.println("This is Bar f()");
        super.f();
    }
    public void f(int n) {
        System.err.println("This is Bar f(int)");
        f();
    }
    public static void main(String[] args) {
        (new Bar()).f(0);
    }
}
bash$ java Bar 2>&1 | less
This is Bar f(int)
This is Bar f()
This is Foo f()
This is Bar f(int)
This is Bar f()
This is Foo f()
This is Bar f(int)
This is Bar f()
This is Foo f()
...




More information about the kaffe mailing list