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

6708: Add santiy check when allocating Object arrays in parser #59

Closed
wants to merge 2 commits into from

Conversation

@Gunde
Copy link
Collaborator

@Gunde Gunde commented Feb 26, 2020

Checking the size of an array before allocating it is a decent sanity check so the parser doesn't end up reading massive arrays and causing OoMs due to incorrectly written recordings.


Progress

  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JMC-6708: Set boundary for array size while parsing recording

Reviewers

  • Marcus Hirt (hirt - Reviewer)

Download

$ git fetch https://git.openjdk.java.net/jmc pull/59/head:pull/59
$ git checkout pull/59

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Feb 26, 2020

👋 Welcome back hdafgard! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request.

@openjdk openjdk bot added the rfr label Feb 26, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 26, 2020

Webrevs

@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 26, 2020

Mailing list message from Mario Torre on jmc-dev:

Hi Henrik,

The patch looks good to me.

Cheers,
Mario

On Wed, Feb 26, 2020 at 2:00 PM Henrik Dafg?rd
<hdafgard at openjdk.java.net> wrote:

Checking the size of an array before allocating it is a decent sanity check so the parser doesn't end up reading massive arrays and causing OoMs due to incorrectly written recordings.

-------------

Commits:
- 3e15030: Add santiy check when allocating Object arrays in parser

Changes: https://git.openjdk.java.net/jmc/pull/59/files
Webrev: https://webrevs.openjdk.java.net/jmc/59/webrev.00
Issue: https://bugs.openjdk.java.net/browse/JMC-6708
Stats: 20 lines in 6 files changed: 12 ins; 0 del; 8 mod
Patch: https://git.openjdk.java.net/jmc/pull/59.diff
Fetch: git fetch https://git.openjdk.java.net/jmc pull/59/head:pull/59

PR: https://git.openjdk.java.net/jmc/pull/59

--
Mario Torre
Associate Manager, Software Engineering
Red Hat GmbH <https://www.redhat.com>
9704 A60C B4BE A8B8 0F30 9205 5D7E 4952 3F65 7898

@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 26, 2020

Mailing list message from Mario Torre on jmc-dev:

Still ok :)

Cheers,
Mario

On Wed, Feb 26, 2020 at 2:31 PM Henrik Dafg?rd <hdafgard at openjdk.java.net>
wrote:

Checking the size of an array before allocating it is a decent sanity
check so the parser doesn't end up reading massive arrays and causing OoMs
due to incorrectly written recordings.

The pull request has been updated with 1 additional commit.

-------------

Added commits:
- 4f67f66: Fix formatting

Changes:
- all: https://git.openjdk.java.net/jmc/pull/59/files
- new: https://git.openjdk.java.net/jmc/pull/59/files/3e15030f..4f67f66

Webrevs:
- full: https://webrevs.openjdk.java.net/jmc/59/webrev.01
- incr: https://webrevs.openjdk.java.net/jmc/59/webrev.00-01

Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod
Patch: https://git.openjdk.java.net/jmc/pull/59.diff
Fetch: git fetch https://git.openjdk.java.net/jmc pull/59/head:pull/59

PR: https://git.openjdk.java.net/jmc/pull/59

--
Mario Torre
Associate Manager, Software Engineering
Red Hat GmbH <https://www.redhat.com>
9704 A60C B4BE A8B8 0F30 9205 5D7E 4952 3F65 7898

Copy link
Member

@thegreystone thegreystone left a comment

LGTM

@openjdk
Copy link

@openjdk openjdk bot commented Feb 26, 2020

@Gunde This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

6708: Add santiy check when allocating Object arrays in parser

Reviewed-by: hirt
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /solves command.

Since the source branch of this PR was last updated there has been 1 commit pushed to the master branch. Since there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate c752ec141352487c8c493fc00d0ab6104dcf4f9c.

➡️ To integrate this PR with the above commit message, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Feb 26, 2020
@Gunde
Copy link
Collaborator Author

@Gunde Gunde commented Feb 26, 2020

/integrate

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

@openjdk openjdk bot commented Feb 26, 2020

@Gunde The following commits have been pushed to master since your change was applied:

  • c752ec1: 6697: Moving the agent to a top level directory

Your commit was automatically rebased without conflicts.

Pushed as commit 2352cec.

@Gunde Gunde deleted the Gunde:parser-max-alloc-setting branch Feb 26, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 26, 2020

Mailing list message from Henrik Dafgård on jmc-dev:

Changeset: 2352cec
Author: Henrik Dafg?rd <hdafgard at openjdk.org>
Date: 2020-02-26 16:36:26 +0000
URL: https://git.openjdk.java.net/jmc/commit/2352cecb

6708: Add santiy check when allocating Object arrays in parser

Reviewed-by: hirt

! core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v0/ArrayReader.java
! core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v0/ChunkLoaderV0.java
! core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v0/ReaderFactory.java
! core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v1/ChunkLoaderV1.java
! core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v1/TypeManager.java
! core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v1/ValueReaders.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants