[branch-1.2](scanner) Fix memory out of bound in scanner scheduler#25311
Merged
dataroaring merged 2 commits intoapache:branch-1.2-ltsfrom Oct 11, 2023
Merged
[branch-1.2](scanner) Fix memory out of bound in scanner scheduler#25311dataroaring merged 2 commits intoapache:branch-1.2-ltsfrom
dataroaring merged 2 commits intoapache:branch-1.2-ltsfrom
Conversation
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
ref #24840
In version 1.2.7, we found that the be core occurs about once a month. The core dump is:
The program is segmentation fault at memory address 0x725f74756f656dd1.
Actually this address is not a mutex address, but a wrong address causes by memory out of bound.
Here is the prove:
The program access to address 0x725f74756f656dd1 because the queue_idx is set to -3.
And the reason is the atomic_int _queue_idx in ScannerScheduler is increment overflow to be negative.
So we should use atomic_uint to avoid overflow behavior.
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...