Skip to content

[fix](expr) avoid crashing caused by big depth of expression tree#17314

Merged
yiguolei merged 1 commit into
apache:masterfrom
mrhhsg:fix_overflow
Mar 2, 2023
Merged

[fix](expr) avoid crashing caused by big depth of expression tree#17314
yiguolei merged 1 commit into
apache:masterfrom
mrhhsg:fix_overflow

Conversation

@mrhhsg

@mrhhsg mrhhsg commented Mar 2, 2023

Copy link
Copy Markdown
Member

Proposed changes

When the tree is too deep, too many recursive calls will cause stack overflow.

Problem summary

Describe your changes.

Checklist(Required)

  • Does it affect the original behavior
  • Has unit tests been added
  • Has document been added or modified
  • Does it need to update dependencies
  • Is this PR support rollback (If NO, please explain WHY)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions

github-actions Bot commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@yiguolei yiguolei added dev/1.2.3 usercase Important user case type label labels Mar 2, 2023
Comment thread be/src/vec/exprs/vexpr.cpp Outdated
int max_child_depth = 0;
for (int i = 0; i < _children.size(); ++i) {
RETURN_IF_ERROR(_children[i]->prepare(state, row_desc, context));
if ((context->_depth_num - old_depth) > max_child_depth) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

--context->_depth_num is OK?

@github-actions

github-actions Bot commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@yiguolei yiguolei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Mar 2, 2023
@github-actions

github-actions Bot commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@yiguolei

yiguolei commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

./run buildall

@github-actions

github-actions Bot commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

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

Labels

approved Indicates a PR has been approved by one committer. area/vectorization dev/1.1.6 dev/1.2.3-merged kind/behavior-changed reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants