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

8328085: C2: Use after free in PhaseChaitin::Register_Allocate() #22200

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

Conversation

reinrich
Copy link
Member

@reinrich reinrich commented Nov 18, 2024

This change removes the ResourceMark from PhaseChaitin::merge_multidefs() because it frees memory that is used in the caller method PhaseChaitin::Register_Allocate.
My comment on the JBS item explains the details.

Testing

I was able to reproduce the issue on ppc64le but not on x86_64 running applications/ctw/modules/java_desktop.java. The issue didn't reproduce with this pr.

ResourceArea Sizes

I've traced maximum ResourceArea size after returning from PhaseChaitin::merge_multidefs() (see first commit).
I haven't found a significant difference.
Below you can see the last trace line from each run.

x86_64: 3 Runs Dacapo Tomcat 5 Iterations
Baseline

Run 1: [24.222s][info][newcode] New maximum for resource area size: 3274 KB
Run 2: [21.317s][info][newcode] New maximum for resource area size: 3274 KB
Run 3: [37.400s][info][newcode] New maximum for resource area size: 3336 KB

PR

Run 1: [35.002s][info][newcode] New maximum for resource area size: 3363 KB
Run 2: [21.332s][info][newcode] New maximum for resource area size: 3274 KB
Run 3: [36.050s][info][newcode] New maximum for resource area size: 3286 KB

x86_64: 3 Runs applications/ctw/modules/java_desktop.java
Baseline

Run 1: [29.876s][info][newcode] New maximum for resource area size: 3143 KB
Run 2: [29.631s][info][newcode] New maximum for resource area size: 3111 KB
Run 3: [29.227s][info][newcode] New maximum for resource area size: 3142 KB

PR

Run 1: [29.755s][info][newcode] New maximum for resource area size: 3175 KB
Run 2: [28.964s][info][newcode] New maximum for resource area size: 3143 KB
Run 3: [28.863s][info][newcode] New maximum for resource area size: 3143 KB

PPC: 3 Runs Dacapo Tomcat 5 Iterations
Baseline

Run 1: [20.041s][info][newcode] New maximum for resource area size: 3474 KB
Run 2: [20.581s][info][newcode] New maximum for resource area size: 3474 KB
Run 3: [20.367s][info][newcode] New maximum for resource area size: 3474 KB

PR

Run 1: [20.520s][info][newcode] New maximum for resource area size: 3506 KB
Run 2: [20.918s][info][newcode] New maximum for resource area size: 3506 KB
Run 3: [20.994s][info][newcode] New maximum for resource area size: 3505 KB

PPC: 3 Runs applications/ctw/modules/java_desktop.java
Baseline

Run 1: [71.992s][info][newcode] New maximum for resource area size: 3483 KB
Run 2: [55.808s][info][newcode] New maximum for resource area size: 3483 KB
Run 3: [29.252s][info][newcode] New maximum for resource area size: 1684 KB

PR

Run 1: [55.996s][info][newcode] New maximum for resource area size: 3515 KB
Run 2: [30.384s][info][newcode] New maximum for resource area size: 2849 KB
Run 3: [65.671s][info][newcode] New maximum for resource area size: 3547 KB


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-8328085: C2: Use after free in PhaseChaitin::Register_Allocate() (Bug - P3)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22200

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 18, 2024

👋 Welcome back rrich! 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 18, 2024

❗ 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 Nov 18, 2024

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

@reinrich reinrich force-pushed the 8328085_c2_use_after_free_in_merge_multidefs branch from c265cca to e56f39d Compare November 18, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant