Name: laC46010 Date: 12/05/97
The following example causes VM crash in jdk1.2X.
------------------------------------- file exceptions03102.java
public class exceptions03102 {
static void recursive() {
recursive();
}
public static void main(String argv[]) {
try {
recursive();
} catch (StackOverflowError e) {
return;
} catch (Throwable e) {
throw new RuntimeException("Unexpected exception (instead of a StackOverflowError) : " + e);
}
throw new RuntimeException("Cannot get a StackOverflowError");
}
}
------------------------------------- end of file exceptions03102.java
Running the test:
% setenv CLASSPATH .
%/export/ld14/java/dest/jdk1.2X/solaris/bin/javac -d . exceptions03102.java
% /export/ld14/java/dest/jdk1.2X/solaris/bin/java -verify exceptions03102
Segmentation Fault (core dumped)
%
This takes place in jdk versions: 1.2*
When java invoked without "-verify" argument, test passes successfully.
In jdk versions below 1.2 (1.1.5, 1.1.4, 1.1.1, etc) test passes successfully
with and without "-verify" argument supplied.
======================================================================