-
Notifications
You must be signed in to change notification settings - Fork 173
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
Prevent memory crash when building Query Nodes #6428
Conversation
6a068b7
to
64b8e06
Compare
64b8e06
to
5a40b57
Compare
test/object-store/c_api/c_api.cpp
Outdated
int exceeded_max_count = 1001; | ||
for (int node_id = 0; node_id <= exceeded_max_count; node_id++) { | ||
std::stringstream node; | ||
node << "_id=obj(" << ObjectId().gen().to_string() << ")" |
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.
"obj" -> "oid"
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.
Good catch!
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.
I don't think we should try to fix the issue with a max depth. We don't know that 1000 nodes will be a small enough on all machines at any given time?
Also, this is hardly the only place we can hit a stack overflow. If we want to improve here we should look into SEH (Structured Exception Handling) on Windows, and maybe something like libsigsegv for gcc
I agree that the max depth can not be predicted. It would be better if this code could be rewritten without recursion. |
@ironage PR does that. It is unlikely that we won't be able to cope with a very long list of conditions without recursion. |
I don't think we should merge this PR now that we have the fix done by @ironage |
@desistefanova it is #6444 |
Handled in #6444 |
Having a large query with more than 1000
LogicalNode
s crashes and kills the process.For example query like this:
Set limit of QueryNodes depth in the
LogicalNode
recursion indriver.hpp
.Added MAX_DEPTH_OF_LOGICAL_NODES=1000.
☑️ ToDos