Bug #78191 Valgrind error on main.ctype_gb18030_conversion
Submitted: 24 Aug 2015 12:21 Modified: 25 Aug 2015 14:09
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.7.8 OS:Linux
Assigned to: CPU Architecture:Any
Tags: mtr, valgrind

[24 Aug 2015 12:21] Laurynas Biveinis
Description:
cmake -DBUILD_CONFIG=mysql_release -DWITH_DEBUG=ON -DWITH_VALGRIND=ON  -DWITH_SSL=system -DWITH_BOOST=..
...
$ ./mtr --debug-server --valgrind ctype_gb18030_conversion --big-test
...
main.ctype_gb18030_conversion            [ fail ]  Found warnings/errors in server log file!
        Test ended at 2015-08-24 15:17:35
line
==17835== Thread 24:
==17835== Syscall param write(buf) points to uninitialised byte(s)
==17835==    at 0x5CD2DAD: ??? (syscall-template.S:81)
==17835==    by 0x18530C3: my_write (my_write.c:63)
==17835==    by 0x182C1CD: inline_mysql_file_write (mysql_file.h:1146)
==17835==    by 0x182F7B6: my_b_flush_io_cache (mf_iocache.c:1537)
==17835==    by 0x182EE4E: _my_b_write (mf_iocache.c:1306)
==17835==    by 0xE97B1C: write_keys(Sort_param*, Filesort_info*, unsigned int, st_io_cache*, st_io_cache*) (filesort.cc:1147)
==17835==    by 0xE97497: find_all_keys(Sort_param*, QEP_TAB*, Filesort_info*, st_io_cache*, st_io_cache*, Bounded_queue<unsigned char*, unsigned char*, Sort_param, (anonymous namespace)::Mem_compare>*, unsigned long long*) (filesort.cc:1006)
==17835==    by 0xE957B3: filesort(THD*, Filesort*, bool, unsigned long long*, unsigned long long*, unsigned long long*) (filesort.cc:422)
==17835==    by 0x14C2387: create_sort_index(THD*, JOIN*, QEP_TAB*) (sql_executor.cc:3677)
==17835==    by 0x14BF247: QEP_TAB::sort_table() (sql_executor.cc:2572)
==17835==    by 0x14BEAB4: join_init_read_record(QEP_TAB*) (sql_executor.cc:2438)
==17835==    by 0x14BBCD2: sub_select(JOIN*, QEP_TAB*, bool) (sql_executor.cc:1265)
==17835==    by 0x14BB5FF: do_select(JOIN*) (sql_executor.cc:938)
==17835==    by 0x14B943F: JOIN::exec() (sql_executor.cc:200)
==17835==    by 0x155B6DC: handle_query(THD*, LEX*, Query_result*, unsigned long long, unsigned long long) (sql_select.cc:184)
==17835==    by 0x150B686: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4843)
==17835==  Address 0x1991e1dd is 45 bytes inside a block of size 65,568 alloc'd
==17835==    at 0x4C2BBA0: malloc (vg_replace_malloc.c:296)
==17835==    by 0x184C0DB: my_raw_malloc (my_malloc.c:191)
==17835==    by 0x184BBD4: my_malloc (my_malloc.c:54)
==17835==    by 0x182C987: init_io_cache (mf_iocache.c:231)
==17835==    by 0x1829F1C: open_cached_file (mf_cache.c:58)
==17835==    by 0xE9791F: write_keys(Sort_param*, Filesort_info*, unsigned int, st_io_cache*, st_io_cache*) (filesort.cc:1119)
==17835==    by 0xE97497: find_all_keys(Sort_param*, QEP_TAB*, Filesort_info*, st_io_cache*, st_io_cache*, Bounded_queue<unsigned char*, unsigned char*, Sort_param, (anonymous namespace)::Mem_compare>*, unsigned long long*) (filesort.cc:1006)
==17835==    by 0xE957B3: filesort(THD*, Filesort*, bool, unsigned long long*, unsigned long long*, unsigned long long*) (filesort.cc:422)
==17835==    by 0x14C2387: create_sort_index(THD*, JOIN*, QEP_TAB*) (sql_executor.cc:3677)
==17835==    by 0x14BF247: QEP_TAB::sort_table() (sql_executor.cc:2572)
==17835==    by 0x14BEAB4: join_init_read_record(QEP_TAB*) (sql_executor.cc:2438)
==17835==    by 0x14BBCD2: sub_select(JOIN*, QEP_TAB*, bool) (sql_executor.cc:1265)
==17835==    by 0x14BB5FF: do_select(JOIN*) (sql_executor.cc:938)
==17835==    by 0x14B943F: JOIN::exec() (sql_executor.cc:200)
==17835==    by 0x155B6DC: handle_query(THD*, LEX*, Query_result*, unsigned long long, unsigned long long) (sql_select.cc:184)
==17835==    by 0x150B686: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4843)
^ Found warnings in /home/laurynas/obj-5.7-valgrind/mysql-test/var/log/mysqld.1.err
ok

How to repeat:
See above
[24 Aug 2015 17:16] MySQL Verification Team
Thank you for the bug report.

[miguel@miguelbr mysql-5.7]$ ./mtr --debug-server --valgrind ctype_gb18030_conversion --big-test                                           
bash: ./mtr: No such file or directory                                                                                                     
[miguel@miguelbr mysql-5.7]$ cd mysql-test/                                                                                                
[miguel@miguelbr mysql-test]$ ./mtr --debug-server --valgrind ctype_gb18030_conversion --big-test                                          
Logging: ./mtr  --debug-server --valgrind ctype_gb18030_conversion --big-test                                                              
2015-08-24T15:43:55.211448Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)                                              
2015-08-24T15:43:55.211527Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)                                             
MySQL Version 5.7.9                                                                                                                        
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           

