Skip to content

MDEV-35738 mariadb build -fsanitize=pointer-compare#5037

Open
grooverdan wants to merge 1 commit intoMariaDB:10.11from
grooverdan:MDEV-35738_10.11
Open

MDEV-35738 mariadb build -fsanitize=pointer-compare#5037
grooverdan wants to merge 1 commit intoMariaDB:10.11from
grooverdan:MDEV-35738_10.11

Conversation

@grooverdan
Copy link
Copy Markdown
Member

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.

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.
@grooverdan grooverdan requested a review from sanja-byelkin May 4, 2026 01:59
@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

2 participants