Bug #97804 | Test innodb.innodb_mysql fails under valgrind | ||
---|---|---|---|
Submitted: | 26 Nov 2019 17:52 | Modified: | 3 Dec 2019 7:58 |
Reporter: | Herman Lee | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S7 (Test Cases) |
Version: | 8.0.18 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[26 Nov 2019 17:52]
Herman Lee
[28 Nov 2019 8:28]
MySQL Verification Team
Hello Herman Lee, Thank you for the report and feedback. Observed that even in 8.0.18 innodb.innodb_mysql fails under valgrind but with different stack trace. regards, Umesh
[2 Dec 2019 12:03]
Erlend Dahl
We can't reproduce this internally (the issue reproduced by Umesh looks different). Can you please share the following details: - exact CMake options - compiler version - valgrind version
[3 Dec 2019 1:28]
Herman Lee
Valgrind is version 3.15.0 Compiler is clang 8.0 Relevant cmake flags: CFLAGS=-g -pipe -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-builtin-malloc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fno-omit-frame-pointer -momit-leaf-frame-pointer -Wno-type-limits CXXFLAGS=-g -pipe -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-builtin-malloc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fno-omit-frame-pointer -momit-leaf-frame-pointer -Wno-type-limits -DUNIV_DEBUG_VALGRIND -DCMAKE_VERBOSE_MAKEFILE=OFF -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DINSTALL_SBINDIR=libexec -DINSTALL_LAYOUT=RPM -DINSTALL_SQLBENCHDIR=. -DINSTALL_LIBDIR=lib64/mysql -DINSTALL_SECURE_FILE_PRIVDIR= -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_SERVER_SUFFIX=-fb -DCURSES_LIBRARY=<curses library> -DCURSES_INCLUDE_PATH=<curses include> -DWITH_KRB=<krb version 1.12> -DWITH_SSL=<open_ssl 1.1.0> -DWITH_ZLIB=<zlib 1.2.8> -DWITH_ZSTD=<zstd 1.4> -DWITH_GLIBC=<glibc 2.26> -DMYSQL_DATADIR=/var/lib/mysql -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_USER=mysql -DEXTRA_CHARSETS=all -DENABLE_DTRACE=0 -DENABLED_LOCAL_INFILE=1 -DWITH_FAST_MUTEXES=0 -DDEBUG_EXTNAME=0 -DSTACK_DIRECTION=-1 -DWITH_BOOST=<boost 1.69 dir> -DMYSQL_MAINTAINER_MODE=1 -DHAVE_BUILD_INFO=1
[3 Dec 2019 7:48]
Tor Didriksen
Posted by developer: 8.0.17 does indeed have this valgrind bug. It was fixed in 8.0.18 by this followup patch: commit e924e238247ba3b42cf6a30d76a68a816b776e96 Author: Xing Zhang <xing.z.zhang@oracle.com> Date: Thu Apr 4 12:47:42 2019 +0800 Bug#28960901: ASSERTION FAILED: (TLEN % 2) == 0 Post-push fix: Valgrind complains String::c_ptr() might have memory leak problem. Change to use String::ptr(). Change-Id: Ic2b67c6027ee1c5fcfd0502ca90ecb90ef326445 diff --git a/sql/item_func.cc b/sql/item_func.cc index 3fa0d3cec47..63bac6e9941 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5789,11 +5789,11 @@ String *Item_func_get_user_var::val_str(String *str) { if (res && !my_charset_same(res->charset(), collation.collation)) { String tmpstr; uint error; - if (tmpstr.copy(res->c_ptr(), res->length(), res->charset(), + if (tmpstr.copy(res->ptr(), res->length(), res->charset(), collation.collation, &error) || error > 0) { char tmp[32]; - convert_to_printable(tmp, sizeof(tmp), res->c_ptr(), res->length(), + convert_to_printable(tmp, sizeof(tmp), res->ptr(), res->length(), res->charset(), 6); my_error(ER_INVALID_CHARACTER_STRING, MYF(0), collation.collation->csname, tmp);
[3 Dec 2019 7:58]
Erlend Dahl
I have verified that the issue repeats on 8.0.17, but not on 8.0.18.