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

Undefined behaviour: ha_example plugin show_func_example via show_status_array for SHOW_SIMPLE_FUNC has wrong function defination

    XMLWordPrintable

Details

    Description

      Like MDEV-33160 the function show_status_array calls with a status var pointer and type (b4ff64568c88ab3ce559e7bd39853d9cbf86704a)

      compiled under UBSAN this error occurs in running the main.plugin test:

      /source/sql/sql_show.cc:3821:7: runtime error: call to function show_func_example(THD*, st_mysql_show_var*, char*) through pointer to incorrect function type 'int (*)(THD *, st_mysql_show_var *, void *, system_status_var *, enum_var_type)'
      /source/storage/example/ha_example.cc:1082: note: show_func_example(THD*, st_mysql_show_var*, char*) defined here
          #0 0x559877df8868 in show_status_array(THD*, char const*, st_mysql_show_var*, enum_var_type, system_status_var*, char const*, TABLE*, bool, Item*) /source/sql/sql_show.cc:3821:7
          #1 0x559877df7514 in show_status_array(THD*, char const*, st_mysql_show_var*, enum_var_type, system_status_var*, char const*, TABLE*, bool, Item*) /source/sql/sql_show.cc:3827:7
          #2 0x559877df9bd6 in fill_status(THD*, TABLE_LIST*, Item*) /source/sql/sql_show.cc:8164:8
          #3 0x559877e02623 in get_schema_tables_result(JOIN*, enum_schema_table_state) /source/sql/sql_show.cc:9044:11
          #4 0x559877cb042d in JOIN::exec_inner() /source/sql/sql_select.cc:4896:7
          #5 0x559877cad80b in JOIN::exec() /source/sql/sql_select.cc:4717:3
          #6 0x559877c38454 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*) /source/sql/sql_select.cc:5196:9
          #7 0x559877c376a3 in handle_select(THD*, LEX*, select_result*, unsigned long) /source/sql/sql_select.cc:573:10
          #8 0x559877b7ebac in execute_sqlcom_select(THD*, TABLE_LIST*) /source/sql/sql_parse.cc:6422:12
          #9 0x559877b7ba9b in execute_show_status(THD*, TABLE_LIST*) /source/sql/sql_parse.cc:6467:10
          #10 0x559877b60ee0 in mysql_execute_command(THD*, bool) /source/sql/sql_parse.cc:3931:5
          #11 0x559877b436d5 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /source/sql/sql_parse.cc:8200:18
          #12 0x559877b3a6a1 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /source/sql/sql_parse.cc:1908:7
          #13 0x559877b45c65 in do_command(THD*, bool) /source/sql/sql_parse.cc:1421:17
          #14 0x5598780db6cc in do_handle_one_connection(CONNECT*, bool) /source/sql/sql_connect.cc:1386:11
          #15 0x5598780daf09 in handle_one_connection /source/sql/sql_connect.cc:1298:5
          #16 0x5598792d9bec in pfs_spawn_thread /source/storage/perfschema/pfs.cc:2201:3
          #17 0x5598776d6f56 in asan_thread_start(void*) asan_interceptors.cpp.o
          #18 0x7f7abc5a21f4  (/lib/x86_64-linux-gnu/libc.so.6+0x891f4) (BuildId: 79005c16293efa45b441fed45f4f29b138557e9e)
          #19 0x7f7abc62289b  (/lib/x86_64-linux-gnu/libc.so.6+0x10989b) (BuildId: 79005c16293efa45b441fed45f4f29b138557e9e)
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.