Uploaded image for project: 'MariaDB Foundation Development'
  1. MariaDB Foundation Development
  2. MDBF-741

Remove the gcc UBSAN builder to use the clang based UBSAN

Details

    • Sprint 6 (24.03.2025), Sprint 7 (07.04.2025)

    Description

      Evidently, that the clang UBSAN is significantly more capable than the gcc based UBSAN.

      There are some significant amount of UBSAN errors that will occur in even the most basic of MTR tests.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            working on getting server clean:

            so far mroonga upstream https://github.com/mroonga/mroonga/pull/902
            our UDF functions - https://github.com/MariaDB/server/pull/3906
            MDEV-36347 in review
            MDEV-35715 masked https://github.com/mariadb-corporation/mariadb-qa/blob/master/UBSAN.filter#L30
            MDEV-36341 federatedx still to fix:

            WIP - probably temp structure insufficiently populated.

            federated.federated_transactions 'X'     [ pass ]    159
            ***Warnings generated in error logs during shutdown after running tests: federated.federated_transactions
             
            /source/storage/federatedx/ha_federatedx.cc:1514:17: runtime error: applying non-zero offset 138217089612088 to null pointer
            SUMMARY: UndefinedBehaviorSanitizer: nullptr-with-nonzero-offset /source/storage/federatedx/ha_federatedx.cc:1514:17 
             
               mysql-test/mtr --manual-gdb='b fill_server;b  __ubsan::ScopedReport::~ScopedReport; r'  --mem federated.federated_transactions
            
            

            Test:

            diff --git a/include/my_global.h b/include/my_global.h
            index fd774bdac1f..ebef24cf1f0 100644
            --- a/include/my_global.h
            +++ b/include/my_global.h
            @@ -440,10 +440,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
             /*
                Suppress uninitialized variable warning without generating code.
             */
            -#if defined(__GNUC__)
            -/* GCC specific self-initialization which inhibits the warning. */
            -#define UNINIT_VAR(x) x= x
            -#elif defined(_lint) || defined(FORCE_INIT_OF_VARS)
            +#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
             #define UNINIT_VAR(x) x= 0
            

            its a hack. There was a USan abouve a UNINIT var of bool that was being assigned a 0/1 value. Will find again.

            danblack Daniel Black added a comment - working on getting server clean: so far mroonga upstream https://github.com/mroonga/mroonga/pull/902 our UDF functions - https://github.com/MariaDB/server/pull/3906 MDEV-36347 in review MDEV-35715 masked https://github.com/mariadb-corporation/mariadb-qa/blob/master/UBSAN.filter#L30 MDEV-36341 federatedx still to fix: WIP - probably temp structure insufficiently populated. federated.federated_transactions 'X' [ pass ] 159 ***Warnings generated in error logs during shutdown after running tests: federated.federated_transactions   /source/storage/federatedx/ha_federatedx.cc:1514:17: runtime error: applying non-zero offset 138217089612088 to null pointer SUMMARY: UndefinedBehaviorSanitizer: nullptr-with-nonzero-offset /source/storage/federatedx/ha_federatedx.cc:1514:17   mysql-test/mtr --manual-gdb='b fill_server;b __ubsan::ScopedReport::~ScopedReport; r' --mem federated.federated_transactions Test: diff --git a/include/my_global.h b/include/my_global.h index fd774bdac1f..ebef24cf1f0 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -440,10 +440,7 @@ extern "C" int madvise(void *addr, size_t len, int behav); /* Suppress uninitialized variable warning without generating code. */ -#if defined(__GNUC__) -/* GCC specific self-initialization which inhibits the warning. */ -#define UNINIT_VAR(x) x= x -#elif defined(_lint) || defined(FORCE_INIT_OF_VARS) +#if defined(_lint) || defined(FORCE_INIT_OF_VARS) #define UNINIT_VAR(x) x= 0 its a hack. There was a USan abouve a UNINIT var of bool that was being assigned a 0/1 value. Will find again.
            danblack Daniel Black added a comment -

            auth_v0100 federated and mroonga fixes - https://github.com/MariaDB/server/pull/3932 -

            MDEV-36337 udf - runtime error: call to function (udf_example) netaphon through pointer to incorrect function type #3906 - in review

            my_global.h still todo

            danblack Daniel Black added a comment - auth_v0100 federated and mroonga fixes - https://github.com/MariaDB/server/pull/3932 - MDEV-36337 udf - runtime error: call to function (udf_example) netaphon through pointer to incorrect function type #3906 - in review my_global.h still todo
            danblack Daniel Black added a comment -

            BB configuration done - https://github.com/MariaDB/buildbot/pull/732 for review.

            Rest is resolving some server faults and masking the others until a fix can be made.

            danblack Daniel Black added a comment - BB configuration done - https://github.com/MariaDB/buildbot/pull/732 for review. Rest is resolving some server faults and masking the others until a fix can be made.
            danblack Daniel Black added a comment -

            I don't think anything infra is related as I think containers have limited stack size - ulimit -s to be sure.

            Just the config above and the UBSAN fixes to be done are being worked though.

            Marking observed failures in Relates to issues;

            danblack Daniel Black added a comment - I don't think anything infra is related as I think containers have limited stack size - ulimit -s to be sure. Just the config above and the UBSAN fixes to be done are being worked though. Marking observed failures in Relates to issues;
            danblack Daniel Black added a comment -

            resolve MDEV-35738 and there's no need for an ASAN filter exclusion.

            danblack Daniel Black added a comment - resolve MDEV-35738 and there's no need for an ASAN filter exclusion.

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 5d Original Estimate - 5d
                  5d
                  Remaining:
                  Time Spent - 4d 3h Remaining Estimate - 7h
                  7h
                  Logged:
                  Time Spent - 4d 3h Remaining Estimate - 7h
                  4d 3h