MDEV-36482: Make liburing work WITH_MSAN=ON (fix)#4257
Merged
Conversation
grooverdan
added a commit
to grooverdan/mariadb-buildbot
that referenced
this pull request
Aug 25, 2025
Until MariaDB/server#4257 is merged up lets keep the motd slightly conservative.
dr-m
approved these changes
Aug 25, 2025
Comment on lines
+75
to
+77
| #if __has_feature(memory_sanitizer) | ||
| MEM_MAKE_DEFINED(&uring_, sizeof(uring_)); | ||
| #endif |
Contributor
There was a problem hiding this comment.
I reproduced the problem on clang 19 and successfully tested the fix. The patch that I tested also included the following compensation for the addition of using namespace tpool:
@@ -102,7 +106,7 @@ class aio_uring final : public tpool::aio
io_uring_queue_exit(&uring_);
}
- int submit_io(tpool::aiocb *cb) final
+ int submit_io(aiocb *cb) final
{
cb->iov_base= cb->m_buffer;
cb->iov_len= cb->m_len;
@@ -112,7 +116,7 @@ class aio_uring final : public tpool::aio
std::lock_guard<std::mutex> _(mutex_);
io_uring_sqe *sqe= io_uring_get_sqe(&uring_);
- if (cb->m_opcode == tpool::aio_opcode::AIO_PREAD)
+ if (cb->m_opcode == aio_opcode::AIO_PREAD)
io_uring_prep_readv(sqe, cb->m_fh, static_cast<struct iovec *>(cb), 1,
cb->m_offset);
else
@@ -159,7 +163,7 @@ class aio_uring final : public tpool::aio
abort();
}
- auto *iocb= static_cast<tpool::aiocb*>(io_uring_cqe_get_data(cqe));
+ auto *iocb= static_cast<aiocb*>(io_uring_cqe_get_data(cqe));
if (!iocb)
break; // ~aio_uring() told us to terminate
The uring_ member of the aio_uring class needed to be defined to make MSAN happy. To make aio_uring consistent with aio_libaio in the 10.11 branch, added the "using namespace tpool" and removed tpool scoped quantifiers. 10.6 aio_uring is defined in the tpool namespace however changing that would just cause merge conflicts.
b06f096 to
a1bba0e
Compare
grooverdan
added a commit
to grooverdan/mariadb-buildbot
that referenced
this pull request
Aug 26, 2025
Until MariaDB/server#4257 is merged up lets keep the motd slightly conservative.
RazvanLiviuVarzaru
pushed a commit
to MariaDB/buildbot
that referenced
this pull request
Sep 19, 2025
Until MariaDB/server#4257 is merged up lets keep the motd slightly conservative.
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.
Description
The uring_ member of the aio_uring class needed to be defined to make MSAN happy.
To make aio_uring consistent with aio_libaio in the 10.11 branch, added the "using namespace tpool" and removed tpool scoped quantifiers.
10.6 aio_uring is defined in the tpool namespace however changing that would just cause merge conflicts.
Release Notes
nothing;
How can this PR be tested?
msan build + test in container with --privileged:
revalidation of libaio while I'm here:
Basing the PR against the correct MariaDB version
mainbranch.PR quality check