United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7002666 eclipse CDT projects crash with compressed oops
JDK-7002666 : eclipse CDT projects crash with compressed oops

Details
Type:
Bug
Submit Date:
2010-11-24
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P2
Resolution:
Fixed
Affected Versions:
hs19
Fixed Versions:
hs20 (b04)

Related Reports
Backport:
Backport:
Backport:

Sub Tasks

Description
On Nov 24, 2010, at 12:24 PM, Dr Andrew John Hughes wrote:

I reported this on jdk6-dev
(http://mail.openjdk.java.net/pipermail/jdk6-dev/2010-November/002095.html)
but thought it best to also report it here as there's been no
response.

The hs19 stable branch crashes with Eclipse's CDT plugin:

https://bugzilla.redhat.com/show_bug.cgi?id=647737

and the same occurs with the current OpenJDK7 HotSpot tree.
(http://hg.openjdk.java.net/jdk7/hotspot/hotspot)

Disabling compressed oops by default (as was done for hs17 stable)
will work around the problem, and this is what we presently do in
IcedTea6.

Is compressed oops ready for prime time in hs19 or is turning it off
the right path to go down?  Has anyone else seen this issue or know of
anything that might fix it?


To reproduce, from the bugzilla report:

Steps to Reproduce:
1. Run Eclipse (with CDT installed) (you can use either F14's eclipse or an
eclipse cdt downloaded from eclipse.org. the bug happens in both).
2. Create a C++ project
3. Add a main.cpp
4. add one line "#include <iostream>"
5. Save the file
6. If eclipse didn't crash right after saving, right click on the project and
select Indexer->Rebuild Index

                                    

Comments
WORK AROUND

-XX:-UseCompressedOops
                                     
2010-11-24
EVALUATION

This isn't a compressed oops bug per se but an existing bug that could only trigger under the object layout that results from compressed oops.  There's some logic that seeks to avoid initializing unused space at the end of instances but the tests it uses can trigger with arrays under compressed oops because we're able to shove the length into the header for arrays.  The fix is not to execute the logic for array allocations.
                                     
2010-11-30
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/4da76e32c0be
                                     
2010-12-01
EVALUATION

7002666: eclipse CDT projects crash with compressed oops
Reviewed-by: kvn, twisti

When emitting the code to zero a newly allocated object C2 attempts to
identify space that's already been initialized or extra space that
isn't actually part of an instance.  The logic for this should only be
executed for instances and never for arrays but the logic doesn't
explicitly test for arrays.  It's normally protected in the array case
because the klass is precise and the value of layout_helper will never
match zeroes_done since it's always negative for arrays.  In this case
the newArray is producing something that's typed as Object so the
klass input of the allocation says Object and it mistakenly assumes
the rest of the array doesn't need zeroing.  The fix is to only
execute this logic for AllocateNodes.  Tested with eclipse and with
new test case.
                                     
2010-12-02
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/4da76e32c0be
                                     
2010-12-16
EVALUATION

http://hg.openjdk.java.net/jdk7/build/hotspot/rev/4da76e32c0be
                                     
2010-12-25



Hardware and Software, Engineered to Work Together