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

JDK-8261593: Do not use NULL pointer as write buffer parameter in jfrEmergencyDump.cpp write_repository_files #2525

Closed
wants to merge 1 commit into from

Conversation

@MBaesken
Copy link
Member

@MBaesken MBaesken commented Feb 11, 2021

In jfrEmergencyDump.cpp write_repository_files, potentially (when malloc fails) a NULL pointer is passed as second (buffer) parameter to os::write .
This is unwanted, see also the Sonar finding :

https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=cpp&open=AXck7_SvBBG2CXpcnJEx&resolved=false&severities=CRITICAL&types=BUG

bytes_written += (int64_t)os::write(emergency_fd, copy_block, bytes_read - bytes_written);

Sonar reports here : "Null pointer passed as read buffer "copy_block" in call to "write""


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8261593: Do not use NULL pointer as write buffer parameter in jfrEmergencyDump.cpp write_repository_files

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2525/head:pull/2525
$ git checkout pull/2525

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Feb 11, 2021

👋 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.

Loading

@openjdk openjdk bot added the rfr label Feb 11, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Feb 11, 2021

@MBaesken 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.

Loading

@openjdk openjdk bot added the hotspot-jfr label Feb 11, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 11, 2021

Webrevs

Loading

Copy link
Member

@tstuefe tstuefe left a comment

+1

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Feb 11, 2021

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

8261593: Do not use NULL pointer as write buffer parameter in jfrEmergencyDump.cpp write_repository_files

Reviewed-by: stuefe, mgronlun

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

  • 1740de2: 8261297: NMT: Final report should use scale 1
  • c342323: 8261431: SA: Add comments about load address of executable
  • 4a72cea: 8261509: Move per-thread StackWatermark from Thread to JavaThread class

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

Loading

@openjdk openjdk bot added the ready label Feb 11, 2021
@MBaesken
Copy link
Member Author

@MBaesken MBaesken commented Feb 11, 2021

+1

Thanks for the review !

Loading

@MBaesken
Copy link
Member Author

@MBaesken MBaesken commented Feb 12, 2021

/integrate

Loading

@openjdk openjdk bot closed this Feb 12, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Feb 12, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Feb 12, 2021

@MBaesken Since your change was applied there have been 7 commits pushed to the master branch:

  • 60a2072: 8260431: com/sun/jdi/JdbOptions.java failed with "RuntimeException: 'prop[boo] = >foo<' missing from stdout/stderr"
  • bf47a47: 8261282: Lazy initialization of built-in ICC_Profile/ColorSpace classes is too lazy
  • f4cfd75: 8261510: Use RFC numbers and protocol titles in sun.security.ssl.SSLExtension comments
  • 75c8489: 8261604: ProblemList jdk/dynalink/TypeConverterFactoryMemoryLeakTest.java
  • 1740de2: 8261297: NMT: Final report should use scale 1
  • c342323: 8261431: SA: Add comments about load address of executable
  • 4a72cea: 8261509: Move per-thread StackWatermark from Thread to JavaThread class

Your commit was automatically rebased without conflicts.

Pushed as commit 92ff891.

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

Loading

@MBaesken MBaesken deleted the JDK-8261593 branch Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants