JDK-8237479 : 8230305 causes slowdebug build failure
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2020-01-17
  • Updated: 2022-12-08
  • Resolved: 2020-01-19
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 15 JDK 8 Other
11.0.16-oracleFixed 15 b07Fixed 8u361Fixed openjdk8u372Fixed
Related Reports
Relates :  
Description
Robbin reported a slowdebug build failure this morning:

/home/rehn/source/jdk/vanilla-jdk/open/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:59: error: undefined reference to 'vtable for CgroupController'
/usr/bin/ld: the vtable symbol may be undefined because the class is missing its key function
/home/rehn/source/jdk/vanilla-jdk/open/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:225: error: undefined reference to 'vtable for CgroupSubsystem'
/usr/bin/ld: the vtable symbol may be undefined because the class is missing its key function
collect2: error: ld returned 1 exit status

And slowdebug build failures have shown up in Tier2.

Starting this bug as a P2 since we have build failures.
Comments
Fix Request (8u): A follow up issue of JDK-8230305, which causes slowdebug builds to fail on some systems. Part of a good set of patches for the initial integration of cgroups v2 backports. Patch is reviewed and has little risk (build fails - at runtime - prior and passes after).
30-11-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/128 Date: 2022-10-04 09:40:02 +0000
04-10-2022

Fix Request (11u) A clean backport for Cgroup V2 support in 11u
22-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/864 Date: 2022-03-08 18:55:07 +0000
08-03-2022

URL: https://hg.openjdk.java.net/jdk/jdk/rev/882fc6a4d53c User: sgehwolf Date: 2020-01-19 19:36:50 +0000
19-01-2020

RFR: http://mail.openjdk.java.net/pipermail/hotspot-dev/2020-January/040547.html
18-01-2020

Yes, the intention for this is for virtual methods in CgroupController and CgroupSubsystem to be pure virtual functions. Suggested fix: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8237479/01/webrev/
18-01-2020

CgroupController declares but does not define virtual function subsystem_path. It's the first virtual in the class, hence the "key function". gcc puts the vtable in the object file containing the definition of the key function (and I think does special things with inlined functions that I don't recall). Since there's no definition, it never output the vtable, and hence the link error. Not sure why it's only failing in debug builds. It looks like it's expected to be supplied by the derived classes and should be pure virtual in CgroupController.
17-01-2020

Bob V tells me you are looking at this issue.
17-01-2020

[~kbarrett] and/or [~bobv] - Help! The Linux slowdebug build is complaining about: /work/shared/bug_hunt/8237479_for_jdk15/open/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:59: error: undefined reference to 'vtable for CgroupController' /work/local/jib-dcubed/install/jpg/infra/builddeps/devkit-linux_x64/gcc8.3.0-OL6.4+1.0/devkit-linux_x64-gcc8.3.0-OL6.4+1.0.tar.gz/x86_64-linux-gnu-to-x86_64-linux-gnu/bin/../lib/gcc/x86_64-linux-gnu/8.3.0/../../../../x86_64-linux-gnu/bin/ld: the vtable symbol may be undefined because the class is missing its key function /work/shared/bug_hunt/8237479_for_jdk15/open/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:225: error: undefined reference to 'vtable for CgroupSubsystem' /work/local/jib-dcubed/install/jpg/infra/builddeps/devkit-linux_x64/gcc8.3.0-OL6.4+1.0/devkit-linux_x64-gcc8.3.0-OL6.4+1.0.tar.gz/x86_64-linux-gnu-to-x86_64-linux-gnu/bin/../lib/gcc/x86_64-linux-gnu/8.3.0/../../../../x86_64-linux-gnu/bin/ld: the vtable symbol may be undefined because the class is missing its key function And googling about "the vtable symbol may be undefined because the class is missing its key function" gives me a hint about not being able to find the first virtual function defined in a translation unit, but I don't see anything obviously wrong with https://bugs.openjdk.java.net/browse/JDK-8230305
17-01-2020

Reproduced the build failure on my Ubuntu 16.04 machine: Compiling 6 properties into resource bundles for java.base /work/shared/bug_hunt/8237479_for_jdk15/open/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:59: error: undefined reference to 'vtable for CgroupController' /work/local/jib-dcubed/install/jpg/infra/builddeps/devkit-linux_x64/gcc8.3.0-OL6.4+1.0/devkit-linux_x64-gcc8.3.0-OL6.4+1.0.tar.gz/x86_64-linux-gnu-to-x86_64-linux-gnu/bin/../lib/gcc/x86_64-linux-gnu/8.3.0/../../../../x86_64-linux-gnu/bin/ld: the vtable symbol may be undefined because the class is missing its key function /work/shared/bug_hunt/8237479_for_jdk15/open/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:225: error: undefined reference to 'vtable for CgroupSubsystem' /work/local/jib-dcubed/install/jpg/infra/builddeps/devkit-linux_x64/gcc8.3.0-OL6.4+1.0/devkit-linux_x64-gcc8.3.0-OL6.4+1.0.tar.gz/x86_64-linux-gnu-to-x86_64-linux-gnu/bin/../lib/gcc/x86_64-linux-gnu/8.3.0/../../../../x86_64-linux-gnu/bin/ld: the vtable symbol may be undefined because the class is missing its key function collect2: error: ld returned 1 exit status lib/CompileJvm.gmk:176: recipe for target '/work/shared/bug_hunt/8237479_for_jdk15/build/linux-x86_64-normal-server-slowdebug/support/modules_libs/java.base/server/libjvm.so' failed make[3]: *** [/work/shared/bug_hunt/8237479_for_jdk15/build/linux-x86_64-normal-server-slowdebug/support/modules_libs/java.base/server/libjvm.so] Error 1 make[3]: *** Waiting for unfinished jobs.... The failing lines of code: 59 class CgroupController: public CHeapObj<mtInternal> { 60 public: 61 virtual char *subsystem_path(); 62 }; and 225 class CgroupSubsystem: public CHeapObj<mtInternal> { 226 public: 227 jlong memory_limit_in_bytes(); 228 int active_processor_count(); 229 230 virtual int cpu_quota(); 231 virtual int cpu_period(); 232 virtual int cpu_shares(); 233 virtual jlong memory_usage_in_bytes(); 234 virtual jlong memory_and_swap_limit_in_bytes(); 235 virtual jlong memory_soft_limit_in_bytes(); 236 virtual jlong memory_max_usage_in_bytes(); 237 virtual char * cpu_cpuset_cpus(); 238 virtual char * cpu_cpuset_memory_nodes(); 239 virtual jlong read_memory_limit_in_bytes(); 240 virtual const char * container_type(); 241 virtual CachingCgroupController* memory_controller(); 242 virtual CachingCgroupController* cpu_controller(); 243 };
17-01-2020