MDEV-35738 mariadb build -fsanitize=pointer-compare#5037
Open
grooverdan wants to merge 1 commit intoMariaDB:10.11from
Open
MDEV-35738 mariadb build -fsanitize=pointer-compare#5037grooverdan wants to merge 1 commit intoMariaDB:10.11from
grooverdan wants to merge 1 commit intoMariaDB:10.11from
Conversation
invalid pointer pairs are when the length/memory of one string are intermixed with another. For comp_err, the end null pointer was compared to soffset within my_strtoll10. As we didn't need the end position a NULL arg option was compatble. For uca-dump, Address Sanitizer raises invalid pointer pair because argv options (opt) don't have an obvious correlation of having a start at opt_X.length, even though the lstrncmp makes this true. The DBUG_ASSERTS of strmov (added MDEV-11752) where incompatible with pointer-compare. Replaced strmov with static inline version in m_string.h using memmove that allows overlaps, and being inline allows the uneeded parts of the implementation to be optimized away.
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.
invalid pointer pairs are when the length/memory of one string are intermixed with another.
For comp_err, the end null pointer was compared to soffset within my_strtoll10. As we didn't need the end position a NULL arg option was compatble.
For uca-dump, Address Sanitizer raises invalid pointer pair because argv options (opt) don't have an obvious correlation of having a start at opt_X.length, even though the lstrncmp makes this true.
The DBUG_ASSERTS of strmov (added MDEV-11752) where incompatible with pointer-compare. Replaced strmov with static inline version in m_string.h using memmove that allows overlaps, and being inline allows the uneeded parts of the implementation to be optimized away.
Note: this only fixes the compile of the server. There are multiple errors in the codebase exposed by mtr. Using ASAN_OPTIONS=detect_invalid_pointer_pairs=0 validated that the server behaviour was the same with the changed implementation.