Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
marko is hitting MSAN issues with C/C due to a bug in MSAN and needs the following workaround applied:
diff --git a/libmariadb/mariadb_stmt.c b/libmariadb/mariadb_stmt.c
|
index 8f5bddc..e15e1bd 100644
|
--- a/libmariadb/mariadb_stmt.c
|
+++ b/libmariadb/mariadb_stmt.c
|
@@ -1,5 +1,5 @@
|
/****************************************************************************
|
- Copyright (C) 2012 Monty Program AB
|
+ Copyright (C) 2012, 2020, MariaDB Corporation.
|
|
This library is free software; you can redistribute it and/or
|
modify it under the terms of the GNU Library General Public
|
@@ -56,7 +56,12 @@
|
#include <mysql/client_plugin.h>
|
#include <ma_common.h>
|
#include "ma_priv.h"
|
-
|
+#ifndef __has_feature
|
+# define __has_feature(x) 0
|
+#endif
|
+#if __has_feature(memory_sanitizer)
|
+# include <sanitizer/msan_interface.h>
|
+#endif
|
|
#define UPDATE_STMT_ERROR(stmt)\
|
SET_CLIENT_STMT_ERROR((stmt), (stmt)->mysql->net.last_errno, (stmt)->mysql->net.sqlstate, (stmt)->mysql->net.last_error)
|
@@ -542,7 +547,13 @@ int store_param(MYSQL_STMT *stmt, int column, unsigned char **p, unsigned long r
|
(*p) += 4;
|
break;
|
case MYSQL_TYPE_DOUBLE:
|
+#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */
|
+ __msan_check_mem_is_initialized(buf, sizeof(double));
|
+#endif
|
float8store(*p, (*(double *)buf));
|
+#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */
|
+ __msan_unpoison(*p, sizeof(double));
|
+#endif
|
(*p) += 8;
|
break;
|
case MYSQL_TYPE_LONGLONG:
|
Attachments
Issue Links
- relates to
-
CONC-512 truncation check for float values fails on i386 due to Intel FPU optimization bug in gcc
- Closed
-
MDEV-26761 main.mysql_client_test test_mdev19838 fails with MemorySanitizer
- Closed
-
MDEV-20377 Make WITH_MSAN more usable
- Closed