Compiling and running the following example segfaults the default
VM in JDK 1.3.0rc1-S. With '-classic', the stack overflow is reported
properly. The simpler definition, commented out, works OK. Apparently,
it is important that the recursive call occur within a 'finally' clause.
public class Fault {
public static void main(String[] args) {
Fault x = new Fault();
x.foo();
}
/*
boolean foo() {
return foo();
}
*/
boolean foo() {
try {
}
finally {
return foo();
}
}
}
VM in JDK 1.3.0rc1-S. With '-classic', the stack overflow is reported
properly. The simpler definition, commented out, works OK. Apparently,
it is important that the recursive call occur within a 'finally' clause.
public class Fault {
public static void main(String[] args) {
Fault x = new Fault();
x.foo();
}
/*
boolean foo() {
return foo();
}
*/
boolean foo() {
try {
}
finally {
return foo();
}
}
}
- backport of
-
JDK-4306505 Infinite recursion from within finally clause (stack overflow) segfaults VM
-
- Closed
-