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

MTR prints detailed stack trace unconditionally, etc

    XMLWordPrintable

Details

    Description

      66832e3a introduced change that prints core dumps like this:

      #16 0x000055b86613e3d8 in do_handle_one_connection (connect=0x55b8699061f8, put_in_cache=true) at /home/midenok/src/mariadb/10.6/src/sql/sql_connect.cc:1418
              create_user = true
              thr_create_utime = 140576815727
              thd = 0x7f11c4000d58
      #17 0x000055b86613e03a in handle_one_connection (arg=0x55b8699f84a8) at /home/midenok/src/mariadb/10.6/src/sql/sql_connect.cc:1312
              connect = 0x55b8699f84a8
      #18 0x000055b8666b0a2f in pfs_spawn_thread (arg=0x55b86997b1d8) at /home/midenok/src/mariadb/10.6/src/storage/perfschema/pfs.cc:2201
              typed_arg = 0x55b86997b1d8
              user_arg = 0x55b8699f84a8
              user_start_routine = 0x55b86613dfe0 <handle_one_connection(void*)>
              pfs = 0x7f1203ebf7c0
              klass = 0x55b8691b5c80
      #19 0x00007f120461fb43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
              ret = <optimized out>
              pd = <optimized out>
              out = <optimized out>
              unwind_buf = {
                cancel_jmp_buf = {{
                    jmp_buf = {140727175011760, -485359056267303735, 139715155310144, 2, 139715359668304, 140727175012112, 531522500273317065, 533571283848864969},
                    mask_was_saved = 0
                  }},
                priv = {
                  pad = {0x0, 0x0, 0x0, 0x0},
                  data = {
                    prev = 0x0,
                    cleanup = 0x0,
                    canceltype = 0
                  }
                }
              }
              not_first_call = <optimized out>
      

      That's completely out of user-friendliness but serves as a measure for debugging hard-reproducible bugs. The proper way to implement this:

      1. it must be controlled by command-line and environment variable;
      2. detailed traces must be default for buildbots only, for user invocations normal stack traces should be printed.

      Options for control

      MTR_PRINT_CORE and --print-core can accept the following values:

      no Don't print core
      short Print normal trace like `bt` does
      detailed Print detailed stack trace like in commit 66832e3a
      custom:<code> Use GDB commands <code> to print stack trace
      Default behaviour

      Should be detected by environment. If BUILDMASTER environment is non-null, defaults to "detailed", otherwise "short".

      Environment

      MTR_PRINT_CORE=no|short|detailed|custom:code
      

      Wrong values are silently ignored (falls back to default behaviour).
      Overrides default behavior.

      Command-line

      --print-core{=no|short|detailed|custom:code}
      

      When specified without value defaults to "short". Wrong values fail execution with error.
      Overrides environment variable.

      Attachments

        1. print_env.test
          0.0 kB
        2. old_buildbot_env.txt
          14 kB
        3. new_buildbot_env.txt
          13 kB

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              midenok Aleksey Midenkov
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.