JDK-8212754 : Build failure: undefined JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-10-22
  • Updated: 2018-11-06
  • Resolved: 2018-10-23
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
Linux x86_64, minimal, slowdebug:

Creating symlink jdk/lib/security/public_suffix_list.dat
/home/buildbot/worker/jdk11u/build/build/linux-x86_64-normal-minimal-slowdebug/hotspot/variant-minimal/libjvm/objs/memAllocator.o: In function `MemAllocator::Allocation::notify_allocation_jvmti_sampler()':
/home/buildbot/worker/jdk11u/build/src/hotspot/share/gc/shared/memAllocator.cpp:210: undefined reference to `JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample()'
collect2: error: ld returned 1 exit status
lib/CompileJvm.gmk:149: recipe for target '/home/buildbot/worker/jdk11u/build/build/linux-x86_64-normal-minimal-slowdebug/support/modules_libs/java.base/minimal/libjvm.so' failed
make[3]: *** [/home/buildbot/worker/jdk11u/build/build/linux-x86_64-normal-minimal-slowdebug/support/modules_libs/java.base/minimal/libjvm.so] Error 1

It manifests only in jdk-updates/jdk11u, only in minimal, and only in slowdebug, which is why it was never found?

The usage in jdk11u is:

void MemAllocator::Allocation::notify_allocation_jvmti_sampler() {
  // Only check if the sampler could actually sample something in this path.
  assert(!JvmtiExport::should_post_sampled_object_alloc() ||
         !JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample() ||
         "Sampling collector not present.");

Fix Request This fix is destined for jdk11u to fix the build failure there. We have pushed it to development branch to keep codebases in sync. This allows building non-JVMTI JVM variants in 11u.