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

8338661: StackMapTable is invalid if frames appear in dead code #20644

Closed
wants to merge 3 commits into from

Conversation

asotona
Copy link
Member

@asotona asotona commented Aug 20, 2024

ClassFile API allows to build a class with dead code and provide custom StackMapTable attribute with user-specified frames covering the dead code.
StackCounter is responsible for calculation of maxStack and maxLocals in certain situations and it did not include the user-provided StackMapTable attribute. Dead code was skipped and maxStack or maxLocals might became underestimated.

This patch includes frames from user-provided StackMapTable attribute into the StackCounter calculations.

Please review.

Thanks,
Adam


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-8338661: StackMapTable is invalid if frames appear in dead code (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20644

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

Using diff file

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

Webrev

Link to Webrev Comment

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 20, 2024

👋 Welcome back asotona! A progress list of the required criteria for merging this PR into pr/20637 will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@asotona asotona marked this pull request as ready for review August 20, 2024 13:55
@openjdk
Copy link

openjdk bot commented Aug 20, 2024

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

8338661: StackMapTable is invalid if frames appear in dead code

Reviewed-by: liach

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 rfr Pull request is ready for review label Aug 20, 2024
@openjdk
Copy link

openjdk bot commented Aug 20, 2024

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Aug 20, 2024
@mlbridge
Copy link

mlbridge bot commented Aug 20, 2024

Webrevs

Copy link
Member

@liach liach left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@openjdk-notifier openjdk-notifier bot changed the base branch from pr/20637 to master August 20, 2024 14:47
@openjdk-notifier
Copy link

The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:

git checkout JDK-8338661-stack-counter
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 20, 2024
…counter

# Conflicts:
#	test/jdk/jdk/classfile/StackMapsTest.java
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Aug 20, 2024
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 20, 2024
@asotona
Copy link
Member Author

asotona commented Aug 21, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Aug 21, 2024

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

  • 5981697: 8337828: CDS: Trim down minimum GC region alignment
  • cafb3dc: 6318027: BasicScrollBarUI does not disable timer when enclosing frame is disabled.
  • 88ccbb6: 8336934: Clean up JavaLangReflectAccess
  • d728107: 8338482: com/sun/jdi/ThreadMemoryLeakTest.java requires that compressed oops are enabled
  • 1ebf2cf: 8336756: Improve ClassFile Annotation writing
  • 0267284: 8338611: java.lang.module specification wording not aligned with JEP 261
  • c646efc: 8205957: setfldw001/TestDescription.java fails with bad field value
  • 285ceb9: 8336529: (fs) UnixFileAttributeViews setTimes() failing on armhf, Ubuntu noble
  • 55a97ec: 8336729: C2: Div/Mod nodes without zero check could be split through iv phi of outer loop of long counted loop nest resulting in SIGFPE

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 21, 2024

@asotona Pushed as commit e88a3b0.

💡 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
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

None yet

2 participants