JDK-8231565 : More node budget asserts in fuzzed tests
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-09-27
  • Updated: 2022-03-14
  • Resolved: 2019-10-28
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 11 JDK 14
11.0.16-oracleFixed 14 b21Fixed
Related Reports
Relates :  
Relates :  
Description
This happens even after JDK-8229499 is fixed, although at much lower frequency. The particular test was generated by fuzzing, and fails with node budget asserts semi-reliably. See attached 0007.tar.gz for the reproducer and sample hs_errs.

$ for I in `seq 1 10`; do ~/trunks/jdk-jdk/build/linux-x86_64-server-fastdebug/images/jdk/bin/java Test; done

#  Internal Error (/home/shade/trunks/jdk-jdk/src/hotspot/share/opto/loopnode.hpp:1413), pid=32568, tid=32579
#  assert(C->live_nodes() - live_at_begin <= 2 * _nodes_required) failed: Bad node estimate: actual = 449 >> request = 153
#
# JRE version: OpenJDK Runtime Environment (14.0) (fastdebug build 14-internal+0-adhoc.shade.jdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 14-internal+0-adhoc.shade.jdk-jdk, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x11ed2ea]  AutoNodeBudget::~AutoNodeBudget()+0x1ba
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/shade/trunks/JavaFuzzer/tests/0007/core.32568)

---------------  T H R E A D  ---------------

Current thread (0x00007fc42c592000):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=32579, stack(0x00007fc3cc027000,0x00007fc3cc128000)]


Current CompileTask:
C2:    137   64 % !   4       Test::fMeth @ 60 (429 bytes)

Stack: [0x00007fc3cc027000,0x00007fc3cc128000],  sp=0x00007fc3cc122200,  free space=1004k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x11ed2ea]  AutoNodeBudget::~AutoNodeBudget()+0x1ba
V  [libjvm.so+0x11e9d75]  IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x175
V  [libjvm.so+0x11ea588]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x2d8
V  [libjvm.so+0x11ea3fd]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x14d
V  [libjvm.so+0x11ea3fd]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x14d
V  [libjvm.so+0x120e0e6]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xbf6
V  [libjvm.so+0x9c94d1]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x2c1
V  [libjvm.so+0x9c6388]  Compile::Optimize()+0x9d8
V  [libjvm.so+0x9c7bf5]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x1205
V  [libjvm.so+0x812a4d]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x10d
V  [libjvm.so+0x9d3d97]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x397
V  [libjvm.so+0x9d4f18]  CompileBroker::compiler_thread_loop()+0x4f8
V  [libjvm.so+0x1833e6a]  JavaThread::thread_main_inner()+0x26a
V  [libjvm.so+0x183bc3b]  JavaThread::run()+0x25b
V  [libjvm.so+0x18393d6]  Thread::call_run()+0xf6
V  [libjvm.so+0x143776e]  thread_native_entry(Thread*)+0x10e

Comments
A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/890 Date: 2022-03-14 13:27:10 +0000
14-03-2022

Fix Request (11u): Should get backported for parity with 11.0.16-oracle. Skara recognizes it as clean: https://github.com/openjdk/jdk11u-dev/pull/890 Original GitHub URL: https://github.com/openjdk/jdk/commit/902858e3ceb43bf92ea9fa038b9edcf1ee0c48b5 Test has passed.
14-03-2022

URL: https://hg.openjdk.java.net/jdk/jdk/rev/77148b8bb7a1 User: phedlin Date: 2019-10-28 12:36:37 +0000
28-10-2019

Loop rotation (partial peeling) is estimated as a loop clone operation but for some loops, most of the cloning is part of separating the loop body based on the set of operations being peeled or not. This makes the estimate inadequate.
02-10-2019