JDK-8046275 : Fastdebug build failing on jdk9/hs/ control jobs after pulling some hs-comp changes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-06-07
  • Updated: 2016-03-15
  • Resolved: 2014-06-09
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 7 JDK 8 JDK 9
7u85Fixed 8u20Fixed 9 b20Fixed
Description
Fastdebug build failing on linux, macos and windows for jdk9/hs/ control job after pulling some hs-comp changes. Fails building deploy:

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/node.hpp:708
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/jprt/T/P1/203548.amurillo/s/hotspot/src/share/vm/opto/node.hpp:708), pid=32317, tid=2190506896
#  assert(is_Bool()) failed: invalid node class
#
# JRE version: Java(TM) SE Runtime Environment (9.0-b16) (build 1.9.0-internal-fastdebug-201406062035.amurillo.jdk9-hs-2014-06-06-b16)
# Java VM: Java HotSpot(TM) Server VM (1.9.0-internal-fastdebug-201406062035.amurillo.jdk9-hs-2014-06-06-b16-fastdebug mixed mode linux-x86 )
# Core dump written. Default location: /opt/jprt/T/P1/203548.amurillo/s/deploy/make/plugin/java/core or core.32317
#
# An error report file with more information is saved as:
# /opt/jprt/T/P1/203548.amurillo/s/deploy/make/plugin/java/hs_err_pid32317.log
#
# Compiler replay data is saved as:
# /opt/jprt/T/P1/203548.amurillo/s/deploy/make/plugin/java/replay_pid32317.log
#
Comments
ILW=Assert - bad graph form, in jdk-control builds, none = HMH = P1
10-06-2014

noreg-hard: I was not able to write simple test. The problem is always reproduced with control JDK build with 'deploy'. I reproduced it also with Replay compilation but it requires including rt.jar and app.jar into a test.
09-06-2014

I think I found the problem. clone_loop() collects all outside IF nodes which use a Bool node inside loop and then construct new Bool node of Phi to replace the Phi of cloned Bool nodes after loop body cloned. This code is not triggered because in my case IF node references Bool through Opaque node (it is loop predicate). src/share/vm/opto/loopopts.cpp @@ -1403,7 +1403,8 @@ // loop. Happens if people set a loop-exit flag; then test the flag // in the loop to break the loop, then test is again outside of the // loop to determine which way the loop exited. - if( use->is_If() || use->is_CMove() ) { + // Loop predicate If node connectes to Bool node through Opaque1 node. + if(use->is_If() || use->is_CMove() || use->is_predicate_opaq(use)) { // Since this code is highly unlikely, we lazily build the worklist // of such Nodes to go split. if( !split_if_set )
08-06-2014

I can also try to reverse Bool split in PhiNode::Ideal()
07-06-2014

The only solution I found to prevent Bool node move away from If node is to switch off hashing: -uint BoolNode::hash() const { return (Node::hash() << 3)|(_test._test+1); } +uint BoolNode::hash() const { return NO_HASH; }
07-06-2014

The assert is hit in as_Bool() method: void Matcher::collect_null_checks( Node *proj, Node *orig_proj ) { Node *iff = proj->in(0); if( iff->Opcode() == Op_If ) { // During matching If's have Bool & Cmp side-by-side BoolNode *b = iff->in(1)->as_Bool(); If I skip this code Matcher will fail later because it can't match If node ("bad AD file").
07-06-2014

Edge case. Bool(CmpI) is moved inside counted loop because the loop has 2 separate exits and both exits have the same compare (loop limit check). After that pre-main-post optimization is executed on the loop and as result Phi of Bools node is created. The ideal graph is correct because we allow Phi of Bools. But matcher can't process such graph.
07-06-2014

If node has Phi node instead of Bool node: o1656 Phi === o1652 o2024 o1781 [[o1655 o916 ]] #bool o1655 Phi === o1230 o1656 o1657 [[o916 ]] #bool o1230 Region === o1230 o1231 o1583 [[o1230 o916 o950 o1655 o1665 o1679 o1914 o1940 o1976 o2104 o2110 o2169 o2175 o2181 o2187 ]] o916 If === o1230 o1655 o1656 [[o917 o925 438 ]] P=0.999999, C=-1.000000
07-06-2014

I reproduced it with compilation replay. java -cp ./app.jar -XX:+ReplayCompiles -XX:ReplayDataFile=./replay_pid81295.log
07-06-2014