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

Type mismatch for srv_fatal_semaphore_wait_threshold

Details

    Description

      MDEV-7108 changed the type of the variable srv_fatal_semaphore_wait_threshold from ulint to ulong but failed to adjust the assignments accordingly.
      In MariaDB 10.2, some wrong code reads like this:

      			my_atomic_addlint(
      				&srv_fatal_semaphore_wait_threshold,
      				SRV_SEMAPHORE_WAIT_EXTENSION);
      

      In MariaDB 10.1, it reads like this:

      			os_increment_counter_by_amount(
      				server_mutex,
                                      srv_fatal_semaphore_wait_threshold,
      				SRV_SEMAPHORE_WAIT_EXTENSION);
      

      Both of these forms expect the data type to be ulint.

      As far as I understand, on most platforms sizeof(ulong)==sizeof(ulint) would hold. Most notably, the sizes are different on 64-bit WIndows (4 and 8 bytes).

      The problem was found by wlad by compiling 10.3 cmake -DWITH_ASAN and running tests on Windows.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            wlad Vladislav Vaintroub made changes -
            Assignee Jan Lindström [ jplindst ] Vladislav Vaintroub [ wlad ]

            thiru, please fix this in 10.1. Maybe we can simply make the variable uint and adjust the primitives accordingly.

            marko Marko Mäkelä added a comment - thiru , please fix this in 10.1. Maybe we can simply make the variable uint and adjust the primitives accordingly.
            marko Marko Mäkelä made changes -
            Assignee Vladislav Vaintroub [ wlad ] Thirunarayanan B [ thiru ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]

            It looks like the type mismatch was addressed in MDEV-17441 (removing the atomic operations in question, and introducing Atomic_counter<uint32_t> btr_validate_index_running.

            marko Marko Mäkelä added a comment - It looks like the type mismatch was addressed in MDEV-17441 (removing the atomic operations in question, and introducing Atomic_counter<uint32_t> btr_validate_index_running .
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2020-04-16 13:17:02.0 2020-04-16 13:17:02.676
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5.0 [ 23709 ]
            Fix Version/s 10.4.2 [ 23229 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.1 [ 16100 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Assignee Thirunarayanan Balathandayuthapani [ thiru ] Marko Mäkelä [ marko ]
            Resolution Fixed [ 1 ]
            Status Confirmed [ 10101 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 85554 ] MariaDB v4 [ 153785 ]

            People

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