United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8004741 Missing compiled exception handle table entry for multidimensional array allocation
JDK-8004741 : Missing compiled exception handle table entry for multidimensional array allocation

Details
Type:
Bug
Submit Date:
2012-12-07
Status:
Closed
Updated Date:
2014-01-14
Project Name:
JDK
Resolved Date:
2012-12-20
Component:
hotspot
OS:
Sub-Component:
compiler
CPU:
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
hs25 (b14)

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

Sub Tasks

Description
  
SHORT SUMMARY: 
Assert failure: missing exception handler in compiled method.
INDICATORS: 
Internal Error (sharedRuntime.cpp:665), pid=XXXXX, tid=XX guarantee(false) 
failed: missing exception handler
COUNTER INDICATORS: 
None
TRIGGERS: 
None known.
KNOWN WORKAROUND: 
Disable c2 compilation of affected method.
PRESENT SINCE: 
Unknown.
HOW TO VERIFY: 
Error message.
NOTES FOR SE: 
REGRESSION: 
No.
  

                                    

Comments
Day one bug. C2 does not generate exception path for runtime call to allocate multidimensional array. It could case error in sharedRuntime.cpp:

"guarantee(false) failed: missing exception handler"

The reason we don't see the problem more frequently is because compiled frame is deoptimized when there is an exception on return from runtime call or during safepoint. There is very small interval between exit from safepoint (at the end of JRT_ENTRY scope) and return from _multianewarrayN_C method when exception could be posted and will be processed by wrapper of runtime call.


                                     
2012-12-07
URL:   http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/2d6c433b1f38
User:  kvn
Date:  2012-12-20 06:53:01 +0000

                                     
2012-12-20
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/2d6c433b1f38
User:  amurillo
Date:  2012-12-21 20:28:27 +0000

                                     
2012-12-21
The failure reproduced with VM without fix but with disable exception processing deoptimization (with new flag -XX:+StressCompiledExceptionHandlers) in next jtreg test:

compiler/6712835

and new test

compiler/8004741

jtreg -testjdk:myjdk8/fastdebug -va -vmoptions:'-server -d64 -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers' compiler/6712835 compiler/8004741


I hit additional failure when ran compiler regression tests with disable deoptimization (with new flag -XX:+StressCompiledExceptionHandlers) for exceptions processing. 2 tests failed because thrown exception (NegativeArraySizeException) during runtime call was not caught by catch block:

compiler/6795161
compiler/6799693

The problem was C2 expected only OutOfMemoryError (which is not Exception) from slow allocation runtime calls. I replaced it with Throwable which C2 uses for other calls. 

Note, the failure can't be reproduced without instrumenting VM (new flag -XX:+StressCompiledExceptionHandlers) and as result can't verify the fix with promoted builds.

                                     
2012-12-20



Hardware and Software, Engineered to Work Together