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

Table number > MAX_TABLES causes overflow of table_map at main.join test

Details

    Description

      Caught by UBSAN:

      /home/buildbot/buildbot/build/mariadb-10.5.28/sql/sql_base.h:357:29: runtime error: shift exponent 64 is too large for 64-bit type 'long long unsigned int'
      

      This happens inside setup_table_map() when tablenr==64 while table->map is a 64-bit integer, so there's an overflow.

      Needs to figure out why there's no error generated when tablenr==MAX_TABLES and optionally add DBUG_ASSERT(tablenr < MAX_TABLES) to setup_table_map() to be able to catch such situations without running UBSAN.

      Attachments

        Issue Links

          Activity

            oleg.smirnov Oleg Smirnov created issue -
            oleg.smirnov Oleg Smirnov made changes -
            Field Original Value New Value
            Summary Table number > 64 causes overflow of table_map at main.join test Table number >= MAX_TABLES causes overflow of table_map at main.join test
            oleg.smirnov Oleg Smirnov made changes -
            oleg.smirnov Oleg Smirnov made changes -
            Fix Version/s 10.5 [ 23123 ]
            oleg.smirnov Oleg Smirnov made changes -
            Labels regression
            oleg.smirnov Oleg Smirnov made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            oleg.smirnov Oleg Smirnov made changes -
            Description Caught by UBSAN:
            {code}
            /home/buildbot/buildbot/build/mariadb-10.5.28/sql/sql_base.h:357:29: runtime error: shift exponent 64 is too large for 64-bit type 'long long unsigned int'
            {code}

            This happens inside setup_table_map() when tablenr==64 (MAX_TABLES) while table->map is a 64-bit integer, so there's an overflow.

            Needs to figure out why there's no error generated when tablenr==MAX_TABLES and optionally add DBUG_ASSERT(tablenr < MAX_TABLES) to setup_table_map() to be able to catch such situations without running UBSAN.
            Caught by UBSAN:
            {code}
            /home/buildbot/buildbot/build/mariadb-10.5.28/sql/sql_base.h:357:29: runtime error: shift exponent 64 is too large for 64-bit type 'long long unsigned int'
            {code}

            This happens inside setup_table_map() when tablenr==64 while table->map is a 64-bit integer, so there's an overflow.

            Needs to figure out why there's no error generated when tablenr==MAX_TABLES and optionally add DBUG_ASSERT(tablenr < MAX_TABLES) to setup_table_map() to be able to catch such situations without running UBSAN.
            oleg.smirnov Oleg Smirnov made changes -
            Summary Table number >= MAX_TABLES causes overflow of table_map at main.join test Table number > MAX_TABLES causes overflow of table_map at main.join test
            oleg.smirnov Oleg Smirnov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            oleg.smirnov Oleg Smirnov added a comment -

            sanja, please review the fix bb-10.5-MDEV-35680.

            oleg.smirnov Oleg Smirnov added a comment - sanja , please review the fix bb-10.5- MDEV-35680 .
            oleg.smirnov Oleg Smirnov made changes -
            Assignee Oleg Smirnov [ JIRAUSER50405 ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            OK to push

            sanja Oleksandr Byelkin added a comment - OK to push
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Oleg Smirnov [ JIRAUSER50405 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            oleg.smirnov Oleg Smirnov added a comment -

            Pushed to 10.5

            oleg.smirnov Oleg Smirnov added a comment - Pushed to 10.5
            oleg.smirnov Oleg Smirnov made changes -
            Component/s Server [ 13907 ]
            Fix Version/s 10.5.28 [ 29952 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.6.21 [ 29953 ]
            Fix Version/s 10.11.11 [ 29954 ]
            Fix Version/s 11.4.5 [ 29956 ]
            Fix Version/s 11.7.2 [ 29914 ]

            People

              oleg.smirnov Oleg Smirnov
              oleg.smirnov Oleg Smirnov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.