United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6798785 Crash in OopFlow::build_oop_map: incorrect comparison of 64bit pointers
JDK-6798785 : Crash in OopFlow::build_oop_map: incorrect comparison of 64bit pointers

Details
Type:
Bug
Submit Date:
2009-01-28
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
hotspot
OS:
solaris,linux_redhat_5.2,solaris_10
Sub-Component:
compiler
CPU:
x86,sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0u14,6u6,6u12,6-pool,7-pool
Fixed Versions:
hs15 (b02)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Duplicate:

Sub Tasks

Description
When defining a Dict you specify the compare and hash functions and Dict provides a couple useful default.  In particular for pointers it provides this:

// Slimey cheap key comparator.
int32 cmpkey(const void *key1, const void *key2) {
  return (int32)((intptr_t)key1 - (intptr_t)key2);
}

Unforturnately in 64-bit mode this throws away the high 32 bits of the pointer.

                                    

Comments
SUGGESTED FIX

// Cheap key comparator.                                                                                                             
int cmpkey(const void *key1, const void *key2) {
  if (key1 > key2) return 1;
  if (key1 == key2) return 0;
  return -1;
}
                                     
2009-01-28
EVALUATION

A traditional 3 way compare would work fine.
                                     
2009-01-28
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/1580954e694c
                                     
2009-02-04



Hardware and Software, Engineered to Work Together