Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5412

Valgrind warnings "Invalid read" in buildbot on subselect tests

    Details

      Description

      The problem started happening on 5.3 tree with the following revision:

      revno: 3734
      revision-id: igor@askmonty.org-20131207155102-roym5zo4ax93io89
      branch nick: maria-5.3-mdev5400
      timestamp: Sat 2013-12-07 07:51:02 -0800
      message:
        Fixed bug mdev-5400:
        a memory leak in save_index() first seen in the test case for mdev-5382.

      Several tests cause the same valgrind warning in buildbot:
      http://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/4960/steps/test/logs/stdio

      main.subselect_mat
      main.subselect_no_scache
      main.subselect_sj_mat
      main.subselect_sj_nonmerged
      main.subselect

      A valgrind build is not neccessary, it is reproducible on an ordinary BUILD/compile-pentium-debug-max-no-ndb as well:

      perl mysql-test-run.pl main.subselect_mat --valgrind-mysqld

      ==14540== Thread 4:
      ==14540== Invalid read of size 8
      ==14540==    at 0x6FF91E: free_io_cache(st_table*) (sql_base.cc:836)
      ==14540==    by 0x742AEB: JOIN::cleanup(bool) (sql_select.cc:10525)
      ==14540==    by 0x72F0A8: JOIN::destroy() (sql_select.cc:2848)
      ==14540==    by 0x8B1DA4: st_select_lex::cleanup() (sql_union.cc:964)
      ==14540==    by 0x72F741: 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:3031)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540==    by 0x6B771A: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6173)
      ==14540==    by 0x6A972F: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1243)
      ==14540==    by 0x6A8A1B: do_command(THD*) (sql_parse.cc:923)
      ==14540==    by 0x6A58A4: handle_one_connection (sql_connect.cc:1231)
      ==14540==    by 0x58B5B4F: start_thread (pthread_create.c:304)
      ==14540==    by 0x654CA7C: clone (clone.S:112)
      ==14540==  Address 0xfda9d88 is 2,280 bytes inside a block of size 4,012 free'd
      ==14540==    at 0x4C27D4E: free (vg_replace_malloc.c:427)
      ==14540==    by 0xB799C8: _myfree (safemalloc.c:337)
      ==14540==    by 0xB78CB8: free_root (my_alloc.c:366)
      ==14540==    by 0x74F255: free_tmp_table(THD*, st_table*) (sql_select.cc:15749)
      ==14540==    by 0x63ECAC: subselect_hash_sj_engine::cleanup() (item_subselect.cc:4441)
      ==14540==    by 0x633761: Item_subselect::cleanup() (item_subselect.cc:130)
      ==14540==    by 0x63393C: Item_in_subselect::cleanup() (item_subselect.cc:167)
      ==14540==    by 0x742032: st_join_table::cleanup() (sql_select.cc:10224)
      ==14540==    by 0x742B3D: JOIN::cleanup(bool) (sql_select.cc:10534)
      ==14540==    by 0x74283A: JOIN::join_free() (sql_select.cc:10454)
      ==14540==    by 0x74FA0F: do_select(JOIN*, List<Item>*, st_table*, Procedure*) (sql_select.cc:15938)
      ==14540==    by 0x72EDD2: JOIN::exec() (sql_select.cc:2788)
      ==14540==    by 0x72F66C: 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:3009)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540== Invalid read of size 8
      ==14540==    at 0x81F79F: filesort_free_buffers(st_table*, bool) (filesort.cc:347)
      ==14540==    by 0x742B14: JOIN::cleanup(bool) (sql_select.cc:10526)
      ==14540==    by 0x72F0A8: JOIN::destroy() (sql_select.cc:2848)
      ==14540==    by 0x8B1DA4: st_select_lex::cleanup() (sql_union.cc:964)
      ==14540==    by 0x72F741: 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:3031)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540==    by 0x6B771A: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6173)
      ==14540==    by 0x6A972F: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1243)
      ==14540==    by 0x6A8A1B: do_command(THD*) (sql_parse.cc:923)
      ==14540==    by 0x6A58A4: handle_one_connection (sql_connect.cc:1231)
      ==14540==    by 0x58B5B4F: start_thread (pthread_create.c:304)
      ==14540==    by 0x654CA7C: clone (clone.S:112)
      ==14540==  Address 0xfda9dd0 is 2,352 bytes inside a block of size 4,012 free'd
      ==14540==    at 0x4C27D4E: free (vg_replace_malloc.c:427)
      ==14540==    by 0xB799C8: _myfree (safemalloc.c:337)
      ==14540==    by 0xB78CB8: free_root (my_alloc.c:366)
      ==14540==    by 0x74F255: free_tmp_table(THD*, st_table*) (sql_select.cc:15749)
      ==14540==    by 0x63ECAC: subselect_hash_sj_engine::cleanup() (item_subselect.cc:4441)
      ==14540==    by 0x633761: Item_subselect::cleanup() (item_subselect.cc:130)
      ==14540==    by 0x63393C: Item_in_subselect::cleanup() (item_subselect.cc:167)
      ==14540==    by 0x742032: st_join_table::cleanup() (sql_select.cc:10224)
      ==14540==    by 0x742B3D: JOIN::cleanup(bool) (sql_select.cc:10534)
      ==14540==    by 0x74283A: JOIN::join_free() (sql_select.cc:10454)
      ==14540==    by 0x74FA0F: do_select(JOIN*, List<Item>*, st_table*, Procedure*) (sql_select.cc:15938)
      ==14540==    by 0x72EDD2: JOIN::exec() (sql_select.cc:2788)
      ==14540==    by 0x72F66C: 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:3009)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540== Invalid read of size 8
      ==14540==    at 0x81F7EA: filesort_free_buffers(st_table*, bool) (filesort.cc:354)
      ==14540==    by 0x742B14: JOIN::cleanup(bool) (sql_select.cc:10526)
      ==14540==    by 0x72F0A8: JOIN::destroy() (sql_select.cc:2848)
      ==14540==    by 0x8B1DA4: st_select_lex::cleanup() (sql_union.cc:964)
      ==14540==    by 0x72F741: 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:3031)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540==    by 0x6B771A: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6173)
      ==14540==    by 0x6A972F: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1243)
      ==14540==    by 0x6A8A1B: do_command(THD*) (sql_parse.cc:923)
      ==14540==    by 0x6A58A4: handle_one_connection (sql_connect.cc:1231)
      ==14540==    by 0x58B5B4F: start_thread (pthread_create.c:304)
      ==14540==    by 0x654CA7C: clone (clone.S:112)
      ==14540==  Address 0xfda9d90 is 2,288 bytes inside a block of size 4,012 free'd
      ==14540==    at 0x4C27D4E: free (vg_replace_malloc.c:427)
      ==14540==    by 0xB799C8: _myfree (safemalloc.c:337)
      ==14540==    by 0xB78CB8: free_root (my_alloc.c:366)
      ==14540==    by 0x74F255: free_tmp_table(THD*, st_table*) (sql_select.cc:15749)
      ==14540==    by 0x63ECAC: subselect_hash_sj_engine::cleanup() (item_subselect.cc:4441)
      ==14540==    by 0x633761: Item_subselect::cleanup() (item_subselect.cc:130)
      ==14540==    by 0x63393C: Item_in_subselect::cleanup() (item_subselect.cc:167)
      ==14540==    by 0x742032: st_join_table::cleanup() (sql_select.cc:10224)
      ==14540==    by 0x742B3D: JOIN::cleanup(bool) (sql_select.cc:10534)
      ==14540==    by 0x74283A: JOIN::join_free() (sql_select.cc:10454)
      ==14540==    by 0x74FA0F: do_select(JOIN*, List<Item>*, st_table*, Procedure*) (sql_select.cc:15938)
      ==14540==    by 0x72EDD2: JOIN::exec() (sql_select.cc:2788)
      ==14540==    by 0x72F66C: 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:3009)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540== Invalid read of size 8
      ==14540==    at 0x81F82B: filesort_free_buffers(st_table*, bool) (filesort.cc:359)
      ==14540==    by 0x742B14: JOIN::cleanup(bool) (sql_select.cc:10526)
      ==14540==    by 0x72F0A8: JOIN::destroy() (sql_select.cc:2848)
      ==14540==    by 0x8B1DA4: st_select_lex::cleanup() (sql_union.cc:964)
      ==14540==    by 0x72F741: 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:3031)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540==    by 0x6B771A: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6173)
      ==14540==    by 0x6A972F: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1243)
      ==14540==    by 0x6A8A1B: do_command(THD*) (sql_parse.cc:923)
      ==14540==    by 0x6A58A4: handle_one_connection (sql_connect.cc:1231)
      ==14540==    by 0x58B5B4F: start_thread (pthread_create.c:304)
      ==14540==    by 0x654CA7C: clone (clone.S:112)
      ==14540==  Address 0xfda9da0 is 2,304 bytes inside a block of size 4,012 free'd
      ==14540==    at 0x4C27D4E: free (vg_replace_malloc.c:427)
      ==14540==    by 0xB799C8: _myfree (safemalloc.c:337)
      ==14540==    by 0xB78CB8: free_root (my_alloc.c:366)
      ==14540==    by 0x74F255: free_tmp_table(THD*, st_table*) (sql_select.cc:15749)
      ==14540==    by 0x63ECAC: subselect_hash_sj_engine::cleanup() (item_subselect.cc:4441)
      ==14540==    by 0x633761: Item_subselect::cleanup() (item_subselect.cc:130)
      ==14540==    by 0x63393C: Item_in_subselect::cleanup() (item_subselect.cc:167)
      ==14540==    by 0x742032: st_join_table::cleanup() (sql_select.cc:10224)
      ==14540==    by 0x742B3D: JOIN::cleanup(bool) (sql_select.cc:10534)
      ==14540==    by 0x74283A: JOIN::join_free() (sql_select.cc:10454)
      ==14540==    by 0x74FA0F: do_select(JOIN*, List<Item>*, st_table*, Procedure*) (sql_select.cc:15938)
      ==14540==    by 0x72EDD2: JOIN::exec() (sql_select.cc:2788)
      ==14540==    by 0x72F66C: 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:3009)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540== Invalid read of size 8
      ==14540==    at 0x81F87A: filesort_free_buffers(st_table*, bool) (filesort.cc:366)
      ==14540==    by 0x742B14: JOIN::cleanup(bool) (sql_select.cc:10526)
      ==14540==    by 0x72F0A8: JOIN::destroy() (sql_select.cc:2848)
      ==14540==    by 0x8B1DA4: st_select_lex::cleanup() (sql_union.cc:964)
      ==14540==    by 0x72F741: 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:3031)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)
      ==14540==    by 0x6B771A: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6173)
      ==14540==    by 0x6A972F: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1243)
      ==14540==    by 0x6A8A1B: do_command(THD*) (sql_parse.cc:923)
      ==14540==    by 0x6A58A4: handle_one_connection (sql_connect.cc:1231)
      ==14540==    by 0x58B5B4F: start_thread (pthread_create.c:304)
      ==14540==    by 0x654CA7C: clone (clone.S:112)
      ==14540==  Address 0xfda9db0 is 2,320 bytes inside a block of size 4,012 free'd
      ==14540==    at 0x4C27D4E: free (vg_replace_malloc.c:427)
      ==14540==    by 0xB799C8: _myfree (safemalloc.c:337)
      ==14540==    by 0xB78CB8: free_root (my_alloc.c:366)
      ==14540==    by 0x74F255: free_tmp_table(THD*, st_table*) (sql_select.cc:15749)
      ==14540==    by 0x63ECAC: subselect_hash_sj_engine::cleanup() (item_subselect.cc:4441)
      ==14540==    by 0x633761: Item_subselect::cleanup() (item_subselect.cc:130)
      ==14540==    by 0x63393C: Item_in_subselect::cleanup() (item_subselect.cc:167)
      ==14540==    by 0x742032: st_join_table::cleanup() (sql_select.cc:10224)
      ==14540==    by 0x742B3D: JOIN::cleanup(bool) (sql_select.cc:10534)
      ==14540==    by 0x74283A: JOIN::join_free() (sql_select.cc:10454)
      ==14540==    by 0x74FA0F: do_select(JOIN*, List<Item>*, st_table*, Procedure*) (sql_select.cc:15938)
      ==14540==    by 0x72EDD2: JOIN::exec() (sql_select.cc:2788)
      ==14540==    by 0x72F66C: 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:3009)
      ==14540==    by 0x7260CC: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
      ==14540==    by 0x6B4DB3: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
      ==14540==    by 0x6ABF4F: mysql_execute_command(THD*) (sql_parse.cc:2305)

        Attachments

          Activity

            People

            • Assignee:
              igor Igor Babaev
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: