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

Bug-fix: Don't use pointers to elements in an actively modified vector during query processing. #182

Merged
merged 5 commits into from
Dec 21, 2023

Conversation

wraymo
Copy link
Contributor

@wraymo wraymo commented Dec 15, 2023

References

Description

Previously, when we push new elements into m_relevant_sub_queries, we use
m_relevant_sub_queries.push_back(&m_sub_queries.back());. However, m_sub_queries is a vector and the memory is dynamically allocated. Upon resizing, it may use new addresses and pointers stored in m_relevant_sub_queries are no longer valid.

Validation performed

Passed unit test and clang-format check. Also ran queries which cover the affected code and got expected results

@wraymo wraymo changed the title Fix a memory bug related to m_relevant_sub_queries Draft: Fix a memory bug related to m_relevant_sub_queries Dec 15, 2023
@wraymo wraymo force-pushed the relevant_query_bug_fix branch from 7427d08 to 40754e9 Compare December 18, 2023 20:06
@wraymo wraymo changed the title Draft: Fix a memory bug related to m_relevant_sub_queries Fix a memory bug related to m_relevant_sub_queries Dec 18, 2023
@wraymo wraymo requested a review from kirkrodrigues December 18, 2023 20:54
components/core/src/Grep.hpp Show resolved Hide resolved
components/core/src/Query.hpp Outdated Show resolved Hide resolved
components/core/src/Query.cpp Outdated Show resolved Hide resolved
components/core/src/Grep.cpp Outdated Show resolved Hide resolved
components/core/src/clo/clo.cpp Outdated Show resolved Hide resolved
components/core/src/clo/clo.cpp Outdated Show resolved Hide resolved
components/core/src/clo/clo.cpp Outdated Show resolved Hide resolved
components/core/src/clg/clg.cpp Outdated Show resolved Hide resolved
components/core/src/clg/clg.cpp Outdated Show resolved Hide resolved
components/core/src/clg/clg.cpp Outdated Show resolved Hide resolved
@kirkrodrigues kirkrodrigues merged commit 878e2f8 into y-scope:main Dec 21, 2023
5 checks passed
@kirkrodrigues kirkrodrigues changed the title Fix a memory bug related to m_relevant_sub_queries Commits on Dec 21, 2023 Bug-fix: Don't use pointers to elements in an actively modified vector during query processing. Dec 21, 2023
@kirkrodrigues kirkrodrigues changed the title Commits on Dec 21, 2023 Bug-fix: Don't use pointers to elements in an actively modified vector during query processing. Bug-fix: Don't use pointers to elements in an actively modified vector during query processing. Dec 21, 2023
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.

2 participants