JDK-8236124 : Minimal VM slowdebug build failed after JDK-8212160
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 14,15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-12-17
  • Updated: 2024-03-12
  • Resolved: 2020-01-07
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 13 JDK 14 JDK 15 JDK 8
11.0.10Fixed 13.0.6Fixed 14 b31Fixed 15Fixed 8u411Fixed
Related Reports
Relates :  
Description
$ sh ./configure --with-debug-level=slowdebug --disable-precompiled-headers --with-jvm-variants=minimal

Build fails:

* For target hotspot_variant-minimal_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:
/home/shade/trunks/jdk-jdk/build/linux-x86_64-minimal-slowdebug/hotspot/variant-minimal/libjvm/objs/nmethod.o: In function `nmethod::post_compiled_method_load_event(JvmtiThreadState*)':
/home/shade/trunks/jdk-jdk/src/hotspot/share/code/nmethod.cpp:1597: undefined reference to `JvmtiThreadState::enqueue_event(JvmtiDeferredEvent*)'
collect2: error: ld returned 1 exit status
* For target hotspot_variant-minimal_libjvm_objs_BUILD_LIBJVM_link:
/home/shade/trunks/jdk-jdk/build/linux-x86_64-minimal-slowdebug/hotspot/variant-minimal/libjvm/objs/nmethod.o: In function `nmethod::post_compiled_method_load_event(JvmtiThreadState*)':
/home/shade/trunks/jdk-jdk/src/hotspot/share/code/nmethod.cpp:1597: undefined reference to `JvmtiThreadState::enqueue_event(JvmtiDeferredEvent*)'
collect2: error: ld returned 1 exit status

Simple fix:

diff -r e9a406eba26c src/hotspot/share/code/nmethod.cpp
--- a/src/hotspot/share/code/nmethod.cpp        Tue Dec 17 11:24:28 2019 +0100
+++ b/src/hotspot/share/code/nmethod.cpp        Tue Dec 17 19:33:11 2019 +0100
@@ -1592,11 +1592,11 @@
     // (which is a real Java thread) post the event
     JvmtiDeferredEvent event = JvmtiDeferredEvent::compiled_method_load_event(this);
     if (state == NULL) {
       ServiceThread::enqueue_deferred_event(&event);
     } else {
-      state->enqueue_event(&event);
+      JVMTI_ONLY(state->enqueue_event(&event);)
     }
   }
 }
 
 void nmethod::post_compiled_method_unload() {

Comments
Fix request (13u) Requesting backport to 13u as follow-up fix for JDK-8212160 that is already included to 13u. The patch applies cleanly. Minimal VM slowdebug build succeeded after applying the patch.
29-01-2021

Fix request (11u) I would like to downport this as follow up of JDK-8212160. Applies clean. No risk as it is a trivial build fix.
17-11-2020

URL: https://hg.openjdk.java.net/jdk/jdk14/rev/171e5eb5ebcd User: sspitsyn Date: 2020-01-07 22:23:25 +0000
07-01-2020

An alternate suggested fix is: diff --git a/src/hotspot/share/prims/jvmtiThreadState.hpp b/src/hotspot/share/prims/jvmtiThreadState.hpp --- a/src/hotspot/share/prims/jvmtiThreadState.hpp +++ b/src/hotspot/share/prims/jvmtiThreadState.hpp @@ -396,7 +396,7 @@ void set_should_post_on_exceptions(bool val) { _thread->set_should_post_on_exceptions_flag(val ? JNI_TRUE : JNI_FALSE); } // Thread local event queue, which doesn't require taking the Service_lock. - void enqueue_event(JvmtiDeferredEvent* event); + void enqueue_event(JvmtiDeferredEvent* event) NOT_JVMTI_RETURN; void post_events(JvmtiEnv* env); void run_nmethod_entry_barriers(); }; Chris P. noted, the enqueue_event() function is a wrapper around the JvmtiDeferredEventQueue::enqueue(). It is better for enqueue_event() to follow the same approach to avoid slowdebug minimal build failures.
07-01-2020

Yes, I see this issue. The update suggested by Aleksey fixes the problem.
07-01-2020