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

pcre stack frame size check failed on clang 16.0.6

Details

    Description

      as reported in https://bugs.gentoo.org/910188
      for clang v16.0.6, pcretest -m -C will report stack frame size 32 < 256, then cmake/pcre.cmake will fail, earlier version (test by clang 15.0.7) is ok.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            Thanks for the bug report.

            Changed bundled pcre to use noopt instead of noinline.

            https://github.com/MariaDB/server/pull/2700/files

            Also tried without success

            @@ -676,7 +676,7 @@ if (ecode == NULL)
               else
                 {
                 int len = (int)((char *)&rdepth - (char *)eptr);
            -    return (len > 0)? -len : len;
            +    return [[clang::optnone]] (len > 0)? -len : len;
                 }
               }
             #endif     /* NO_RECURSE */
            @@ -6408,7 +6408,7 @@ result still unsigned". Hopefully the cast fixes that. */
             if (re == NULL && extra_data == NULL && subject == NULL && length == -999 &&
                 start_offset == -999)
             #ifdef NO_RECURSE
            -  return -((int)sizeof(heapframe));
            +  return [[clang::optnone]] -((int)sizeof(heapframe));
             #else
               return match(NULL, NULL, NULL, 0, NULL, NULL, 0);
             #endif
            

            danblack Daniel Black added a comment - Thanks for the bug report. Changed bundled pcre to use noopt instead of noinline . https://github.com/MariaDB/server/pull/2700/files Also tried without success @@ -676,7 +676,7 @@ if (ecode == NULL) else { int len = (int)((char *)&rdepth - (char *)eptr); - return (len > 0)? -len : len; + return [[clang::optnone]] (len > 0)? -len : len; } } #endif /* NO_RECURSE */ @@ -6408,7 +6408,7 @@ result still unsigned". Hopefully the cast fixes that. */ if (re == NULL && extra_data == NULL && subject == NULL && length == -999 && start_offset == -999) #ifdef NO_RECURSE - return -((int)sizeof(heapframe)); + return [[clang::optnone]] -((int)sizeof(heapframe)); #else return match(NULL, NULL, NULL, 0, NULL, NULL, 0); #endif
            danblack Daniel Black added a comment -

            Thanks for the bug report.

            Sorry that its a pcre one to fix and might just end up being a distro carried patch.

            Thanks for letting us know so at least we can fall back to a bundled fixed version.

            danblack Daniel Black added a comment - Thanks for the bug report. Sorry that its a pcre one to fix and might just end up being a distro carried patch. Thanks for letting us know so at least we can fall back to a bundled fixed version.
            danblack Daniel Black added a comment -

            liuzx did you have mtr troubles on tests: Failing test(s): main.execution_constants main.sp_notembedded main.sp-error ? There might be other aspects of stack length calculation that need to be fixed for clang

            danblack Daniel Black added a comment - liuzx did you have mtr troubles on tests: Failing test(s): main.execution_constants main.sp_notembedded main.sp-error ? There might be other aspects of stack length calculation that need to be fixed for clang
            liuzx Z. Liu added a comment -

            I did a test and no error or warning found.

            1. ./mysql-test/mtr main.execution_constants
              Logging: /var/tmp/portage/dev-db/mariadb-10.4.30/work/mysql/mysql-test/mysql-test-run.pl main.execution_constants
              VS config:
              vardir: /var/tmp/portage/dev-db/mariadb-10.4.30/work/mysql_build/mysql-test/var
              Checking leftover processes...
              Removing old var directory...
              Creating var directory '/var/tmp/portage/dev-db/mariadb-10.4.30/work/mysql_build/mysql-test/var'...
              Checking supported features...
              MariaDB Version 10.4.30-MariaDB
            • SSL connections supported
            • binaries built with wsrep patch
              Collecting tests...
              Installing system database...

            ==============================================================================

            TEST RESULT TIME (ms) or COMMENT
            --------------------------------------------------------------------------

            worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
            worker[1] mysql-test-run: WARNING: running this script as root will cause some tests to be skipped
            main.execution_constants [ pass ] 197
            --------------------------------------------------------------------------
            The servers were restarted 0 times
            Spent 0.197 of 4 seconds executing testcases

            Completed: All 1 tests were successful.

            liuzx Z. Liu added a comment - I did a test and no error or warning found. ./mysql-test/mtr main.execution_constants Logging: /var/tmp/portage/dev-db/mariadb-10.4.30/work/mysql/mysql-test/mysql-test-run.pl main.execution_constants VS config: vardir: /var/tmp/portage/dev-db/mariadb-10.4.30/work/mysql_build/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/var/tmp/portage/dev-db/mariadb-10.4.30/work/mysql_build/mysql-test/var'... Checking supported features... MariaDB Version 10.4.30-MariaDB SSL connections supported binaries built with wsrep patch Collecting tests... Installing system database... ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker [1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019 worker [1] mysql-test-run: WARNING: running this script as root will cause some tests to be skipped main.execution_constants [ pass ] 197 -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.197 of 4 seconds executing testcases Completed: All 1 tests were successful.
            danblack Daniel Black added a comment -

            thanks for confirming.

            Obviously you're welcome to take my updated pcre patch to Gentoo in any form you choose.

            danblack Daniel Black added a comment - thanks for confirming. Obviously you're welcome to take my updated pcre patch to Gentoo in any form you choose.

            People

              danblack Daniel Black
              liuzx Z. Liu
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.