Skip to content

Commit 2c30f92

Browse files
committed
MDEV-36482: Make liburing work WITH_MSAN=ON
A read from liburing has its output buffer as defined by the nature of the system call. Instrumenting the library proved difficult as the completion events don't include the opcode or pointers that where there on submission. It was just easier to do this in the application code.
1 parent 1d84cb2 commit 2c30f92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tpool/aio_liburing.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
1515

1616
#include "tpool_structs.h"
1717
#include "tpool.h"
18+
#include "my_valgrind.h"
1819
#include "mysql/service_my_print_error.h"
1920
#include "mysqld_error.h"
2021

@@ -172,6 +173,10 @@ class aio_uring final : public tpool::aio
172173
{
173174
iocb->m_err= 0;
174175
iocb->m_ret_len= res;
176+
#if __has_feature(memory_sanitizer)
177+
if (iocb->m_opcode == aio_opcode::AIO_PREAD)
178+
MEM_MAKE_DEFINED(iocb->m_buffer, res);
179+
#endif
175180
}
176181

177182
io_uring_cqe_seen(&aio->uring_, cqe);

0 commit comments

Comments
 (0)