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

addr2line can't find debug info files on some platforms

    XMLWordPrintable

Details

    Description

      addr2line can't find debug info files on some platforms, what causes unreadable backtraces in error log file.

      The paths to search debug info files are hardcoded in find_separate_debug_file() function in bfd/opncls.c file in binutils source tree.

      The function is different for different binutils versions, but our debug info path in packages differs from the path where some adrr2line versions searches them. Besides, folder structure can be different. Our packages debug info folder contains subfolders, but some addr2line versions does not support subfolders.

      We could, of course, inspect all versions of bunutils used on supported platforms, check find_separate_debug_file() for each version, and generate correct paths in our packages for the certain platforms. Or maybe use default cpack versions to build packages, maybe they contain code place debug info files in correct location for the certain platform.

      I think this kind of painful work. As an alternative of addr2line we could use libbacktrace, libunwind, Boost.Stacktrace or libelf (MDEV-29568).

      Or we could use our own version of add2line with predictable search paths.

      The workaround is to build packages with embedded debug info instead of stripping binaries and building separate debug info packages. It can be done with:

      SET(CMAKE_BUILD_TYPE RelWithDebInfo)
      OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" OFF)
      

      code in the corresponding cmake/build_configurations/*.cmake config files.

      Attachments

        Issue Links

          Activity

            People

              Johnston Rex Johnston
              vlad.lesin Vladislav Lesin
              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.