Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented May 3, 2024

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)'
jvmFlagConstraintsCompiler.cpp:70: note: AllocatePrefetchStepSizeConstraintFunc(long, bool) defined here
#0 0x10239bcee in FlagAccessImpl_int::typed_check_constraint(void
, int, bool) const jvmFlagAccess.cpp:157
#1 0x1023a53d7 in JVMFlagLimit::check_all_constraints(JVMFlagConstraintPhase) jvmFlagLimit.cpp:179
#2 0x102ee640b in universe_init() universe.cpp:875
#3 0x10213ee27 in init_globals() init.cpp:128
#4 0x102ea0d69 in Threads::create_vm(JavaVMInitArgs*, bool*) threads.cpp:553
#5 0x10230c3fb in JNI_CreateJavaVM_inner(JavaVM_, void, void*) jni.cpp:3581
#6 0x10041271c in JavaMain java.c:491
#7 0x100419248 in ThreadJavaMain java_md_macosx.m:720
#8 0x7fff204338fb in _pthread_start+0xdf (libsystem_pthread.dylib:x86_64+0x68fb)
#9 0x7fff2042f442 in thread_start+0xe (libsystem_pthread.dylib:x86_64+0x2442)


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8331428: ubsan: JVM flag checking complains about MaxTenuringThresholdConstraintFunc, InitialTenuringThresholdConstraintFunc and AllocatePrefetchStepSizeConstraintFunc (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19074/head:pull/19074
$ git checkout pull/19074

Update a local copy of the PR:
$ git checkout pull/19074
$ git pull https://git.openjdk.org/jdk.git pull/19074/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19074

View PR using the GUI difftool:
$ git pr show -t 19074

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19074.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 3, 2024

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented May 3, 2024

@MBaesken This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: stefank, aboldtch, tschatzl

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title JDK-8331428: ubsan: JVM flag checking complains about MaxTenuringThresholdConstraintFunc, InitialTenuringThresholdConstraintFunc and AllocatePrefetchStepSizeConstraintFunc 8331428: ubsan: JVM flag checking complains about MaxTenuringThresholdConstraintFunc, InitialTenuringThresholdConstraintFunc and AllocatePrefetchStepSizeConstraintFunc May 3, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label May 3, 2024
@openjdk
Copy link

openjdk bot commented May 3, 2024

@MBaesken The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

mlbridge bot commented May 3, 2024

Webrevs

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 3, 2024
@MBaesken
Copy link
Member Author

MBaesken commented May 3, 2024

Thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented May 3, 2024

Going to push as commit 9697bc3.
Since your change was applied there have been 9 commits pushed to the master branch:

  • ce73fec: 8331048: G1: Prune rebuild candidates based on G1HeapWastePercent early
  • 58ef9e4: 8331402: G1: Remove is_active() calls in G1HRPrinter logging
  • 3c77dad: 8331507: JFR: Improve example usage in -XX:StartFlightRecording:help
  • 8ed3190: 8331401: G1: Make G1HRPrinter AllStatic
  • 1f6d38f: 8294978: Convert 5 test/jdk/jdk/jfr tests from ASM library to Classfile API
  • c60474b: 8323707: Adjust Classfile API's type arg model to better represent the embodied type
  • f78fa05: 8331636: [BACKOUT] Build failure after 8330076
  • f665e07: 8331540: [BACKOUT] NMT: add/make a mandatory MEMFLAGS argument to family of os::reserve/commit/uncommit memory API
  • a10845b: 8330539: Use #include <alloca.h> instead of -Dalloca'(size)'=__builtin_alloca'(size)' for AIX

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 3, 2024
@openjdk openjdk bot closed this May 3, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 3, 2024
@openjdk
Copy link

openjdk bot commented May 3, 2024

@MBaesken Pushed as commit 9697bc3.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot [email protected] integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants