JDK-8236412 : SEGV in Node::uncast with Lucene
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 14
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: x86_64
  • Submitted: 2019-12-20
  • Updated: 2020-05-18
  • Resolved: 2019-12-20
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 14
14Resolved
Related Reports
Duplicate :  
Duplicate :  
Description
We installed a week ago the latest build of JDK 14 (build 27, previous build installed was 24). Since that time almost every test run of Apache Lucene Core (the base library) fails with SEGV.

How to reproduce:
- Clone from Github https://github.com/apache/lucene-solr.git
- "ant bootstrap" (to install IVY)
- "cd lucene/core"
- "ant test"

Stack: [0x00007f6bf65fe000,0x00007f6bf66ff000],  sp=0x00007f6bf66f9c18,  free space=1007k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xaf2d20]  Node::uncast(bool) const+0x0
V  [libjvm.so+0xb6cd93]  PhaseIterGVN::transform_old(Node*)+0x93
V  [libjvm.so+0xb6999c]  PhaseIterGVN::optimize()+0x10c
V  [libjvm.so+0x9df904]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xa84
V  [libjvm.so+0x552cf5]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x1d5
V  [libjvm.so+0x550e5e]  Compile::Optimize()+0x60e
V  [libjvm.so+0x55257c]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xdfc
V  [libjvm.so+0x4a2d31]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xc1
V  [libjvm.so+0x55bc8c]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x32c
V  [libjvm.so+0x55d068]  CompileBroker::compiler_thread_loop()+0x4e8
V  [libjvm.so+0xcc40e2]  JavaThread::thread_main_inner()+0xe2
V  [libjvm.so+0xcc88fd]  Thread::call_run()+0x10d
V  [libjvm.so+0xb26057]  thread_native_entry(Thread*)+0xe7

Windows (no location info):
Stack: [0x0000009af1100000,0x0000009af1200000],  sp=0x0000009af11fa3e0,  free space=1000k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x50f8f5]
V  [jvm.dll+0x50f7e4]
V  [jvm.dll+0x503551]
V  [jvm.dll+0x505c3c]
V  [jvm.dll+0x50592d]
V  [jvm.dll+0x505984]
V  [jvm.dll+0x505984]
V  [jvm.dll+0x505984]
V  [jvm.dll+0x505810]
V  [jvm.dll+0x505984]
V  [jvm.dll+0x505984]
V  [jvm.dll+0x50cf35]
V  [jvm.dll+0x1edf7a]
V  [jvm.dll+0x1e7a9b]
V  [jvm.dll+0x1e4d58]
V  [jvm.dll+0x17787c]
V  [jvm.dll+0x1f3ea5]
V  [jvm.dll+0x1f208b]
V  [jvm.dll+0x70664d]
V  [jvm.dll+0x6ff46a]
V  [jvm.dll+0x5f6fb6]
C  [ucrtbase.dll+0x20e72]
C  [KERNEL32.DLL+0x17bd4]
C  [ntdll.dll+0x6ced1]

This seems serious as it makes Lucene unuseable with JDK 14.

Also the following stack trace (which is already tracked by JDK-8235870):

