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

Type mismatch for srv_fatal_semaphore_wait_threshold

    XMLWordPrintable

    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 Vladislav Vaintroub by compiling 10.3 cmake -DWITH_ASAN and running tests on Windows.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration