Skip to content

8160404: RelocationHolder constructors have bugs #3513

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bulasevich
Copy link

@bulasevich bulasevich commented Apr 17, 2025

This change is a clean and self-contained bug fix. It’s beneficial to backport it independently to jdk17u.

Also I would like to backport other related changes that depend (transitively) on this one:

  • JDK 8321509: False positive in get_trampoline fast path causes crash
    • JDK-8298913: Add override qualifiers to Relocation classes
      • JDK-8160404: RelocationHolder constructors have bugs

This is not a clean backport. The original patch also modifies the post_call_nop_Relocation and entry_guard_Relocation classes, which are part of:

I do not expect these changes to be backported to jdk17u, so I have excluded those parts in this backport:

@@ -935,29 +996,29 @@ class DataRelocation : public Relocation {
 };

 class post_call_nop_Relocation : public Relocation {
-  friend class RelocIterator;
+  friend class RelocationHolder;

 public:
   post_call_nop_Relocation() : Relocation(relocInfo::post_call_nop_type) { }

   static RelocationHolder spec() {
-    RelocationHolder rh = newHolder();
-    new(rh) post_call_nop_Relocation();
-    return rh;
+    return RelocationHolder::construct<post_call_nop_Relocation>();
   }
+
+  void copy_into(RelocationHolder& holder) const;
 };

 class entry_guard_Relocation : public Relocation {
-  friend class RelocIterator;
+  friend class RelocationHolder;

 public:
   entry_guard_Relocation() : Relocation(relocInfo::entry_guard_type) { }

   static RelocationHolder spec() {
-    RelocationHolder rh = newHolder();
-    new(rh) entry_guard_Relocation();
-    return rh;
+    return RelocationHolder::construct<entry_guard_Relocation>();
   }
+
+  void copy_into(RelocationHolder& holder) const;
 };

 // A CallRelocation always points at a call instruction.

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
  • JDK-8160404 needs maintainer approval

Issue

  • JDK-8160404: RelocationHolder constructors have bugs (Bug - P4) ⚠️ Issue is already resolved. Consider making this a "backport pull request" by setting the PR title to Backport <hash> with the hash of the original commit. See Backports.

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3513/head:pull/3513
$ git checkout pull/3513

Update a local copy of the PR:
$ git checkout pull/3513
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3513/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3513

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3513.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 17, 2025

👋 Welcome back bulasevich! 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 Apr 17, 2025

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

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

Successfully merging this pull request may close these issues.

1 participant