Valgrind + jemalloc 3.6.0 gives spurious warnings. Not seen with jemalloc 4.0.4.

Bug #1542234 reported by Roel Van de Paar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
New
Undecided
Unassigned
5.6
Invalid
Undecided
Unassigned
5.7
Triaged
Medium
Unassigned

Bug Description

==8635== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==8635== Command: /sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/bin/mysqld --core-file --innodb_buffer_pool_size=2147483648 --basedir=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val --tmpdir=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/data --datadir=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/data --socket=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/socket.sock --port=19099 --log-error=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/log/master.err
==8635==
==8635== Invalid write of size 8
==8635== at 0x4C2FE87: memset (vg_replace_strmem.c:1094)
==8635== by 0x188D86B: pfs_malloc(PFS_builtin_memory_class*, unsigned long, int) (pfs_global.cc:88)
==8635== by 0x188D97D: pfs_malloc_array(PFS_builtin_memory_class*, unsigned long, unsigned long, int) (pfs_global.cc:136)
==8635== by 0x18900A2: init_instruments(PFS_global_param const*) (pfs_instr.cc:164)
==8635== by 0x189FB19: initialize_performance_schema(PFS_global_param*) (pfs_server.cc:120)
==8635== by 0xE50DA4: mysqld_main(int, char**) (mysqld.cc:4693)
==8635== by 0xE485CF: main (main.cc:25)
==8635== Address 0x8c3a020 is 0 bytes inside a block of size 4,800 free'd
==8635== at 0x18354D3: my_free (my_malloc.c:132)
==8635== by 0x183536B: my_realloc (my_malloc.c:101)
==8635== by 0x1810F07: alloc_dynamic (array.c:161)
==8635== by 0x18145B8: my_hash_insert (hash.c:423)
==8635== by 0x1456756: mysql_add_sys_var_chain(sys_var*) (set_var.cc:442)
==8635== by 0x145585E: sys_var_init() (set_var.cc:60)
==8635== by 0xE50CDA: mysqld_main(int, char**) (mysqld.cc:4677)
==8635== by 0xE485CF: main (main.cc:25)

$ cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core)
$ valgrind --version
valgrind-3.10.0
$ ls -l /sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/mysql-test/valgrind.supp
-rw-rw-r--. 1 roel roel 18957 Jan 27 22:30 /sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/mysql-test/valgrind.supp

Valgrind startup:
valgrind --suppressions=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/mysql-test/valgrind.supp --num-callers=40 --show-reachable=yes /sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/bin/mysqld ${MYEXTRA} --core-file --innodb_buffer_pool_size=2147483648 --basedir=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val --tmpdir=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/data --datadir=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/data --socket=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/socket.sock --port=19099 --log-error=/sda/PS-mysql-5.7.10-1rc1-linux-x86_64-val/log/master.err 2>&1 &

PS Server version: 5.7.10-1rc1-debug-valgrind MySQL Community Server (GPL) (Valgrind instrumented)

Revision history for this message
Roel Van de Paar (roel11) wrote :

Many other errors seen in Valgrind run.

tags: added: qa qa57 valgrind
Revision history for this message
Roel Van de Paar (roel11) wrote :
Revision history for this message
Roel Van de Paar (roel11) wrote :

PS 5.6 (debug) - clean
MS 5.7 (debug) - clean

Revision history for this message
Roel Van de Paar (roel11) wrote :

Established that issue is 1) MTR reproducible (if LD_PRELOAD is used) 2) jemalloc related (does not reproduce with empty LD_PRELOAD)

Revision history for this message
Roel Van de Paar (roel11) wrote :

- jemalloc 4.0.4 fixes the issue.
- jemalloc 3.6.0-1.el7, default in Centos 7, has the issue

Hence, this is now a doc bug which must be included in 5.7 docs

tags: added: doc
summary: - Valgrind: memset > pfs_malloc
+ Valgrind + jemalloc 3.6.0 gives spurious warnings. Not seen with
+ jemalloc 4.0.4.
tags: added: pkg
removed: doc
Revision history for this message
Roel Van de Paar (roel11) wrote :

This bug can be actioned after PQA-110 (Test jemalloc 4.0.4 or higher) is done.

Revision history for this message
Roel Van de Paar (roel11) wrote :

Would still be good to better understand why we see them in PS 5.7 and not in PS 5.6 nor in MS 5.7

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3373

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.