This is the mail archive of the
mauve-discuss@sourceware.org
mailing list for the Mauve project.
StackOverflowError
- From: Pedro Izecksohn <izecksohn at yahoo dot com>
- To: Mauve list <mauve-discuss at sources dot redhat dot com>
- Date: Wed, 26 Sep 2007 18:12:11 -0700 (PDT)
- Subject: StackOverflowError
May this list be the wrong place to discuss it, but:
The following code is not a Mauve compatibility test, but it does work different between Sun Microsystems' Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode) and gij (GNU libgcj) version 4.2.1 (Debian 4.2.1-5).
pedro@pentiumd:~/programming/java/recursive$ java Recursive
Successfully recursed 16286.
pedro@pentiumd:~/programming/java/recursive$ gij Recursive
Segmentation fault
public class Recursive {
static int nTimes=0;
public static void main (String [] args) {
Thread t = new Thread (new Runnable () {
public void run () {
recurse();
} // run ()
private void recurse () {
Recursive.nTimes++;
try {recurse();} catch (StackOverflowError soe) {}
} // recurse ()
} // Runnable
); // new Thread
t.start();
try {t.join();} catch (InterruptedException ie) {}
System.out.println ("Successfully recursed "+nTimes+".");
} // main (String [])
} // Recursive
____________________________________________________________________________________
Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7