Stacktraces seen (all very similar):
Stack: [0x00007fad33261000,0x00007fad33362000], sp=0x00007fad3335c9d0, free space=1006k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x9d85a8] IdealLoopTree::est_loop_flow_merge_sz() const+0x158
V [libjvm.so+0x9d8782] IdealLoopTree::est_loop_clone_sz(unsigned int) const+0x12
V [libjvm.so+0x9bee31] IdealLoopTree::estimate_peeling(PhaseIdealLoop*) [clone .part.131]+0x21
V [libjvm.so+0x9cc587] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x1f7
V [libjvm.so+0x9cd9bf] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x17f
V [libjvm.so+0x9cd870] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x30
V [libjvm.so+0x9cd870] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x30
V [libjvm.so+0x9cd870] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x30
V [libjvm.so+0x9dfa55] PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xbd5
V [libjvm.so+0x552cf5] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x1d5
V [libjvm.so+0x550e5e] Compile::Optimize()+0x60e
V [libjvm.so+0x55257c] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xdfc
V [libjvm.so+0x4a2d31] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xc1
V [libjvm.so+0x55bc8c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x32c
V [libjvm.so+0x55d068] CompileBroker::compiler_thread_loop()+0x4e8
V [libjvm.so+0xcc40e2] JavaThread::thread_main_inner()+0xe2
V [libjvm.so+0xcc88fd] Thread::call_run()+0x10d
V [libjvm.so+0xb26057] thread_native_entry(Thread*)+0xe7
Comments
This one is a duplicate of JDK-8235984.
20-12-2019

I can reproduce this with replay compilation: # Internal Error (open/src/hotspot/share/opto/loopUnswitch.cpp:343), pid=18190, tid=18216 # assert(out->in(PhiNode::Region) == head || out->in(PhiNode::Region) == slow_head) failed: phi must be either part of the slow or the fast loop Current CompileTask: C2: 1442 18 b 4 org.apache.lucene.util.MSBRadixSorter::computeCommonPrefixLengthAndBuildHistogram (231 bytes) Stack: [0x00007f62d93fc000,0x00007f62d94fd000], sp=0x00007f62d94f6cd0, free space=1003k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x10900ea] PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&, int, PhaseIdealLoop::CloneLoopMode)+0x219a V [libjvm.so+0x1091b3c] PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&)+0xfc V [libjvm.so+0x10876ba] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x42a V [libjvm.so+0x1088c21] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x111 V [libjvm.so+0x1088b36] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x26 V [libjvm.so+0x1088b7a] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x6a V [libjvm.so+0x1088b36] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x26 V [libjvm.so+0x1088b7a] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x6a V [libjvm.so+0x1088b7a] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x6a V [libjvm.so+0x10abb5f] PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xc9f V [libjvm.so+0x8de2ea] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x2ea V [libjvm.so+0x8db54c] Compile::Optimize()+0xacc V [libjvm.so+0x8dcb14] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x1094 V [libjvm.so+0x74f400] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x110 V [libjvm.so+0x8e972c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x2cc V [libjvm.so+0x8ea6c8] CompileBroker::compiler_thread_loop()+0x458 V [libjvm.so+0x15a0616] JavaThread::thread_main_inner()+0x226 :
20-12-2019

ILW = Crash during C2 compilation (regression in JDK 14), reproducible with ZGC (experimental) and Lucene, use different GC or disable compilation of affected method = HMM = P2
20-12-2019

Thanks Uwe, that looks indeed like a separate issue. I'll re-open this bug to investigate.
20-12-2019

Hi Tobias, thansk for response, I did not see the other issue. Just to be sure and we do not miss anything: I see 2 different stack traces, but JDK-8235870 only lists one. The other one looks like that: Stack: [0x00007f6bf65fe000,0x00007f6bf66ff000], sp=0x00007f6bf66f9c18, free space=1007k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0xaf2d20] Node::uncast(bool) const+0x0 V [libjvm.so+0xb6cd93] PhaseIterGVN::transform_old(Node*)+0x93 V [libjvm.so+0xb6999c] PhaseIterGVN::optimize()+0x10c V [libjvm.so+0x9df904] PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xa84 V [libjvm.so+0x552cf5] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x1d5 V [libjvm.so+0x550e5e] Compile::Optimize()+0x60e V [libjvm.so+0x55257c] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xdfc V [libjvm.so+0x4a2d31] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xc1 V [libjvm.so+0x55bc8c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x32c V [libjvm.so+0x55d068] CompileBroker::compiler_thread_loop()+0x4e8 V [libjvm.so+0xcc40e2] JavaThread::thread_main_inner()+0xe2 V [libjvm.so+0xcc88fd] Thread::call_run()+0x10d V [libjvm.so+0xb26057] thread_native_entry(Thread*)+0xe7
20-12-2019

Closing as duplicate of JDK-8235870.
20-12-2019

We first thought it might be related to Garbage collector ZGC (because the very first build failed with that), but actually it does not matter which GC. Also SerialGC is affected :-)
20-12-2019

Logfiles (Linux and Windows) attached, but there are many more, just dive through https://jenkins.thetaphi.de and look for RED builds on Linux and Windows.
20-12-2019