test/compiler/6865265/StackOverflowBug.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7106907 Sdiff test/compiler/6865265

test/compiler/6865265/StackOverflowBug.java

Print this page




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 6865265
  28  * @summary JVM crashes with "missing exception handler" error
  29  * @author volker.simonis@sap.com
  30  *
  31  * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss128k StackOverflowBug
  32  */
  33 
  34 
  35 public class StackOverflowBug {
  36 
  37   public static int run() {
  38     try {
  39       try {
  40         return run();
  41       } catch (Throwable e) {
  42         // Notice that the class 'Throwable' is NOT resolved by the verifier,
  43         // because the verifier only checks if 'Throwable' is assignable to
  44         // 'java.lang.Throwable' and this check succeeds immediately if the two
  45         // types have equal names (see 'VerificationType::is_assignable_from' which
  46         // is called from 'ClassVerifier::verify_exception_handler_table').
  47         // This is strange, because if the two classes have different names,
  48         // 'is_assignable_from()' calls 'is_reference_assignable_from()' which resolves
  49         // both classes by calling 'SystemDictionary::resolve_or_fail()'. This call
  50         // also takes into account the current class loader (i.e. the one which was used
  51         // to load this class) and would place a corresponding




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 6865265
  28  * @summary JVM crashes with "missing exception handler" error
  29  * @author volker.simonis@sap.com
  30  *
  31  * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss224k StackOverflowBug
  32  */
  33 
  34 
  35 public class StackOverflowBug {
  36 
  37   public static int run() {
  38     try {
  39       try {
  40         return run();
  41       } catch (Throwable e) {
  42         // Notice that the class 'Throwable' is NOT resolved by the verifier,
  43         // because the verifier only checks if 'Throwable' is assignable to
  44         // 'java.lang.Throwable' and this check succeeds immediately if the two
  45         // types have equal names (see 'VerificationType::is_assignable_from' which
  46         // is called from 'ClassVerifier::verify_exception_handler_table').
  47         // This is strange, because if the two classes have different names,
  48         // 'is_assignable_from()' calls 'is_reference_assignable_from()' which resolves
  49         // both classes by calling 'SystemDictionary::resolve_or_fail()'. This call
  50         // also takes into account the current class loader (i.e. the one which was used
  51         // to load this class) and would place a corresponding


test/compiler/6865265/StackOverflowBug.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File