Uploaded image for project: 'MariaDB Foundation Development'
  1. MariaDB Foundation Development
  2. MDBF-1125

Include instrumented curl libraries :was: MemoryStanitizer: use-of-uninitialized-value in S3 storage engine request generation

    XMLWordPrintable

Details

    Description

      Affects all s3 tests except s3.no_s3, because the curl libraries aren't instrumented.

      10.11- , https://buildbot.dev.mariadb.org/#/builders/535/builds/7/steps/12/logs/stdio

      CURRENT_TEST: s3.arguments
      Version: '10.11.15-MariaDB-debug-log'  socket: '/dev/shm/s3/tmp/9/mysqld.1.sock'  port: 19240  Source distribution
      ==70==WARNING: MemorySanitizer: use-of-uninitialized-value
          #0 0x7fc8d1371850 in generate_request_hash /home/buildbot/src/storage/maria/libmarias3/src/request.c:355:5
          #1 0x7fc8d136b5a8 in build_request_headers /home/buildbot/src/storage/maria/libmarias3/src/request.c:507:11
          #2 0x7fc8d1360ef9 in execute_request /home/buildbot/src/storage/maria/libmarias3/src/request.c:817:13
          #3 0x7fc8d135776e in ms3_list_dir /home/buildbot/src/storage/maria/libmarias3/src/marias3.c:402:9
          #4 0x7fc8d131e4d4 in s3_discover_table_names(handlerton*, st_mysql_const_lex_string*, st_my_dir*, handlerton::discovered_list*) /home/buildbot/src/storage/maria/ha_s3.cc:896:15
          #5 0x559a7ec1d4c1 in discover_names(THD*, st_plugin_int**, void*) /home/buildbot/src/sql/handler.cc:6681:9
          #6 0x559a7cecf6d2 in plugin_foreach_with_mask(THD*, char (*)(THD*, st_plugin_int**, void*), int, unsigned int, void*) /home/buildbot/src/sql/sql_plugin.cc:2558:15
          #7 0x559a7ec1c429 in ha_discover_table_names(THD*, st_mysql_const_lex_string*, st_my_dir*, Discovered_table_list*, bool) /home/buildbot/src/sql/handler.cc:6721:12
          #8 0x559a7d4f994c in find_files(THD*, Dynamic_array<st_mysql_const_lex_string*>*, st_mysql_const_lex_string*, char const*, st_mysql_const_lex_string const*) /home/buildbot/src/sql/sql_show.cc:991:9
          #9 0x559a7d456299 in make_table_name_list(THD*, Dynamic_array<st_mysql_const_lex_string*>*, LEX*, st_lookup_field_values*, st_mysql_const_lex_string*) /home/buildbot/src/sql/sql_show.cc:4606:26
          #10 0x559a7d44e0c3 in get_all_tables(THD*, TABLE_LIST*, Item*) /home/buildbot/src/sql/sql_show.cc:5375:16
          #11 0x559a7d4a9ec9 in get_schema_tables_result(JOIN*, enum_schema_table_state) /home/buildbot/src/sql/sql_show.cc:9275:11
          #12 0x559a7d176bae in JOIN::exec_inner() /home/buildbot/src/sql/sql_select.cc:4942:7
          #13 0x559a7d1721ab in JOIN::exec() /home/buildbot/src/sql/sql_select.cc:4769:3
          #14 0x559a7d044af5 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /home/buildbot/src/sql/sql_select.cc:5243:9
          #15 0x559a7d041192 in handle_select(THD*, LEX*, select_result*, unsigned long long) /home/buildbot/src/sql/sql_select.cc:600:10
          #16 0x559a7cd7dc1f in execute_sqlcom_select(THD*, TABLE_LIST*) /home/buildbot/src/sql/sql_parse.cc:6427:12
          #17 0x559a7cd38b36 in mysql_execute_command(THD*, bool) /home/buildbot/src/sql/sql_parse.cc:4008:12
          #18 0x559a7c4f07a5 in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/buildbot/src/sql/sp_head.cc:3946:12
          #19 0x559a7c4e7991 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/buildbot/src/sql/sp_head.cc:3657:17
          #20 0x559a7c4ebaef in sp_instr_stmt::execute(THD*, unsigned int*) /home/buildbot/src/sql/sp_head.cc:3849:25
          #21 0x559a7c4adbb5 in sp_head::execute(THD*, bool) /home/buildbot/src/sql/sp_head.cc:1464:20
          #22 0x559a7c4bfa6c in sp_head::execute_procedure(THD*, List<Item>*) /home/buildbot/src/sql/sp_head.cc:2480:5
          #23 0x559a7cd25e26 in do_execute_sp(THD*, sp_head*) /home/buildbot/src/sql/sql_parse.cc:3085:16
          #24 0x559a7cd24097 in Sql_cmd_call::execute(THD*) /home/buildbot/src/sql/sql_parse.cc:3330:9
          #25 0x559a7cd70a9a in mysql_execute_command(THD*, bool) /home/buildbot/src/sql/sql_parse.cc:6165:26
          #26 0x559a7cd013dc in mysql_parse(THD*, char*, unsigned int, Parser_state*) /home/buildbot/src/sql/sql_parse.cc:8180:18
          #27 0x559a7ccef212 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /home/buildbot/src/sql/sql_parse.cc:1906:7
          #28 0x559a7cd0699e in do_command(THD*, bool) /home/buildbot/src/sql/sql_parse.cc:1419:17
          #29 0x559a7dc0dda0 in do_handle_one_connection(CONNECT*, bool) /home/buildbot/src/sql/sql_connect.cc:1475:11
          #30 0x559a7dc0c69d in handle_one_connection /home/buildbot/src/sql/sql_connect.cc:1387:5
          #31 0x559a806455a8 in pfs_spawn_thread /home/buildbot/src/storage/perfschema/pfs.cc:2201:3
          #32 0x7fc8d82f61f4  (/lib/x86_64-linux-gnu/libc.so.6+0x891f4) (BuildId: 79005c16293efa45b441fed45f4f29b138557e9e)
          #33 0x7fc8d8375aff in clone (/lib/x86_64-linux-gnu/libc.so.6+0x108aff) (BuildId: 79005c16293efa45b441fed45f4f29b138557e9e)
        Uninitialized value was stored to memory at
          #0 0x7fc8d1371849 in generate_request_hash /home/buildbot/src/storage/maria/libmarias3/src/request.c:356:30
          #1 0x7fc8d136b5a8 in build_request_headers /home/buildbot/src/storage/maria/libmarias3/src/request.c:507:11
          #2 0x7fc8d1360ef9 in execute_request /home/buildbot/src/storage/maria/libmarias3/src/request.c:817:13
          #3 0x7fc8d135776e in ms3_list_dir /home/buildbot/src/storage/maria/libmarias3/src/marias3.c:402:9
          #4 0x7fc8d131e4d4 in s3_discover_table_names(handlerton*, st_mysql_const_lex_string*, st_my_dir*, handlerton::discovered_list*) /home/buildbot/src/storage/maria/ha_s3.cc:896:15
          #5 0x559a7ec1d4c1 in discover_names(THD*, st_plugin_int**, void*) /home/buildbot/src/sql/handler.cc:6681:9
          #6 0x559a7cecf6d2 in plugin_foreach_with_mask(THD*, char (*)(THD*, st_plugin_int**, void*), int, unsigned int, void*) /home/buildbot/src/sql/sql_plugin.cc:2558:15
          #7 0x559a7ec1c429 in ha_discover_table_names(THD*, st_mysql_const_lex_string*, st_my_dir*, Discovered_table_list*, bool) /home/buildbot/src/sql/handler.cc:6721:12
          #8 0x559a7d4f994c in find_files(THD*, Dynamic_array<st_mysql_const_lex_string*>*, st_mysql_const_lex_string*, char const*, st_mysql_const_lex_string const*) /home/buildbot/src/sql/sql_show.cc:991:9
          #9 0x559a7d456299 in make_table_name_list(THD*, Dynamic_array<st_mysql_const_lex_string*>*, LEX*, st_lookup_field_values*, st_mysql_const_lex_string*) /home/buildbot/src/sql/sql_show.cc:4606:26
          #10 0x559a7d44e0c3 in get_all_tables(THD*, TABLE_LIST*, Item*) /home/buildbot/src/sql/sql_show.cc:5375:16
          #11 0x559a7d4a9ec9 in get_schema_tables_result(JOIN*, enum_schema_table_state) /home/buildbot/src/sql/sql_show.cc:9275:11
          #12 0x559a7d176bae in JOIN::exec_inner() /home/buildbot/src/sql/sql_select.cc:4942:7
          #13 0x559a7d1721ab in JOIN::exec() /home/buildbot/src/sql/sql_select.cc:4769:3
          #14 0x559a7d044af5 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /home/buildbot/src/sql/sql_select.cc:5243:9
          #15 0x559a7d041192 in handle_select(THD*, LEX*, select_result*, unsigned long long) /home/buildbot/src/sql/sql_select.cc:600:10
          #16 0x559a7cd7dc1f in execute_sqlcom_select(THD*, TABLE_LIST*) /home/buildbot/src/sql/sql_parse.cc:6427:12
          #17 0x559a7cd38b36 in mysql_execute_command(THD*, bool) /home/buildbot/src/sql/sql_parse.cc:4008:12
          #18 0x559a7c4f07a5 in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/buildbot/src/sql/sp_head.cc:3946:12
          #19 0x559a7c4e7991 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/buildbot/src/sql/sp_head.cc:3657:17
        Memory was marked as uninitialized
          #0 0x559a7bfac18d in __msan_allocated_memory (/home/buildbot/bld/sql/mariadbd+0x8ef18d) (BuildId: 10988df2c77931e84c1e4bdef06cfb73b328e0c2)
          #1 0x559a82a6b1cc in my_malloc /home/buildbot/src/mysys/my_malloc.c:116:7
          #2 0x7fc8d132eeed in s3_wrap_malloc /home/buildbot/src/storage/maria/s3_func.c:56:10
          #3 0x7fc8d12b5049  (/lib/x86_64-linux-gnu/libcurl.so.4+0x5e049) (BuildId: edb0bad08419980896b571665b91cc7578ae602a)
      SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/buildbot/src/storage/maria/libmarias3/src/request.c:355:5 in generate_request_hash
      Exiting
      

      logs - (test environment - wont' exist for long) https://ci.dev.mariadb.org/220/logs/amd64-msan-clang-20-debug/

      noticed curl_slist_append earlier in stack doesn't have null pointer check on return value.

      not-null attributes could be used on function arguments.

      Attachments

        Issue Links

          Activity

            People

              rvarzaru Varzaru Razvan-Liviu
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1h
                  1h