Suppression typo causing spurious MTR Valgrind failures

Bug #1334317 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Laurynas Biveinis
5.1
Won't Fix
Undecided
Unassigned
5.5
Fix Released
Low
Laurynas Biveinis
5.6
Invalid
Undecided
Laurynas Biveinis

Bug Description

Copy of http://bugs.mysql.com/bug.php?id=73111:

[25 Jun 9:41] Laurynas Biveinis
Description:
main.ctype_eucjpms [ fail ] Found warnings/errors in server log file!
        Test ended at 2014-06-25 11:34:38
line
==1327== Thread 13:
==1327== Syscall param write(buf) points to uninitialised byte(s)
==1327== at 0x504835D: ??? (syscall-template.S:81)
==1327== by 0x7E52DE: my_write (my_write.c:43)
==1327== by 0x7CDD16: my_b_flush_io_cache (mysql_file.h:1134)
==1327== by 0x7CE390: _my_b_write (mf_iocache.c:1549)
==1327== by 0x6A06D1: write_keys(st_sort_param*, unsigned char**, unsigned int, st_io_cache*, st_io_cache*) (filesort.cc:760)
==1327== by 0x6A29CC: filesort(THD*, TABLE*, st_sort_field*, unsigned int, SQL_SELECT*, unsigned long long, bool, unsigned long long*) (filesort.cc:662)
==1327== by 0x5BDD1F: create_sort_index(THD*, JOIN*, st_order*, unsigned long long, unsigned long long, bool) (sql_select.cc:14254)
==1327== by 0x5D0C4C: JOIN::exec() (sql_select.cc:2354)
==1327== by 0x5CAD39: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:2604)
==1327== by 0x5CAF30: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:297)
==1327== by 0x5815B6: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4625)
==1327== by 0x587A80: mysql_execute_command(THD*) (sql_parse.cc:2176)
==1327== by 0x58F20B: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5662)
==1327== by 0x590A96: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1038)
==1327== by 0x592905: do_command(THD*) (sql_parse.cc:773)
==1327== by 0x63DEAD: do_handle_one_connection(THD*) (sql_connect.cc:862)
==1327== Address 0x10abaf57 is 23 bytes inside a block of size 65,536 alloc'd
==1327== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1327== by 0x7E13D4: my_malloc (my_malloc.c:38)
==1327== by 0x7CD4E1: init_io_cache (mf_iocache.c:232)
==1327== by 0x7CAB06: open_cached_file (mf_cache.c:69)
==1327== by 0x6A0640: write_keys(st_sort_param*, unsigned char**, unsigned int, st_io_cache*, st_io_cache*) (filesort.cc:750)
==1327== by 0x6A29CC: filesort(THD*, TABLE*, st_sort_field*, unsigned int, SQL_SELECT*, unsigned long long, bool, unsigned long long*) (filesort.cc:662)
==1327== by 0x5BDD1F: create_sort_index(THD*, JOIN*, st_order*, unsigned long long, unsigned long long, bool) (sql_select.cc:14254)
==1327== by 0x5D0C4C: JOIN::exec() (sql_select.cc:2354)
==1327== by 0x5CAD39: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:2604)
==1327== by 0x5CAF30: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:297)
==1327== by 0x5815B6: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4625)
==1327== by 0x587A80: mysql_execute_command(THD*) (sql_parse.cc:2176)
==1327== by 0x58F20B: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5662)
==1327== by 0x590A96: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1038)
==1327== by 0x592905: do_command(THD*) (sql_parse.cc:773)
==1327== by 0x63DEAD: do_handle_one_connection(THD*) (sql_connect.cc:862)

Affected tests: ctype_eucjpms, ctype_sjis, ctype_tis620 ctype_ujis ctype_ujis_ucs2 ctype_cp932_binlog_stm subselect sum_distinct, all in main suite.

How to repeat:
Server built with -DWITH_DEBUG=ON -DWITH_VALGRIND=ON -DCMAKE_C_FLAGS=-DHAVE_purify -DCMAKE_CXX_FLAGS=-DHAVE_purify -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF -DENABLE_DTRACE=OFF -DWITH_EXAMPLE_STORAGE_ENGINE=1 -DWITH_SSL=system

Suggested fix:
There are existing suppressions that attempt to address this, the closest one being

{
   Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / one
   Memcheck:Param
   write(buf)
   obj:*/libpthread*.so
   fun:my_write
   ...
   fun:my_b_flush_io_cache
   fun:_my_b_write
   fun:_Z10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_
   fun:_Z13find_all_keysP13st_sort_paramP10SQL_SELECTPPhP11st_io_cacheS6_
   fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
}

It does not account for find_all_keys missing in the stacktrace, and write_keys needs slightly different mangling at least on my system. Changing it as follows fixes the issue.

=== modified file 'mysql-test/valgrind.supp'
--- mysql-test/valgrind.supp 2012-02-14 07:11:28 +0000
+++ mysql-test/valgrind.supp 2014-06-25 09:16:58 +0000
@@ -892,8 +892,8 @@
    ...
    fun:my_b_flush_io_cache
    fun:_my_b_write
- fun:_Z*10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_
- fun:_Z*13find_all_keysP13st_sort_paramP10SQL_SELECTPPhP11st_io_cacheS6_
+ fun:_ZL10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_
+ ...
    fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
 }
Legal PoliciesYour Privacy RightsTerms of UseContact Us

Related branches

tags: added: ci low-hanging-fruit upstream valgrind
Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

I can NOT reproduce this with 5.6:

openxs@ao756:~/dbs/p5.6v/mysql-test$ ./mysql-test-run --valgrind ctype_eucjpms Logging: ./mysql-test-run --valgrind ctype_eucjpms
2014-06-26 13:01:03 24313 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2014-06-26 13:01:03 24313 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)

2014-06-26 13:01:03 24313 [Note] Plugin 'FEDERATED' is disabled.
2014-06-26 13:01:03 24313 [Note] Binlog end
2014-06-26 13:01:03 24313 [Note] Shutting down plugin 'CSV'
2014-06-26 13:01:03 24313 [Note] Shutting down plugin 'MyISAM'
MySQL Version 5.6.19
Turning on valgrind for all executables
Running valgrind with options " --show-reachable=yes "
Turning off --check-testcases to save time when valgrinding
Checking supported features...
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/openxs/dbs/p5.6v/mysql-test/var'...
Installing system database...

==============================================================================

TEST RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009

main.ctype_eucjpms [ pass ] 291488
valgrind_report [ pass ]
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 291.488 of 353 seconds executing testcases

Completed: All 2 tests were successful.

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-3159

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

Other bug subscribers

Remote bug watches

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