<cut>

Installing system database...                                                                                                              

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

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

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
worker[1] Test still running: main.ctype_gb18030_conversion           
worker[1] Test still running: main.ctype_gb18030_conversion           
worker[1] Test still running: main.ctype_gb18030_conversion           
main.ctype_gb18030_conversion            [ fail ]  Found warnings/errors in server log file!
        Test ended at 2015-08-24 13:52:08                                                   
line                                                                                        
==24193== Thread 24:
[25 Aug 2015 3:27] Anitha Gopi
Posted by developer:
 
This was fixed on trunk Bug#20840377. However this problem is seen again in weekly-trunk. 

pb2.no.oracle.com/?template=mysql_show_test_failure&search=yes&push_id=8233128&test_id=8235424&test_run=all_default_valgrind&test_suite=main&test_case=ctype_gb18030_conversion
main.ctype_gb18030_conversion            w4 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2015-07-19 05:43:24
line
==32731== Thread 26:
==32731== Syscall param write(buf) points to uninitialised byte(s)
==32731==    at 0x4E3D4ED: ??? (in /lib64/libpthread-2.12.so)
==32731==    by 0x17997C2: my_write (my_write.c:63)
==32731==    by 0x1774C6C: inline_mysql_file_write (mysql_file.h:1163)
==32731==    by 0x1777F74: my_b_flush_io_cache (mf_iocache.c:1537)
==32731==    by 0x1777647: _my_b_write (mf_iocache.c:1306)
==32731==    by 0xE48BC0: write_keys(Sort_param*, Filesort_info*, unsigned int, st_io_cache*, st_io_cache*) (filesort.cc:1154)
==32731==    by 0xE485FD: find_all_keys(THD*, Sort_param*, QEP_TAB*, Filesort_info*, st_io_cache*, st_io_cache*, Bounded_queue<unsigned char*, unsigned char*, Sort_param, (anonymous namespace)::Mem_compare>*, unsigned long long*) (filesort.cc:1013)
==32731==    by 0xE46A1C: filesort(THD*, Filesort*, bool, unsigned long long*, unsigned long long*, unsigned long long*) (filesort.cc:427)
==32731==    by 0x14244A1: create_sort_index(THD*, JOIN*, QEP_TAB*) (sql_executor.cc:3685)
==32731==    by 0x1421532: QEP_TAB::sort_table() (sql_executor.cc:2580)
==32731==    by 0x1420E19: join_init_read_record(QEP_TAB*) (sql_executor.cc:2446)
==32731==    by 0x141E197: sub_select(JOIN*, QEP_TAB*, bool) (sql_executor.cc:1273)
==32731==    by 0x141DB39: do_select(JOIN*) (sql_executor.cc:953)
==32731==    by 0x141BAD5: JOIN::exec() (sql_executor.cc:215)
==32731==    by 0x14B7A53: handle_query(THD*, LEX*, Query_result*, unsigned long long, unsigned long long) (sql_select.cc:190)
==32731==    by 0x146C8A7: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4835)
==32731==  Address 0x2a66024d is 45 bytes inside a block of size 65,568 alloc'd
==32731==    at 0x4C279EE: malloc (vg_replace_malloc.c:270)
==32731==    by 0x1793084: my_raw_malloc (my_malloc.c:192)
==32731==    by 0x1792BAC: my_malloc (my_malloc.c:55)
==32731==    by 0x17753FA: init_io_cache (mf_iocache.c:231)
==32731==    by 0x1772B70: open_cached_file (mf_cache.c:59)
==32731==    by 0xE489BB: write_keys(Sort_param*, Filesort_info*, unsigned int, st_io_cache*, st_io_cache*) (filesort.cc:1124)
==32731==    by 0xE485FD: find_all_keys(THD*, Sort_param*, QEP_TAB*, Filesort_info*, st_io_cache*, st_io_cache*, Bounded_queue<unsigned char*, unsigned char*, Sort_param, (anonymous namespace)::Mem_compare>*, unsigned long long*) (filesort.cc:1013)
==32731==    by 0xE46A1C: filesort(THD*, Filesort*, bool, unsigned long long*, unsigned long long*, unsigned long long*) (filesort.cc:427)
==32731==    by 0x14244A1: create_sort_index(THD*, JOIN*, QEP_TAB*) (sql_executor.cc:3685)
==32731==    by 0x1421532: QEP_TAB::sort_table() (sql_executor.cc:2580)
==32731==    by 0x1420E19: join_init_read_record(QEP_TAB*) (sql_executor.cc:2446)
==32731==    by 0x141E197: sub_select(JOIN*, QEP_TAB*, bool) (sql_executor.cc:1273)
==32731==    by 0x141DB39: do_select(JOIN*) (sql_executor.cc:953)
==32731==    by 0x141BAD5: JOIN::exec() (sql_executor.cc:215)
==32731==    by 0x14B7A53: handle_query(THD*, LEX*, Query_result*, unsigned long long, unsigned long long) (sql_select.cc:190)
==32731==    by 0x146C8A7: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4835)
^ Found warnings in /dev/shm/mtr-17265/var-all_default_valgrind/4/log/mysqld.1.err
ok

 - the logfile can be found in '/dev/shm/mtr-17265/var-all_default_valgrind/log/main.ctype_gb18030_conversion/ctype_gb18030_conversion.log'

Retrying test main.ctype_gb18030_conversion, attempt(2/3)...
[25 Aug 2015 14:09] Paul DuBois
Fixed in 5.7.9, 5.8.0. Changes for test suite. No changelog entry needed.