-
-
Notifications
You must be signed in to change notification settings - Fork 835
ICU-22517 Limit the closure expansion loop and return error #2629
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
Conversation
a700f3b to
370e49a
Compare
|
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
370e49a to
ccd2064
Compare
|
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
|
@markusicu I try to set the limit to smaller value, such as 242 (which allow 5 hanguls) , but that break collate/CollationTest/TestBuilderContextsOverflow so I have to change it to 6560 which could allow 8 hanguls on the righthand side and also passing collate/CollationTest/TestBuilderContextsOverflow |
markusicu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remember to port the test and the fix to Java as well.
| IcuTestErrorCode errorCode(*this, "TestICU22517"); | ||
| char16_t data[] = u"&a=b쫊쫊쫊쫊쫊쫊쫊쫊"; | ||
| icu::UnicodeString rule(true, data, -1); | ||
| for (int i = 4; i <= rule.length(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How long does this test run? Should we test only up to rule.length() - 1 or - 2 unless in exhaustive mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
55.5s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost a minute... is too long I think for normal testing.
Please test only up to rule.length() - 1 or - 2 unless in exhaustive mode.
|
Please also fix the typo in the commit message and in the PR title: s/clouser/closure/ |
1a6903e to
1c8f2c2
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
1c8f2c2 to
d5d2946
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
|
I have some problem to run Java test w/ mvn now (could be my disk full issue). I will try to change Java in a different PR |
The PR title is fixed but the commit message still has this typo. |
ok |
d5d2946 to
c0a3818
Compare
|
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
done |
c0a3818 to
bc5f912
Compare
|
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
I added them now. |
To avoid very slow return from the constructor, we return error while the Collation rule expand too big. Add a soft limit to limit to the number of loop needed for 8 Hanguls Necessary number of loop: H(0)=0; H(i)=3H(i-1)+2. Where i is the length of Hangul in the rule. H(1) = 2, H(2) = 8, H(3)=26, H(4)=80, H(5) = 242 ...
bc5f912 to
9e29347
Compare
|
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
markusicu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm tnx
To avoid very slow return from the constructor, we return an error while the Collation rule expand too big.
Add a limit constant to limit to the number of loop needed for 8 Hanguls.
Necessary number of loops: H(0)=0; H(i)=3H(i-1)+2.
Where i is the length of Hangul in the rule.
H(1) = 2, H(2) = 8, H(3)=26, H(4)=80, H(5) = 242 ...
Checklist