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

8260338: Some fields in HaltNode is not cloned #2213

Closed
wants to merge 2 commits into from

Conversation

@YaSuenag
Copy link
Member

@YaSuenag YaSuenag commented Jan 25, 2021

I got strange log as following. Contents in CodeString is garbled. It seems not to be initialized.

[3.155s][trace][codestrings ] Created CodeString [ dエ・] (0x7f3804a150)

HaltNode has two fields - _reachable and _halt_reason, but they would not be cloned at Node::clone.


Progress

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

Issue

Reviewers

Download

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jan 25, 2021

👋 Welcome back ysuenaga! 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 openjdk bot commented Jan 25, 2021

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

  • hotspot-compiler

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.

@YaSuenag YaSuenag marked this pull request as ready for review Jan 25, 2021
@openjdk openjdk bot added the rfr label Jan 25, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jan 25, 2021

Webrevs

@@ -568,6 +568,10 @@ Node *Node::clone() const {
if (n->is_SafePoint()) {
n->as_SafePoint()->clone_replaced_nodes();
}
if (n->is_Halt()) {
Copy link
Member

@navyxliu navyxliu Jan 25, 2021

Choose a reason for hiding this comment

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

This line seems unnecessary. I see HaltNode::size() increases from 0x60 to 0x70 with your patch. Memcpy at line 502 covers it, doesn't it?

Copy link
Member Author

@YaSuenag YaSuenag Jan 25, 2021

Choose a reason for hiding this comment

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

_reachable and _halt_reason are available on HaltNode, not Node, so I think this condition is necessary.
L502 uses the result of Node::size_of(), and I overrided it in HaltNode. So memory allocation at L501 and memcpy at L502 are safety.

Copy link
Member

@navyxliu navyxliu Jan 25, 2021

Choose a reason for hiding this comment

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

size_of() is a virtual function. line 500 should use HaltNode::size_of(), which give you 112(0x70) bytes, right?
I mean memcpy at line 502 should cover HaltNode's member variables.
Copy::conjoint_words_to_lower((HeapWord*)this, (HeapWord*)n, s);

Copy link
Member Author

@YaSuenag YaSuenag Jan 25, 2021

Choose a reason for hiding this comment

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

Ah, you are right, thanks!
I reverted the change for node.cpp.

Copy link
Member

@navyxliu navyxliu left a comment

LGTM, but still need a reviewer's approval.

Copy link
Contributor

@neliasso neliasso left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Jan 25, 2021

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

8260338: Some fields in HaltNode is not cloned

Reviewed-by: xliu, neliasso, thartmann

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

  • af155fc: 8258836: JNI local refs exceed capacity getDiagnosticCommandInfo
  • d825339: 8260263: Remove PtrQueue::_qset
  • 5898ab6: 8259894: refactor parts of jvm.h into jvm_io.h and jvm_constants.h
  • 764111f: 8260272: bash configure --prefix does not work after JDK-8257679
  • 4ae39b1: 8260208: Improve dummy object filling condition in G1CollectedHeap::fill_archive_regions in cds
  • c52c6c6: 8260273: DataOutputStream writeChars optimization

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.

@openjdk openjdk bot added the ready label Jan 25, 2021
@YaSuenag
Copy link
Member Author

@YaSuenag YaSuenag commented Jan 25, 2021

/integrate

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

@openjdk openjdk bot commented Jan 25, 2021

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

  • af155fc: 8258836: JNI local refs exceed capacity getDiagnosticCommandInfo
  • d825339: 8260263: Remove PtrQueue::_qset
  • 5898ab6: 8259894: refactor parts of jvm.h into jvm_io.h and jvm_constants.h
  • 764111f: 8260272: bash configure --prefix does not work after JDK-8257679
  • 4ae39b1: 8260208: Improve dummy object filling condition in G1CollectedHeap::fill_archive_regions in cds
  • c52c6c6: 8260273: DataOutputStream writeChars optimization

Your commit was automatically rebased without conflicts.

Pushed as commit 09489e2.

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

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Jan 25, 2021

@YaSuenag For future PRs, please wait for at least 24 hours before integrating a non-trivial change. A change is only considered trivial if it's explicitly stated by a reviewer in the PR (see trivial in OpenJDK Developers’ Guide. Thanks.

@YaSuenag
Copy link
Member Author

@YaSuenag YaSuenag commented Jan 25, 2021

@YaSuenag For future PRs, please wait for at least 24 hours before integrating a non-trivial change. A change is only considered trivial if it's explicitly stated by a reviewer in the PR (see trivial in OpenJDK Developers’ Guide. Thanks.

Sorry, I got it.

@YaSuenag YaSuenag deleted the JDK-8260338 branch Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants