JDK-6996240 : The BitSet.length method sometimes returns an index+1 value less than that of the highest bit set.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6u21
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris
  • CPU: sparc
  • Submitted: 2010-10-29
  • Updated: 2011-06-16
  • Resolved: 2011-01-20
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.
JDK 6 JDK 7 Other
6u24-revFixed 7Fixed hs19Fixed
Related Reports
Relates :  
Relates :  
Description
The BitSet.length method sometimes returns an index+1 value less than that of the highest bit set. This does not occur for interpreted code, but manifests itself when the BitSet.length method is compiled to native code. This has been associated with a case where the Oracle JDBC driver was throwing intermittent protocol violation errors.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/build/hotspot/rev/885e464e1a40
04-12-2010

SUGGESTED FIX Use iRegIsafe for dst.
02-11-2010

EVALUATION Indeed it's a problem with countLeadingZerosL. dst is a iRegI but is used as temporary for an iRegL OR value.
02-11-2010

WORK AROUND Add flag -XX:-UsePopCountInstruction
01-11-2010

EVALUATION Introduced by changes for 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}() 2009-05-07-071651.ct232829.6823354 It passed with -XX:-UsePopCountInstruction (switched off).
01-11-2010

WORK AROUND There are three workarounds to this issue: 1. Add the parameter -XX:CompileCommand=exclude,java/util/BitSet,length to the java command line. 2. Run the 64bit JVM with -d64. 3. Run the 6u17 JVM.
29-10-2010