JDK-4453698 : HS1.4: Server VM hangs up while running b4212394 test
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-05-03
  • Updated: 2001-05-04
  • Resolved: 2001-05-04
Related Reports
Duplicate :  
Relates :  
Description

Name: elR10090			Date: 05/02/2001



Server Java HotSpot VM (build 1.4.0-beta-b62) hangs up while running the test

    nsk/regression/b4212394
    
in -Xcomp mode on all platforms. The test passes fine against Merlin-b62 in all 
other modes and against Ladybird-b23 in all modes.

The test checks that the synchronized(null) statement throws 
NullPointerException.
Due to Java Language Specification Second Edition (14.18 The synchronized 
statement):

    "SynchronizedStatement:
         synchronized (Expression) Block
     ...
     Otherwise, if the value of the Expression is null, a NullPointerException 
is thrown."

The source of the test is:

import java.io.PrintStream;

public class b4212394 {

    public static void main( String argv[] ) throws Exception {
        System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
    }

    public static int run(String args[], PrintStream out) {
	b4212394 o = null;
	try {
	    synchronized(o) {
	        out.println("Fubar: monitorenter didn't throw.");
	    }
	    out.println("Bottom of try block.");
	    return 2/*STATUS_FAILED*/;
	}
	catch(Throwable t) {
	    return 0/*STATUS_PASSED*/;
	}
    }
}

The test prints the line:

'Fubar: monitorenter didn't throw.'

and then hangs.

This failure is a regression of the known bug

    4212394: t104 in -Xcomp [NullPointerException must be thrown when synching 
on a null oop]

The test belongs to the testbase_nsk testbase located at:

    /net/sqesvr.eng/export/vsn/VM/testbase/testbase_nsk.v14

======================================================================

Comments
EVALUATION The C2 generated code does an uncommon_trap to handle the NullPointerException, but the stack state at the time is incorrect. This was fixed under the general problem of "misrouting of exceptions", fixed under BugID 4432078.
11-06-2004