RFR: 8331428: ubsan: JVM flag checking complains about MaxTenuringThresholdConstraintFunc, InitialTenuringThresholdConstraintFunc and AllocatePrefetchStepSizeConstraintFunc

Matthias Baesken mbaesken at openjdk.org
Fri May 3 13:04:56 UTC 2024


On Fri, 3 May 2024 07:32:35 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> Seems MaxTenuringThresholdConstraintFunc, InitialTenuringThresholdConstraintFunc and AllocatePrefetchStepSizeConstraintFunc check uint values (see gc_globals.hpp). However those functions have uintx in the check functions.
> This causes Ubsan to complain :
> 
> /jdk/src/hotspot/share/runtime/flags/jvmFlagAccess.cpp:176:12: runtime error: call to function MaxTenuringThresholdConstraintFunc(unsigned long, bool) through pointer to incorrect function type 'JVMFlag::Error (*)(unsigned int, bool)'
> jvmFlagConstraintsGC.cpp:188: note: MaxTenuringThresholdConstraintFunc(unsigned long, bool) defined here
>     #0 0x10541cfbe in FlagAccessImpl_uint::typed_check_constraint(void*, unsigned int, bool) const jvmFlagAccess.cpp:176
>     #1 0x1054253d7 in JVMFlagLimit::check_all_constraints(JVMFlagConstraintPhase) jvmFlagLimit.cpp:179
>     #2 0x105f20b98 in Threads::create_vm(JavaVMInitArgs*, bool*) threads.cpp:471
>     #3 0x10538c3fb in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) jni.cpp:3581
>     #4 0x10342e71c in JavaMain java.c:491
>     #5 0x103435248 in ThreadJavaMain java_md_macosx.m:720
>     #6 0x7fff204338fb in _pthread_start+0xdf (libsystem_pthread.dylib:x86_64+0x68fb)
>     #7 0x7fff2042f442 in thread_start+0xe (libsystem_pthread.dylib:x86_64+0x2442)
> 
> /jdk/src/hotspot/share/runtime/flags/jvmFlagAccess.cpp:176:12: runtime error: call to function InitialTenuringThresholdConstraintFunc(unsigned long, bool) through pointer to incorrect function type 'JVMFlag::Error (*)(unsigned int, bool)'
> jvmFlagConstraintsGC.cpp:177: note: InitialTenuringThresholdConstraintFunc(unsigned long, bool) defined here
>     #0 0x117b1cfbe in FlagAccessImpl_uint::typed_check_constraint(void*, unsigned int, bool) const jvmFlagAccess.cpp:176
>     #1 0x117b253d7 in JVMFlagLimit::check_all_constraints(JVMFlagConstraintPhase) jvmFlagLimit.cpp:179
>     #2 0x118620b98 in Threads::create_vm(JavaVMInitArgs*, bool*) threads.cpp:471
>     #3 0x117a8c3fb in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) jni.cpp:3581
>     #4 0x10077e71c in JavaMain java.c:491
>     #5 0x100785248 in ThreadJavaMain java_md_macosx.m:720
>     #6 0x7fff204338fb in _pthread_start+0xdf (libsystem_pthread.dylib:x86_64+0x68fb)
>     #7 0x7fff2042f442 in thread_start+0xe (libsystem_pthread.dylib:x86_64+0x2442)
> 
> and
> 
> /jdk/src/hotspot/share/runtime/flags/jvmFlagAccess.cpp:157:12: runtime error: call to function AllocatePrefetchStepSizeConstraintFunc(long, bool) through pointer to incorrect function type 'JVMFlag::Error (*)(int, bool)'
> jvmFlagConstrain...

Thanks for the reviews !

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19074#issuecomment-2092973093


More information about the hotspot-dev mailing list