make asan work as much as possible #8148
Merged
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
make asan work as much as possible
Issue Number: close #xxx
Problem Summary:
Manually ASAN poisoning is complicated and it is hard to make it work right. There are illustrated examples in http://blog.hostilefork.com/poison-memory-without-asan/.
Stacks of use after poison do not provide enough information to resolve bug, while stacks of use afer free provide. google/sanitizers#191
We'd better implement a mempool using malloc/free directly, thus asan works natively. However we cannot do it in a short time, so we make manual poisoning work as much as possible.
I refers to https://github.com/mcgov/asan_alignment_example.
Checklist(Required)
Further comments
We need much more work to make asan work, for example we need fix manual poison in ./be/src/olap/rowset/segment_v2/bitshuffle_page.h and I am not sure if there are any places.