JDK-6890984 : Comparison of 2 arrays could cause VM crash.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs17,7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic,x86
  • Submitted: 2009-10-13
  • Updated: 2013-06-06
  • Resolved: 2011-03-08
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
6u21Fixed 7Fixed hs17Fixed
Related Reports
Duplicate :  
Relates :  
These 2 tests crash on the solaris x86 & windows, they fail on the linux and pass on the solaris-sparc. It looks the their failure have same reason. They fails during array comparison for the hs 17 b03 in the jdk7b74 only. The server & Xcomp should be used to reproduce failures.

The tests are:

Here is the link to the failures in this PIT:

Here is the message:

# A fatal error has been detected by the Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0xf9501629, pid=8721, tid=2
# JRE version: 7.0-b73
# Java VM: Java HotSpot(TM) Server VM (17.0-b03-2009-10-09-222614.et151817.hs17b03-fastdebug compiled mode solaris-x86 )
# Problematic frame:
# J  sun.reflect.annotation.AnnotationInvocationHandler.memberValueEquals(Ljava/lang/Object;Ljava/lang/Object;)Z
# An error report file with more information is saved as:
# /net/peter-home1.russia/export/home1/29/lm153972/ws/bugs/b74/hs_err_pid8721.log
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
Current thread is 2
Dumping core ...
Abort (core dumped)

EVALUATION Note: the problem exists only in HS17 (from b03) which has full fix for 6827605 with aassembler code rearrangment.

PUBLIC COMMENTS Problem: I did incorrect "optimization" in 6827605 changes - replaced 2 null pointer checks with andptr(p1,p2) instruction which damages the result register. I should have use testptr(p1,p2) but it is also incorrect. There is problem on sparc also - br() instruction is used instead of brx() when comparing pointers. Solution: Restore original null checks for x86. Use brx() when comparing pointers on sparc.

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/d40f03b57795

EVALUATION This appears to be caused by the fix for 6827605. The Arrays.equals code changed and it seems to be the cause of the failure. Grabbing the regression test test/java/lang/annotation/UnitTest.java from the jdk workspace and running this reproduces it: java -server -Xcomp -XX:CompileOnly=sun/reflect/annotation/AnnotationInvocationHandler.memberValueEquals UnitTest I think it's not handling the bounds properly.