icu icon indicating copy to clipboard operation
icu copied to clipboard

ICU-22934 clean up error handling in PR#3230

Open FrankYFTang opened this issue 1 year ago • 5 comments

Checklist

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

FrankYFTang avatar Oct 02 '24 23:10 FrankYFTang

Please add a unit test that triggers the recursion depth failures. It's not immediately obvious that there won't be memory leaks or other problems when they occur.

In functions with a newly added UErrorCode in PR #3230, double check the error handling. RBBINode::cloneTree(), for instance,

  • at line 216, set a U_MEMORY_ALLOCATION_ERROR and return immediately if the new fails.
  • make sure that you return a nullptr right away, and don't leak, in the event of a failure returned from the recursive calls at lines 220 and 226

In RBBINode::flattenSets(), maybe make the setRefNode variables into localPointers, so you can more easily return immediately if the cloneTree() calls set an error.

aheninger avatar Oct 03 '24 22:10 aheninger

Notice: the branch changed across the force-push!

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

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Please add a unit test that triggers the recursion depth failures.

I have the problem to do that. The fuzzer found test case is > 400k in a file.

FrankYFTang avatar Oct 10 '24 01:10 FrankYFTang

Notice: the branch changed across the force-push!

  • icu4c/source/common/rbbinode.cpp is different
  • icu4c/source/common/rbbiscan.cpp is different
  • icu4c/source/common/rbbisetb.cpp is different
  • icu4c/source/common/rbbitblb.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Please add a unit test that triggers the recursion depth failures.

I have the problem to do that. The fuzzer found test case is > 400k in a file.

Hi Frank, I've started to look at creating test cases, but have run into some behavior that I don't fully understand. I'll continue with it and get you something workable. Unfortunately I will be busy for most of the coming week, so it won't happen right away.

aheninger avatar Oct 13 '24 18:10 aheninger

Please add a unit test that triggers the recursion depth failures.

I have the problem to do that. The fuzzer found test case is > 400k in a file.

Hi Frank, I've started to look at creating test cases, but have run into some behavior that I don't fully understand. I'll continue with it and get you something workable. Unfortunately I will be busy for most of the coming week, so it won't happen right away.

ping

FrankYFTang avatar Oct 30 '24 19:10 FrankYFTang

ping

FrankYFTang avatar Nov 19 '24 17:11 FrankYFTang

ping

FrankYFTang avatar Nov 26 '24 22:11 FrankYFTang

Well, looks like @aheninger is not responding. Either I can take a look or @eggrobin can...

richgillam avatar Jan 16 '25 17:01 richgillam

@richgillam:

Well, looks like @aheninger is not responding. Either I can take a look or @eggrobin can...

The ticket already has another merged PR, so the ticket must be closed by Wed feb12. Please work with @FrankYFTang to either land this PR here or retarget it to a new ticket.

Note that aside from Andy's comments there are also CI check failures.

markusicu avatar Feb 07 '25 20:02 markusicu

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

rebase to figut out what is the other breakage on the CI first.

FrankYFTang avatar Feb 12 '25 23:02 FrankYFTang

@eggrobin @richgillam could you review this again. I try to fix the CI failure if they show up. @aheninger said he will add more tests but not coming back to shis for along time. How about we land this after I fix all CI issues

FrankYFTang avatar Feb 12 '25 23:02 FrankYFTang

@eggrobin @richgillam could you review this again.

The changes look fine to me.

I try to fix the CI failure if they show up. @aheninger said he will add more tests but not coming back to shis for along time. How about we land this after I fix all CI issues

I'm fine with landing this in its current state and filing a ticket or something for the additional tests Andy wants to see.

richgillam avatar Feb 12 '25 23:02 richgillam