Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Oct 1999 14:34:37 -0600
From:      Nate Williams <nate@mt.sri.com>
To:        Vince Gonzalez <vince@nycrc.net>
Cc:        freebsd-java@FreeBSD.ORG
Subject:   Re: Illegal instruction
Message-ID:  <199910232034.OAA09116@mt.sri.com>
In-Reply-To: <19991023155032.A1350@moe.nycrc.net>
References:  <19991023155032.A1350@moe.nycrc.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> I wrote some code like this:
> 
> public class MyPanel extends JPanel {
> 	public Component add(Component c) {
> 		doSomeStuff();
> 		return add(c); // This is incorrect on purpose
> 	}
> }
> 
> I know the line I've commented is incorrect (it should say super.add(c)).  
> When this code is run, java_X bombs out with SIGILL and dumps core.  I'm 
> thinking that it should instead die with StackOverflowError.  I can reproduce
> this very easily, with code very much like the above.

I attemped to reproduce this with the following trivial example, and
Java behaves as expected with the StackOverflowError.

public class Extended extends Base {
    public static void main(String args[]) {
        new Extended().foo(new Object());
    }

    public Object foo(Object a) {
        return foo(a);
    }
}

public class Base {
    public Object foo(Object a) {
        return foo(a);
    }
}

% java -fullversion
java_X full version "jdk1.1.8-FreeBSD:1999/9/22"
% uname -a
FreeBSD moth.mt.sri.com 2.2.8-STABLE FreeBSD 2.2.8-STABLE #4: Tue Jan 26
16:02:55 MST 1999     nate@moth.mt.sri.com:/opt/src/sys/compile/MOTH i386
%

[ Note, it's possible that this bug was fixed in the most recent JDK
release, hence my earlier question about java -fullversion.... ]



Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910232034.OAA09116>