JDK-4860981 : The Object#wait( long timeout) resumes without waiting time out in 1.3.X
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.3.1_07
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2003-05-09
  • Updated: 2012-10-08
  • Resolved: 2003-09-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.3.1_10 10Fixed
Related Reports
Relates :  
Description
The licnesee found the strange behavior in 1.3.1_07.
The Object#wait( long timeout) resumes without waiting time-out.

This issue is sensitive to environment, I will mention the configration
before reproducing process.

CONFIGRATION:
 - OS : Solaris 8 ( patch rev(libthread) is 108827-14 or older)
 - JRE: 1.3.1_07
 Note:
   to use /usr/lib/lwp

REPRODUCE:
 1) Compile the attached a.java in 1.3.1_07
 2) Invoke "env LD_LIBRARY_PATH=/usr/lib/lwp java a 3"
    Otherwise,
      % setenv LD_LIBRARY_PATH /usr/lib/lwp
      % java a 3
      
      
EXPECTED BEHAVIOR:

 Runtime.exec 0
 Process.waitFor 0
 Process.destroy 0
 Runtime.exec 1
 Process.waitFor 1
 Process.destroy 1
 Runtime.exec 2
 Process.waitFor 2
 Process.destroy 2
 
ACTUAL BEHAVIOR : 

 Waited: 27
 Runtime.exec 0
 Process.waitFor 0
 Process.destroy 0
 Waited: 36
 Runtime.exec 1
 Process.waitFor 1
 Process.destroy 1
 Waited: 39
 Runtime.exec 2
 Process.waitFor 2
 Process.destroy 2
 


NOTE:
 This issue does not occur in 1.4.X.
 Details, please see the commnet section.

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

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.3.1_10 FIXED IN: 1.3.1_10 INTEGRATED IN: 1.3.1_10
14-06-2004

SUGGESTED FIX ###@###.### 2003-05-21 $ sccs diffs globals.hpp ------- globals.hpp ------- 515a516,519 > product(bool, FilterSpuriousWakeups , true, > "Prevent spurious or premature wakeups from object.wait" > "(Solaris only)") > $ sccs diffs os_solaris.hpp ------- os_solaris.hpp ------- 336a337,338 > timestruc_t abst; > Event::compute_abstime(&abst, millis); 337a340 > int raw ; 342,343c345,364 < if (_count <= 0) { < timedwait(millis); --- > // Object.wait(timo) will return because of > // (a) notification > // (b) timeout > // (c) thread.interrupt > // > // Thread.interrupt and object.notify{All} both call Event::set. > // That is, we treat thread.interrupt as a special case of notification > // The underlying Solaris implementation, cond_timedwait, admits > // spurious/premature wakeups, but the JLS/JVM spec prevents the > // JVM from making those visible to Java code. As such, we must > // filter out spurious wakeups. We assume all ETIME returns are valid. > // > // TODO: properly differentiate simultaneous notify+interrupt. > // In that case, we should propagate the notify to another waiter. > > while (_count <= 0) { > raw = timedwait(&abst); > if (!FilterSpuriousWakeups) break ; // previous semantics > if (raw == ETIME || raw == ETIMEDOUT) break ; > // We consume and ignore EINTR and spurious wakeups.
11-06-2004

EVALUATION Changes as in 'Suggested Fix' section need to backported from 1.4.x to 1.3.1_xx. This issue will be fixed in 1.3.1_10 update release. ###@###.### 2003-06-03
03-06-2003

WORK AROUND To update lib. revision if possible, or no to use /usr/lib/lwp ###@###.### 2003-05-09 ===========================================================================
09-05-2003