Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333654 - AIOOBE in IdentityHashSet.getInsertionIndex(*)
Summary: AIOOBE in IdentityHashSet.getInsertionIndex(*)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-06 09:12 EST by Paul Webster CLA
Modified: 2011-01-06 12:45 EST (History)
2 users (show)

See Also:


Attachments
Fix (1.37 KB, patch)
2011-01-06 12:37 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2011-01-06 09:12:23 EST
On of the test teams reported intermittent failures from ArrayIndexOutOfBoundsExceptions on 64 bit JVMs in
org.eclipse.jdt.ui.leaktest.reftracker.IdentityHashSet.getInsertionIndex(Object, Object[]).

It seems System.identityHashCode(*) is returning an extremely large number, which results in the modulo being negative.  It should probably be protected against numbers larger than 0x7FFFFFFF

PW
Comment 1 Dani Megert CLA 2011-01-06 09:19:18 EST
Paul, we need
- the exact VM
- the build id
Comment 2 Markus Keller CLA 2011-01-06 12:37:56 EST
Created attachment 186200 [details]
Fix

Yeah, makes sense. My VMs don't produce such high (low) identity hash codes, but the problem is easily reproducible when you replace
    System.identityHashCode(x)
with
    (0x80000000 | System.identityHashCode(x))
Comment 3 Markus Keller CLA 2011-01-06 12:45:04 EST
Fixed in HEAD.