United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6996240 The BitSet.length method sometimes returns an index+1 value less than that of the highest bit set.
6996240 : The BitSet.length method sometimes returns an index+1 value less than that of the highest bit set.

Details
Type:
Bug
Submit Date:
2010-10-29
Status:
Closed
Updated Date:
2011-06-16
Project Name:
JDK
Resolved Date:
2011-01-20
Component:
hotspot
OS:
solaris
Sub-Component:
compiler
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
6u21
Fixed Versions:
hs20

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

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
                                     
2010-12-04
SUGGESTED FIX

Use iRegIsafe for dst.
                                     
2010-11-02
EVALUATION

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

Add flag -XX:-UsePopCountInstruction
                                     
2010-11-01
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).
                                     
2010-11-01
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.
                                     
2010-10-29



Hardware and Software, Engineered to Work Together