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

applying zero offset to null pointer in my_coll_init_uca()

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 10.6
    • 10.5, 10.6
    • Character Sets
    • None

    Description

      While testing the fix of MDEV-35723, I found out that when the test innodb.innodb is run on a clang-16 -DWITH_UBSAN=ON executable, there will be two errors inside my_coll_init_uca(), for initializing the tables of my_charset_utf8mb3_unicode_ci:

      10.5 f521b8ac219102332eec99f854809e6331b3dbce

      innodb.innodb                            [ fail ]  Found warnings/errors in server log file!
              Test ended at 2025-01-17 12:15:13
      line
      /mariadb/10.5/sql/sql_statistics.h:479:35: runtime error: -nan is outside the range of representable values of type 'unsigned long long'
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mariadb/10.5/sql/sql_statistics.h:479:35 in 
      /mariadb/10.5/strings/ctype-uca.c:33538:43: runtime error: applying zero offset to null pointer
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mariadb/10.5/strings/ctype-uca.c:33538:43 in 
      /mariadb/10.5/strings/ctype-uca.c:33670:43: runtime error: applying zero offset to null pointer
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mariadb/10.5/strings/ctype-uca.c:33670:43 in 
      

      The first error might share a root cause with MDEV-35721.

      With the following, I got nice stack traces for each of these:

      ./mtr --rr innodb.innodb
      rr replay mysql-test/var/log/mysqld.1.rr/latest-trace
      

      break __ubsan::ScopedReport::~ScopedReport()
      continue
      backtrace
      continue
      backtrace
      continue
      backtrace
      

      Note that GCC -fsanitize=undefined does not flag this class of errors; Clang does.

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              bar Alexander Barkov
              marko Marko Mäkelä
              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.