Skip to content

JDK-8319704: LogTagSet::set_output_level() should not accept NULL as LogOutput#16555

Closed
tstuefe wants to merge 2 commits intoopenjdk:masterfrom
tstuefe:JDK-8319704-LogTagSet-set_output_level-should-not-accept-NULL-as-LogOutput
Closed

JDK-8319704: LogTagSet::set_output_level() should not accept NULL as LogOutput#16555
tstuefe wants to merge 2 commits intoopenjdk:masterfrom
tstuefe:JDK-8319704-LogTagSet-set_output_level-should-not-accept-NULL-as-LogOutput

Conversation

@tstuefe
Copy link
Member

@tstuefe tstuefe commented Nov 8, 2023

Trivial change to add an assert.

See JDK-8319104

LogTagSet::set_output_level() and LogOutputList::set_output_level should not accept NULL as LogOutput* argument.

They do, currently, which leads to delayed crashes later since the NULL output is registered in the output list.

That triggered JDK-8319104, where - due to a fluke in C++ initialization order and a mislabeling of LogTagSet tests as "TEST", without "_VM" - LogTagSet::set_output_level() was called with LogConfiguration::StdoutLog which was still uninitialized (null).

An assert would have saved investigation time.


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-8319704: LogTagSet::set_output_level() should not accept NULL as LogOutput (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16555

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 8, 2023

👋 Welcome back stuefe! 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 Nov 8, 2023

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

  • hotspot-runtime

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 hotspot-runtime hotspot-runtime-dev@openjdk.org label Nov 8, 2023
Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

}

void LogOutputList::set_output_level(LogOutput* output, LogLevelType level) {
assert(output != nullptr, "LogOutput is NULL");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HotSpot comment and logging style is for nullptr to be printed as "null"

@jdksjolen
Copy link
Contributor

Oops, apparently this is a draft, sorry about that.

@tstuefe
Copy link
Member Author

tstuefe commented Nov 10, 2023

Oops, apparently this is a draft, sorry about that.

No problem, and thanks! It still counts ... :)

@tstuefe tstuefe marked this pull request as ready for review November 10, 2023 11:38
@openjdk
Copy link

openjdk bot commented Nov 10, 2023

@tstuefe 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:

8319704: LogTagSet::set_output_level() should not accept NULL as LogOutput

Reviewed-by: jsjolen, dholmes

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 38 new commits pushed to the master branch:

  • 50f41d6: 8309893: Integrate ReplicateB/S/I/L/F/D nodes to Replicate node
  • caf7181: 8318189: ChoiceFormat::format throws undocumented AIOOBE
  • 9938b3f: 8319314: NMT detail report slow or hangs for large number of mappings
  • c9077b8: 8319339: Internal error on spurious markup in a hybrid snippet
  • ea1ffa3: 8318895: Deoptimization results in incorrect lightweight locking stack
  • c9657ca: 8319882: SequenceLayout::toString throws ArithmeticException
  • 6b21ff6: 8319828: runtime/NMT/VirtualAllocCommitMerge.java may fail if mixing interpreted and compiled native invocations
  • a64fc48: 8319174: Enhance robustness of some j.m.BigInteger constructors
  • 9cce9fe: 8319256: Print more diagnostic information when an unexpected user is found in a Phi
  • a95062b: 8319670: Improve comments describing system properties for TLS server and client for max chain length
  • ... and 28 more: https://git.openjdk.org/jdk/compare/8555e0f6c40c045f7763777a9bf976de99c0534c...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this 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 added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 10, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 10, 2023

Webrevs

@tstuefe
Copy link
Member Author

tstuefe commented Nov 10, 2023

@jdksjolen would you agree this is Trivial?

Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial change, integrate it!

@jdksjolen
Copy link
Contributor

(but please change from "NULL" to "null")

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tstuefe
Copy link
Member Author

tstuefe commented Nov 13, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Nov 13, 2023

Going to push as commit 4d650fe.
Since your change was applied there have been 40 commits pushed to the master branch:

  • 6f863b2: 8318636: Add jcmd to print annotated process memory map
  • e035637: 8319375: test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeakThrowable.java runs into OutOfMemoryError: Metaspace on AIX
  • 50f41d6: 8309893: Integrate ReplicateB/S/I/L/F/D nodes to Replicate node
  • caf7181: 8318189: ChoiceFormat::format throws undocumented AIOOBE
  • 9938b3f: 8319314: NMT detail report slow or hangs for large number of mappings
  • c9077b8: 8319339: Internal error on spurious markup in a hybrid snippet
  • ea1ffa3: 8318895: Deoptimization results in incorrect lightweight locking stack
  • c9657ca: 8319882: SequenceLayout::toString throws ArithmeticException
  • 6b21ff6: 8319828: runtime/NMT/VirtualAllocCommitMerge.java may fail if mixing interpreted and compiled native invocations
  • a64fc48: 8319174: Enhance robustness of some j.m.BigInteger constructors
  • ... and 30 more: https://git.openjdk.org/jdk/compare/8555e0f6c40c045f7763777a9bf976de99c0534c...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 13, 2023

@tstuefe Pushed as commit 4d650fe.

💡 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-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants