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

fix: copy names from mmapped memory before closing iterator (#22040) #22059

Merged
merged 3 commits into from
Aug 4, 2021

Conversation

davidby-influx
Copy link
Contributor

@davidby-influx davidby-influx commented Aug 4, 2021

This fix ensures that memory-mapped files are not released
before pointers into them are copied into heap memory.
MeasurementNamesByExpr() and MeasurementNamesByPredicate() can
cause panics by copying memory from mmapped files that have been
released. The functions they call use iterators to files which
are closed (releasing the mmapped files) before the memory is
safely copied to the heap.

closes #22000

(cherry picked from commit a989f8f)

Closes #22002

This fix ensures that memory-mapped files are not released
before pointers into them are copied into heap memory.
MeasurementNamesByExpr() and MeasurementNamesByPredicate() can
cause panics by copying memory from mmapped files that have been
released. The functions they call use iterators to files which
are closed (releasing the mmapped files) before the memory is
safely copied to the heap.

closes #22000

(cherry picked from commit a989f8f)
@davidby-influx davidby-influx merged commit 16b737d into master Aug 4, 2021
@davidby-influx davidby-influx deleted the DSB_infor_panic_master branch August 4, 2021 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants