JDK-4142926 : Object.wait(long) throws IllegalMonitorStateException for large numbers
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5
  • CPU: sparc
  • Submitted: 1998-05-27
  • Updated: 1998-06-09
  • Resolved: 1998-06-09
Related Reports
Duplicate :  
Description

Name: mgC56079			Date: 05/27/98



java.lang.Object.wait(long) throws IllegalMonitorStateException if parameter is
greater than or equal to 50000000000L.

JDK build is 1.2beta4G.

This causes JCK 1.2beta2 test failure: api/java_lang/Object/#Wait_long

======== A test demonstrating the bug ===================
public class WaitObject {

    public static void main(String[] args) {
	WaitObject o = new WaitObject();
	try {
          synchronized(o) {
              o.wait(50000000000L);
          }
	}
	catch( InterruptedException e ) {
	    System.out.println( "Another Thread interrupted" );
	}
    }

}

======== Fails with native threads ===================
% /set/java/JDK1.2-Beta4G/solaris/bin/java -native WaitObject
Exception in thread "main" java.lang.IllegalMonitorStateException: current thread not owner
	at java.lang.Object.wait(Native Method)
	at WaitObject.main(Compiled Code)
======== Works fine with green threads (does not return) ===================
% /set/java/JDK1.2-Beta4G/solaris/bin/java WaitObject
^C
======== 

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

Comments
EVALUATION Isn't this a duplicate of something? anand.palaniswamy@Eng 1998-06-08
08-06-1998