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

ICU-22602 Fix stack overflow inside flattenVariables #2740

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

FrankYFTang
Copy link
Contributor

@FrankYFTang FrankYFTang commented Dec 13, 2023

Limit the recursive call of flattenVariables to maximum depth 4000 since Java on my machine throw stack overflow exception around 4300.

Checklist
  • Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22602
  • Required: The PR title must be prefixed with a JIRA Issue number.
  • Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
  • Required: Each commit message must be prefixed with a JIRA Issue number.
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

richgillam
richgillam previously approved these changes Dec 13, 2023
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/rbbinode.cpp is different
  • icu4j/main/core/src/main/java/com/ibm/icu/text/RBBINode.java is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@richgillam
Copy link
Contributor

It'd really make reviewing easier if you'd wait to squash until the fix is ready to go in. What's changed since the last time I looked at this?

@FrankYFTang
Copy link
Contributor Author

It'd really make reviewing easier if you'd wait to squash until the fix is ready to go in. What's changed since the last time I looked at this?

sorry, Java 11 stackoverflow when the depth reach 3906 so I have to change the limit from 4000 to 3500 and somehow I forgot to remove a println in the Java code.

@richgillam
Copy link
Contributor

sorry, Java 11 stackoverflow when the depth reach 3906 so I have to change the limit from 4000 to 3500 and somehow I forgot to remove a println in the Java code.

Ah. Okay, that all sounds reasonable.

richgillam
richgillam previously approved these changes Dec 13, 2023
icu4c/source/common/rbbinode.cpp Outdated Show resolved Hide resolved
icu4c/source/common/rbbinode.cpp Show resolved Hide resolved
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/rbbinode.cpp is different
  • icu4j/main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITest.java is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/rbbinode.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Limit the recursive call of flattenVariables to maximum depth 3500
since Java on my machine throw stack overflow exception around 3900.
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4j/main/core/src/main/java/com/ibm/icu/text/RBBINode.java is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Copy link
Contributor

@richgillam richgillam left a comment

Choose a reason for hiding this comment

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

It looks to me like you addressed Andy's comments, but you might still need him to confirm that himself...

@FrankYFTang FrankYFTang merged commit 19af9e7 into unicode-org:main Dec 14, 2023
103 checks passed
@FrankYFTang FrankYFTang deleted the ICU-22602-stackoverflow branch December 14, 2023 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants