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

Debugging help: print which MEM_ROOT the object is on

    XMLWordPrintable

Details

    • Q1/2026 Server Development

    Description

      This is a debugging help function that was developed when reviewing fix for MDEV-35815.

      Developers agreed that it's generally useful.

      Targeting 10.6 as we are still debugging there, too, and this will have no impact on release builds.

      Example of usage:
      Where is "pos" located:

      (gdb) p pos
      $67 = (Item_direct_view_ref *) 0x7fff58b66a30
       
      (gdb) p dbug_which_mem_root(thd, pos)
      $68 = 0x55555703a912 "thd->stmt_arena->mem_root"
      

      Ok, it is statement-lifetime mem_root.

      What about pos->name? Where was it allocated?

      (gdb) p pos->name.str
      $69 = 0x7fff58017f10 "fld"
       
      (gdb) p dbug_which_mem_root(thd, pos->name.str)
      $70 = 0x55555703a904 "thd->mem_root"
      

      On a transient mem_root. This was the bug in MDEV-35815 .

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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