-
Bug
-
Resolution: Unresolved
-
P3
-
21, 22
-
arm
-
linux_ubuntu
The issue was found on Ubuntu when building collectd with openjdk-21[1].
Building the following example:
---
#include <jni.h>
int main(){
JavaVM *jvm; /* denotes a Java VM */
JNIEnv *env; /* pointer to native method interface */
JavaVMInitArgs vm_args; /* JDK/JRE 6 VM initialization arguments */
JavaVMOption* options = new JavaVMOption[1];
options[0].optionString = "-Djava.class.path=/usr/lib/java";
vm_args.version = JNI_VERSION_1_6;
vm_args.nOptions = 1;
vm_args.options = options;
vm_args.ignoreUnrecognized = false;
/* load and initialize a Java VM, return a JNI interface
* pointer in env */
JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
}
---
$g++ test.cpp -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -L/usr/lib/jvm/default-java/lib/server -ljvm
...
fails with /usr/bin/ld: /usr/lib/jvm/default-java/lib/server/libjvm.so: undefined reference to `_Copy_conjoint_bytes'
JDK-8142362 removed the implementation of _Copy_conjoint_bytes but left the symbol declaration in, causing the symbol to be undefined:
96657: 00000000 0 FUNC GLOBAL DEFAULT UND _Copy_conjoint_bytes
JDK-8017234 fixed the issue in master by removing the declaration.
openjdk-22 and openjdk-21 are still affected.
[1] https://bugs.launchpad.net/ubuntu/+source/collectd/+bug/2058966
Building the following example:
---
#include <jni.h>
int main(){
JavaVM *jvm; /* denotes a Java VM */
JNIEnv *env; /* pointer to native method interface */
JavaVMInitArgs vm_args; /* JDK/JRE 6 VM initialization arguments */
JavaVMOption* options = new JavaVMOption[1];
options[0].optionString = "-Djava.class.path=/usr/lib/java";
vm_args.version = JNI_VERSION_1_6;
vm_args.nOptions = 1;
vm_args.options = options;
vm_args.ignoreUnrecognized = false;
/* load and initialize a Java VM, return a JNI interface
* pointer in env */
JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
}
---
$g++ test.cpp -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -L/usr/lib/jvm/default-java/lib/server -ljvm
...
fails with /usr/bin/ld: /usr/lib/jvm/default-java/lib/server/libjvm.so: undefined reference to `_Copy_conjoint_bytes'
96657: 00000000 0 FUNC GLOBAL DEFAULT UND _Copy_conjoint_bytes
openjdk-22 and openjdk-21 are still affected.
[1] https://bugs.launchpad.net/ubuntu/+source/collectd/+bug/2058966
- relates to
-
JDK-8017234 Hotspot should stop using mapfiles
- Resolved
-
JDK-8142362 Lots of code duplication in Copy class
- Resolved