8373448: jpackage: StackOverflowError when processing a very long argument#29104
8373448: jpackage: StackOverflowError when processing a very long argument#29104alexeysemenyukoracle wants to merge 2 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back asemenyuk! A progress list of the required criteria for merging this PR into |
33a93e1 to
6ff7f8b
Compare
|
@alexeysemenyukoracle 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: 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 70 new commits pushed to the
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 |
|
@alexeysemenyukoracle The following label will be automatically applied to this pull request:
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. |
ea8cf8b to
c3cfd4f
Compare
c3cfd4f to
8210135
Compare
|
/issue add 8373448 |
|
@alexeysemenyukoracle This issue is referenced in the PR title - it will now be updated. |
|
@sashamatveev PTAL |
|
@fguallini can you think of any inputs to stress test/break the new regexp? |
Webrevs
|
| "(?:(?:([\"'])(?:\\\\\\1|.)*?(?:\\1|$))|(?:\\\\[\"'\\s]|[^\\s]))++"); | ||
|
|
||
| static { | ||
| System.out.println("OLD: " + pattern); |
There was a problem hiding this comment.
Why we need to print old and new pattern? Looks like debug code was not removed.
There was a problem hiding this comment.
Oh, the debug output slipped in.
LGTM, I can't think of any other cases that would cause an issue |
|
/integrate |
|
Going to push as commit 8737a8c.
Your commit was automatically rebased without conflicts. |
|
@alexeysemenyukoracle Pushed as commit 8737a8c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Replace reluctant quantifier
*?with the possessive alternative (*+) and get rid of back-references from the regexp tokenizing a value of the "--arguments" option into a string array to fix the catastrophic backtracking resulting in a stack overflow.Old regexp:
(?:(?:(["'])(?:\\\1|.)*?(?:\1|$))|(?:\\["'\s]|[^\s]))++New regexp
(?:(?:(?:'(?:\\'|[^'])*+(?:'|$))|(?:"(?:\\"|[^"])*+(?:"|$)))|(?:\\["'\s]|\S))++Add test cases that pass both the old and the new variants of the regexp, except for the last test case that causes a stack overflow with the old regexp.
The initial intention was to replace the regexp with the tokenizer function. It was abandoned in favor of reworking the regexp to minimize the risk of regressions.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29104/head:pull/29104$ git checkout pull/29104Update a local copy of the PR:
$ git checkout pull/29104$ git pull https://git.openjdk.org/jdk.git pull/29104/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 29104View PR using the GUI difftool:
$ git pr show -t 29104Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29104.diff
Using Webrev
Link to Webrev Comment