JDK-4298263 : JVMDI: HotSparc VM crashes when JVMDI_EVENT_SINGLE_STEP is set after BREAKPOINT
  • Type: Bug
  • Component: vm-legacy
  • Sub-Component: jvmdi
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 1999-12-09
  • Updated: 2000-01-05
  • Resolved: 2000-01-05
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description

Name: dkC59003			Date: 12/09/99



The regression test (testbase_nsk) nsk/regression/b4289162 causes crash of
the HotSparc 1.3-Q on Solaris.
The test sets BREAKPOINT in emptyMethod and when BREAKPOINT
is caught the test calls
SetEventNotificationMode(JVMDI_ENABLE, JVMDI_EVENT_SINGLE_STEP, ...)
method, which crashes VM.
It had been checked that the same happens with not-empty method.


To reproduce the bug run doit.sh on Solaris and doit.bat on win32 in
GammaBase/Bugs/<this bug number>.


See logs and java source below.
Comments in java source code indicate the line that causes the crash.
If this line is commented out the HotSparc (build 1.3-Q) does not crash,
but the test fails as it is reported in bug #4294585 - its development 
status is NYI (for today).

The test crashes classic VM with bus error.

The test causes crash of the HotSpot 1.3fcs-Q on win32 no matter
there is the line causing crash of HotSparc or not.
The BugReport ID: 4297945 had been filed for this case.

Logs:

% doit.sh
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-Q)
Java HotSpot(TM) Client VM (build 1.3-Q, interpreted mode)
----> breakpoint_init: BREAKPOINT is set for b4289162.emptyMethod()
----> catch_BREAKPOINT: breakpoint_counter = 1
#
# HotSpot Virtual Machine Error, Unexpected Signal 10
#
# Error ID: 4F533F534F4C415249530E43505007B5 01
#
(Error ID: os_solaris.cpp, 1973)


% doit.sh -classic
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-Q)
Classic VM (build 1.3.0-Q, green threads, nojit)
----> breakpoint_init: BREAKPOINT is set for b4289162.emptyMethod()
----> catch_BREAKPOINT: breakpoint_counter = 1
SIGBUS    10*  bus error
    si_signo [10]: SIGBUS    10*  bus error
    si_errno [0]: Error 0
    si_code [1]: BUS_ADRALN [addr: 0x1]


------------------------------  java source -----------------------
public class b4289162 {
    static int emptyMethod_call_counter;
    static int emptyMethod_exit_counter;
    static int emptyMethod_call_number;
    static int breakpoint_counter;
    static int v_set_EVENT_SINGLE_STEP_err;
    static int v_unset_EVENT_SINGLE_STEP_err;
    static int EVENT_SINGLE_STEP_catch_counter;

    public static int run(String argv[], java.io.PrintStream out) {

        emptyMethod_call_number = 5;
        emptyMethod_call_counter=0;
        v_set_EVENT_SINGLE_STEP_err = -1;
        v_unset_EVENT_SINGLE_STEP_err = -1;
        EVENT_SINGLE_STEP_catch_counter = 0;

        if ( breakpointInit(Thread.currentThread()) == -1 ) {
            System.out.println("----> Test nsk/regression/4289162 FAILED" );
            System.out.println("----> ERROR in breakpoint_init() Method!");
            return 2/*STATUS_FAILED*/;
        }
        for ( ; emptyMethod_call_counter < emptyMethod_call_number; ){
            emptyMethod_call_counter++;

// the next line causes crash of the HotSparc (build 1.3-Q) 
// if this line is commented out the HotSparc (build 1.3-Q) does not crashes
        System.out.println("----> RUN: emptyMethod_call_counter = " + emptyMethod_call_counter);

	        emptyMethod();
            emptyMethod_exit_counter++;
/*DEBUG
        System.out.println("----> RUN: emptyMethod_exit_counter = " + emptyMethod_exit_counter);
*/
	    }
        breakpoint_counter = getBreakpointCounter();
        if ( breakpoint_counter == -1 ) {
            System.out.println("----> Test nsk/regression/4289162 FAILED" );
            System.out.println("----> ERROR in getBreakpointCounter() Method!");
            return 2/*STATUS_FAILED*/;
        }
        if ( (breakpoint_counter != emptyMethod_call_number)
            || (v_set_EVENT_SINGLE_STEP_err == 1) 
            || (v_unset_EVENT_SINGLE_STEP_err == 1) 
            || (EVENT_SINGLE_STEP_catch_counter == 0) ) {
            
            System.out.println("----> Test nsk/regression/4289162 FAILED" );

            System.out.println("----> Expected result: breakpoint_counter = " + 
emptyMethod_call_number);
            System.out.println("---->                  Set_EVENT_SINGLE_STEP = MADE");
            System.out.println("---->                  UnSet_EVENT_SINGLE_STEP = MADE");
            System.out.println("---->                  EVENT_SINGLE_STEP_catch_counter = 1");
            System.out.println("----> Produced result: breakpoint_counter = " + breakpoint_counter);
            if ( v_set_EVENT_SINGLE_STEP_err == -1 ) {
                System.out.println("---->                  Set_EVENT_SINGLE_STEP = NOT CALLED");
            }
            if ( v_set_EVENT_SINGLE_STEP_err == 1 ) {
                System.out.println("---->                  Set_EVENT_SINGLE_STEP = ERROR");
            }
            if ( v_set_EVENT_SINGLE_STEP_err == 0 ) {
                System.out.println("---->                  Set_EVENT_SINGLE_STEP = MADE");
            }
            if ( v_unset_EVENT_SINGLE_STEP_err == -1 ) {
                System.out.println("---->                  UnSet_EVENT_SINGLE_STEP = NOT CALLED");
            }
            if ( v_unset_EVENT_SINGLE_STEP_err == 1 ) {
                System.out.println("---->                  UnSet_EVENT_SINGLE_STEP = ERROR");
            }
            if ( v_unset_EVENT_SINGLE_STEP_err == 0 ) {
                System.out.println("---->                  UnSet_EVENT_SINGLE_STEP = MADE");
            }
            System.out.println("---->                  EVENT_SINGLE_STEP_catch_counter = 
"+EVENT_SINGLE_STEP_catch_counter);
            return 2/*STATUS_FAILED*/;
        }
//*DEBUG
        System.out.println("----> Test nsk/regression/4289162 PASSED" );
        System.out.println("----> Produced (expected) result: breakpoint_counter = " + 
emptyMethod_call_number);
        System.out.println("---->                             Set_EVENT_SINGLE_STEP = MADE");
        System.out.println("---->                             UnSet_EVENT_SINGLE_STEP = MADE");
        System.out.println("---->                             EVENT_SINGLE_STEP_catch_counter = 1");
//*/
        return 0/*STATUS_PASSED*/;
	}


	public static void emptyMethod(){
	}

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

    native static int breakpointInit(Thread currentTread);
    native static int getBreakpointCounter();

    static {
	try {
	    System.loadLibrary("b4289162");
/*DEBUG
System.out.println("----> loadLibrary(\"b4289162\") - COMPLETED");
*/
	}
	catch (UnsatisfiedLinkError ule) {
	    System.out.println("----> Could not load b4289162 library");
	    System.out.println("----> java.library.path:" + System.getProperty("java.library.path"));
	    throw ule;
	}
    }

}    // end of b4289162 Class 
------------------------------ end of java source -----------------------
 
======================================================================

Name: dkC59003			Date: 12/20/99



The following fragment in the Description is wrong:
"
Comments in java source code indicate the line that causes the crash.
If this line is commented out the HotSparc (build 1.3-Q) does not crash,
but the test fails as it is reported in bug #4294585 - its development 
status is NYI (for today).
"

It's correct version is:

"
Comments in java source code indicate the line that the crash depends on.
If this line is commented out the HotSparc (build 1.3-Q) crashes.
Otherwise HotSparc (build 1.3-Q) does not crash,
but the test fails as it is reported in bug #4294585 - its State
is "evaluated" (for today - 12.21.99).
"

And the corresponding fragment in the java source:
"
// th next line causes crash of the HotSparc (build 1.3-Q) 
// if this line is commented out the HotSparc (build 1.3-Q) does not crashes
         System.out.println("----> RUN: emptyMethod_call_counter = " + emptyMethod_call_counter);
"         

should be the following:
"
// the crash of the HotSparc (build 1.3-Q) depends on the next line:
// if this line is commented out the HotSparc (build 1.3-Q) crashes
// otherwise HotSparc (build 1.3-Q) does not crash
//        System.out.println("----> RUN: emptyMethod_call_counter = " + emptyMethod_call_counter);
"


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

Comments
EVALUATION This bug (th VM crash) is not reproducible with build R. There is still a failure. A new bug will be opened for the regression test failure. | arches% doit.sh | java version "1.3.0" | Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-R) ^^^^^^^^^^^^^ | Java HotSpot(TM) Client VM (build 1.3-R, interpreted mode) | ----> breakpoint_init: BREAKPOINT is set for b4289162.emptyMethod() | ----> RUN: emptyMethod_call_counter = 1 | ----> catch_BREAKPOINT: breakpoint_counter = 1 | ----> Set Event Notification Mode(JVMDI_ENABLE, JVMDI_EVENT_SINGLE_STEP) - MADE! | ----> catch_BREAKPOINT: breakpoint_counter = 2 | ----> catch__SINGLE_STEP: breakpoint_counter = 2 | ----> RUN: emptyMethod_call_counter = 2 | ----> catch_BREAKPOINT: breakpoint_counter = 3 | ----> RUN: emptyMethod_call_counter = 3 | ----> catch_BREAKPOINT: breakpoint_counter = 4 | ----> RUN: emptyMethod_call_counter = 4 | ----> catch_BREAKPOINT: breakpoint_counter = 5 | ----> RUN: emptyMethod_call_counter = 5 | ----> catch_BREAKPOINT: breakpoint_counter = 6 | ----> Test nsk/regression/4289162 FAILED ^^^^^^ | ----> Expected result: breakpoint_counter = 5 | ----> Set_EVENT_SINGLE_STEP = MADE | ----> UnSet_EVENT_SINGLE_STEP = MADE | ----> EVENT_SINGLE_STEP_catch_counter = 1 | ----> Produced result: breakpoint_counter = 6 | ----> Set_EVENT_SINGLE_STEP = MADE | ----> UnSet_EVENT_SINGLE_STEP = MADE | ----> EVENT_SINGLE_STEP_catch_counter = 1 ========================================================================= It was a fault of the bug's author - to submit wrong b4289162.java file for GammaBase/Bugs/4298263 directory. Today, I had adjusted that file due to the newly updated bug's description; and I have reproduced the VM crash for HS 1.3-fcsR: eugene:/net/sqesvr/vsn/GammaBase/Bugs/4298263 7 % doit.sh java version "1.3.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-R) Java HotSpot(TM) Client VM (build 1.3-R, interpreted mode) ----> breakpoint_init: BREAKPOINT is set for b4289162.emptyMethod() ----> catch_BREAKPOINT: breakpoint_counter = 1 # # HotSpot Virtual Machine Error, Unexpected Signal 10 # # Error ID: 4F533F534F4C415249530E43505007B6 01 # (ErrorID == "os_solaris.cpp, 1974") BTW: It was my fault to suggest to file new bug for the HS failure against old variant of the test b4289162.java -- the bug's author says such bug is already filed as #4294585 <###@###.###>, 21 Dec 1999 Name: dkC59003 Date: 01/05/2000 You are right (see last Comments). In fact, this is the test bug. See the bug report #4302639. Therefore this bug report should be closed as Not a Bug. The nsk/regression/b4289162 test has been fixed and now the HotSparc (build 1.3-R) does not crash. But the test fails as it is reported in bug #4294585 - the HotSparc generates unexpected JVMDI_EVENT_BREAKPOINT event (6 events instead of 5). ###@###.### 2000-01-05 ======================================================================
05-01-2000