Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 10 of 15 5 Older Entries

Displaying posts with tag: valgrind (reset)

MySQL 5.7 Versus the Address Sanitizer
+1 Vote Up -0Vote Down

MySQL 5.7 supports the Address Sanitizer, which checks for several memory related software errors including memory leaks.  It is really nice to see support for the Address Sanitizer built into MySQL.  Unfortunately, when running the mysql tests included in MySQL 5.7.9, the Address Sanitizer reports several memory leaks, which causes some of  the tests to fail.  Here are some of the …

  [Read more...]
TokuBackup Versus the Sanitizers
+1 Vote Up -0Vote Down

Percona recently open sourced TokuBackup, a library that may be used to take a snapshot of a set of files while these files are being changed by a running application like MySQL or MongoDB.  Making TokuBackup open source allows a larger set of users to improve and extend the software.  This blog describes how the Address Sanitizer and Thread Sanitizer found bugs in the TokuBackup …

  [Read more...]
The Address Sanitizer Finds Bugs in TokuFT
+0 Vote Up -0Vote Down

This blog describes how the Address Sanitizer found bugs in the TokuFT (now PerconaFT) storage library.  TokuFT is the storage library used by the TokuDB for MySQL and TokuMX for MongoDB products.  TokuFT is currently tested with valgrind's

  [Read more...]
MySQL QA Episode 11: Valgrind Testing: Pro’s, Con’s, Why and How
+0 Vote Up -0Vote Down

Today’s episode is all about Valgrind – from the pro’s to the con’s, from the why to the how! This episode will be of interest to anyone who is or wants to work with Valgrind on a regular or semi-regular basis.

  1. Pro’s/Why
  2. Con’s
  3. How
    1. Using the latest version
      sudo [yum/apt-get] install valgrind
      sudo [yum/apt-get] remove valgrind
      sudo [yum/apt-get] install bzip2 glibc*
      tar -xf valgrind-3.10.1.tar.bz2; cd valgrind-3.10.1

  [Read more...]
Helgrind and MySQL 5.7
+1 Vote Up -0Vote Down

Valgrind's helgrind tool identifies data races and lock deadlocks in multi-threaded programs.  Since the MySQL server is a multi-threaded program, can helgrind find any issues in the MySQL server?

A simple test that does nothing except start up the MySQL server and shut it down is run on the MySQL test suite with  …

  [Read more...]
Why TokuDB does not use the ‘uint3korr’ function
+0 Vote Up -0Vote Down

The ‘uint3korr’ function inside of the mysqld server extracts a 3 byte unsigned integer from a memory buffer. One use is for ‘mediumint’ columns which encode their value in 3 bytes. MySQL 5.6 and MariaDB 10.0 claims to have optimized this function for x86 and x86_64 processors. There is a big comment that says:

Attention: Please, note, uint3korr reads 4 bytes (not 3)!
It means, that you have to provide enough allocated space.

The ‘uint3korr’ optimization may be fast, but it is not valgrind safe. Here is an example where valgrind detects TokuDB reading beyond the end of a buffer when it uses the ‘uint3korr’ function. …

  [Read more...]
Uninitialized data in the TokuDB recovery log
+0 Vote Up -0Vote Down

A TokuDB MySQL test run with valgrind reported an uninitialized data error when writing into the TokuDB recovery log.

==1032== Syscall param write(buf) points to uninitialised byte(s)
==1032== at 0x3EFA60E4ED: ??? (in /lib64/
==1032== by 0xB894038: toku_os_full_write(int, void const*, unsigned long) (
==1032== by 0xB83248A: write_outbuf_to_logfile(tokulogger*, __toku_lsn*) (
==1032== by 0xB83326C: toku_logger_maybe_fsync(tokulogger*, __toku_lsn, int, bool) (
==1032== by 0xB8327DE: toku_logger_fsync_if_lsn_not_fsynced(tokulogger*, __toku_lsn) (
==1032== by 0xB8493E6: …
  [Read more...]
Copying unused bytes is bad (duh!)
Employee +3 Vote Up -0Vote Down

Last summer my colleague Marko Mäkelä committed this seemingly innocent performance fix for InnoDB in MySQL 5.6:

3581 Marko Makela    2011-08-10
Bug#12835650 VARCHAR maximum length performance impact

row_sel_field_store_in_mysql_format(): Do not pad the unused part of
the buffer reserved for a True VARCHAR column (introduced in 5.0.3).
Add Valgrind instrumentation ensuring that the unused part will be
flagged uninitialized.
Before this, buffers which were used to send VARCHARs from InnoDB to the MySQL server were padded with 0s if the string was shorter than specified by …

  [Read more...]
An exercise on using valgrind with MySQL on MacOSX
Employee +3 Vote Up -0Vote Down

Valgrind is a very useful tool. This has been recognized by the mysql developers long ago. They've even invested effort into creating a special mode for the mysql test driver ( to invoke the server tests under valgrind and collect the results.
But the sad fact remains that this is not exactly usable on MacOSX due to immaturity of the valgrind's support for this platform.
Encouraged by the announcement of the return of MacOSX support in valgrind 3.6 I've started periodically giving a try to the latest valgrind version out of the …

  [Read more...]
An exercise on using valgrind with MySQL on MacOSX
Employee +0 Vote Up -0Vote Down
Showing entries 1 to 10 of 15 5 Older Entries

Planet MySQL © 1995, 2015, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.