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

Assertion `allocated_status_memory != __null' failed in void PROF_MEASUREMENT::set_label(const char*, const char*, const char*, unsigned int)

Details

    Description

      SET @@session.max_error_count=-10;
      SET profiling=1;
      SET SESSION debug_dbug='+d,alloc_sort_buffer_fail';
      SELECT * FROM performance_schema.events_waits_history_long ORDER BY thread_id;
      

      Leads to:

      10.6.0 8dd35a2507f8d63ca8df9335d2c6072d5c0e3b86 (Debug)

      mysqld: /test/10.6_dbg/sql/sql_profile.cc:205: void PROF_MEASUREMENT::set_label(const char*, const char*, const char*, unsigned int): Assertion `allocated_status_memory != __null' failed.
      

      10.6.0 8dd35a2507f8d63ca8df9335d2c6072d5c0e3b86 (Debug)

      Core was generated by `/test/MD160321-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x14aa456e5700 (LWP 2207203))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055e022fedd0b in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
      #2  0x000055e022785313 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:331
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014aa5c577859 in __GI_abort () at abort.c:79
      #6  0x000014aa5c577729 in __assert_fail_base (fmt=0x14aa5c70d588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55e02318dfc8 "allocated_status_memory != __null", file=0x55e02318df48 "/test/10.6_dbg/sql/sql_profile.cc", line=205, function=<optimized out>) at assert.c:92
      #7  0x000014aa5c588f36 in __GI___assert_fail (assertion=assertion@entry=0x55e02318dfc8 "allocated_status_memory != __null", file=file@entry=0x55e02318df48 "/test/10.6_dbg/sql/sql_profile.cc", line=line@entry=205, function=function@entry=0x55e02318df70 "void PROF_MEASUREMENT::set_label(const char*, const char*, const char*, unsigned int)") at assert.c:101
      #8  0x000055e022622265 in PROF_MEASUREMENT::set_label (this=this@entry=0x14aa0c031c90, status_arg=<optimized out>, status_arg@entry=0x55e0231328e8 "End of update loop", function_arg=<optimized out>, function_arg@entry=0x55e02313154c "<unknown>", file_arg=<optimized out>, file_arg@entry=0x55e02316a053 "sql_select.cc", line_arg=line_arg@entry=4751) at /test/10.6_dbg/sql/sql_profile.cc:205
      #9  0x000055e02262234c in PROF_MEASUREMENT::PROF_MEASUREMENT (this=0x14aa0c031c90, profile_arg=<optimized out>, status_arg=0x55e0231328e8 "End of update loop", function_arg=0x55e02313154c "<unknown>", file_arg=0x55e02316a053 "sql_select.cc", line_arg=4751) at /test/10.6_dbg/sql/sql_profile.cc:179
      #10 0x000055e0226226a1 in QUERY_PROFILE::new_status (this=0x14aa0c01cc70, status_arg=0x55e0231328e8 "End of update loop", function_arg=function_arg@entry=0x55e02313154c "<unknown>", file_arg=file_arg@entry=0x55e02316a040 "/test/10.6_dbg/sql/sql_select.cc", line_arg=line_arg@entry=4751) at /test/10.6_dbg/sql/sql_profile.cc:304
      #11 0x000055e02254673e in PROFILING::status_change (line_arg=4751, file_arg=0x55e02316a040 "/test/10.6_dbg/sql/sql_select.cc", function_arg=0x55e02313154c "<unknown>", status_arg=<optimized out>, this=0x14aa0c004870) at /test/10.6_dbg/sql/sql_profile.h:317
      #12 THD::enter_stage (calling_line=4751, calling_file=0x55e02316a040 "/test/10.6_dbg/sql/sql_select.cc", calling_func=0x55e02313154c "<unknown>", stage=<optimized out>, this=0x14aa0c000db8) at /test/10.6_dbg/sql/sql_class.h:2689
      #13 mysql_select (thd=thd@entry=0x14aa0c000db8, tables=0x14aa0c0142f0, fields=@0x14aa0c013de8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14aa0c014260, last = 0x14aa0c02e000, elements = 19}, <No data fields>}, conds=0x0, og_num=1, order=0x14aa0c015348, group=0x0, having=0x0, proc_param=0x0, select_options=10737683200, result=0x14aa0c018d38, unit=0x14aa0c004f90, select_lex=0x14aa0c013c98) at /test/10.6_dbg/sql/sql_select.cc:4751
      #14 0x000055e0225468df in handle_select (thd=thd@entry=0x14aa0c000db8, lex=lex@entry=0x14aa0c004ec8, result=result@entry=0x14aa0c018d38, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417
      #15 0x000055e0224bb434 in execute_sqlcom_select (thd=thd@entry=0x14aa0c000db8, all_tables=0x14aa0c0142f0) at /test/10.6_dbg/sql/sql_parse.cc:6230
      #16 0x000055e0224c8046 in mysql_execute_command (thd=thd@entry=0x14aa0c000db8) at /test/10.6_dbg/sql/sql_parse.cc:3926
      #17 0x000055e0224b4876 in mysql_parse (thd=thd@entry=0x14aa0c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14aa456e4410) at /test/10.6_dbg/sql/sql_parse.cc:7998
      #18 0x000055e0224c31e7 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14aa0c000db8, packet=packet@entry=0x14aa0c00b359 "", packet_length=packet_length@entry=77, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1318
      #19 0x000055e0224c65c1 in do_command (thd=0x14aa0c000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1397
      #20 0x000055e02261e178 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55e0267d2768, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
      #21 0x000055e02261e77d in handle_one_connection (arg=arg@entry=0x55e0267d2768) at /test/10.6_dbg/sql/sql_connect.cc:1312
      #22 0x000055e022ac9a5b in pfs_spawn_thread (arg=0x55e0266f6ee8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #23 0x000014aa5ca85609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #24 0x000014aa5c674293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.38 (dbg), 10.3.29 (dbg), 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.38 (opt), 10.3.29 (opt), 10.4.19 (opt), 10.5.10 (opt), 10.6.0 (opt)

      Attachments

        Activity

          ramesh Ramesh Sivaraman created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Workflow MariaDB v3 [ 120707 ] MariaDB v4 [ 142746 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Fix Version/s 10.2 [ 14601 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.3 [ 22126 ]

          commit 27c26be104538597d718dba2c03e4862ae734bfb (HEAD -> bb-10.4-MDEV-29180)
          Author: Oleksandr Byelkin <sanja@mariadb.com>
          Date:   Wed Sep 27 13:55:39 2023 +0200
           
              MDEV-25329: Assertion `allocated_status_memory != __null' failed in void PROF_MEASUREMENT::set_label(const char*, const char*, const char*, unsigned int)
              
              Make profiler to play a bit better with memory allocators. Test suite can not be included because it lead to non free memory on shutdown (IMHO OK for memory shortage emulation)
              
              As alternetive all this should be rewritten and ability to return errors on upper level should be added.
          
          

          sanja Oleksandr Byelkin added a comment - commit 27c26be104538597d718dba2c03e4862ae734bfb (HEAD -> bb-10.4-MDEV-29180) Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Wed Sep 27 13:55:39 2023 +0200   MDEV-25329: Assertion `allocated_status_memory != __null' failed in void PROF_MEASUREMENT::set_label(const char*, const char*, const char*, unsigned int) Make profiler to play a bit better with memory allocators. Test suite can not be included because it lead to non free memory on shutdown (IMHO OK for memory shortage emulation) As alternetive all this should be rewritten and ability to return errors on upper level should be added.
          sanja Oleksandr Byelkin made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          sanja Oleksandr Byelkin made changes -
          Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
          Status In Progress [ 3 ] In Review [ 10002 ]

          27c26be1045 is ok to push

          serg Sergei Golubchik added a comment - 27c26be1045 is ok to push
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          sanja Oleksandr Byelkin made changes -
          Component/s OTHER [ 10125 ]
          Fix Version/s 10.4.33 [ 29516 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          JIraAutomate JiraAutomate made changes -
          Fix Version/s 10.5.24 [ 29517 ]
          Fix Version/s 10.6.17 [ 29518 ]
          Fix Version/s 10.11.7 [ 29519 ]
          Fix Version/s 11.0.5 [ 29520 ]
          Fix Version/s 11.1.4 [ 29024 ]
          Fix Version/s 11.2.3 [ 29521 ]

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.