Skip to content

Conversation

@kimbarrett
Copy link

@kimbarrett kimbarrett commented Jan 3, 2026

Please review this change to fix JfrSet to avoid triggering
-Wzero-as-null-pointer-constant warnings when that warning is enabled.

The old code uses an entry value with representation 0 to indicate the entry
doesn't have a value. It compares an entry value against literal 0 to check
for that. If the key type is a pointer type, this involves an implicit 0 =>
null pointer constant conversion, so we get a warning when that warning is
enabled.

Instead we initialize entry values to a value-initialized key, and compare
against a value-initialized key. This changes the (currently undocumented)
requirements on the key type. The key type is no longer required to be
trivially constructible (to permit memset-based initialization), but is now
required to be value-initializable. That's currently a wash, since all of the
in-use key types are fundamental types (traceid (u8) and Klass*).

Testing: mach5 tier1-3 (tier3 is where most jfr tests are run)


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-8374445: Fix -Wzero-as-null-pointer-constant warnings in JfrSet (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29022

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 3, 2026

👋 Welcome back kbarrett! 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 Jan 3, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Jan 3, 2026

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

  • hotspot-jfr

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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 3, 2026
@mlbridge
Copy link

mlbridge bot commented Jan 3, 2026

Webrevs

@mgronlun
Copy link

mgronlun commented Jan 7, 2026

Will review this later Kim, sorry for the delay (26 stuff).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-jfr [email protected] rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants