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

AddressSanitizer running out of memory regardless of stack_thread size

Details

    Description

      Regardless of how large we set the thread_stack variable ASAN seems to complain about running out of memory at the same point for numerous tests in the main suite. This was found on 10.5 using clang16 with -DWITH_ASAN=YES. The error messages suggest that this seem to be related to the test runner itself as opposed to the actual engine. This does not occur when compiling in debug mode.

      Example output for stack_thread=50M and stack_thread=30M

      CURRENT_TEST: main.type_timestamp_hires12910Could not execute 'check-testcase' before testcase 'main.type_timestamp_hires' (res: 1):12911mysqltest: Logging to '/usr/share/mysql-test/var/2/tmp/check-mysqld_1.log'.12912mysqltest: Results saved in '/usr/share/mysql-test/var/2/tmp/check-mysqld_1.result'.12913mysqltest: Connecting to server localhost:16000 (socket /usr/share/mysql-test/var/tmp/2/mysqld.1.sock) as 'root', connection 'default', attempt 0 ...12914mysqltest: ... Connected.12915mysqltest: Start processing test commands from './include/check-testcase.test' ...12916mysqltest: At line 19: query 'let $tmp= `SELECT '$tmp' = 'No such row'`' failed: 1436: Thread stack overrun:  63936096 bytes used of a 52428800 byte stack, and 32000 bytes needed. Consider increasing the thread_stack system variable
       
      CURRENT_TEST: main.type_timestamp_hires12878Could not execute 'check-testcase' before testcase 'main.type_timestamp_hires' (res: 1):12879mysqltest: Logging to '/usr/share/mysql-test/var/6/tmp/check-mysqld_1.log'.12880mysqltest: Results saved in '/usr/share/mysql-test/var/6/tmp/check-mysqld_1.result'.12881mysqltest: Connecting to server localhost:16060 (socket /usr/share/mysql-test/var/tmp/6/mysqld.1.sock) as 'root', connection 'default', attempt 0 ...12882mysqltest: ... Connected.12883mysqltest: Start processing test commands from './include/check-testcase.test' ...12884mysqltest: At line 19: query 'let $tmp= `SELECT '$tmp' = 'No such row'`' failed: 1436: Thread stack overrun:  42964576 bytes used of a 31457280 byte stack, and 32000 bytes needed. Consider increasing the thread_stack system variable.
      

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            MDEV-31605 highlights lack of assumptions that can be made.

            danblack Daniel Black added a comment - MDEV-31605 highlights lack of assumptions that can be made.
            danblack Daniel Black added a comment -

            sanja, can I get a review on https://github.com/MariaDB/server/pull/3387 please.

            It was apparently your idea to just return 0 here.

            I tested with this on clang-18 WITH_ASAN on both 10.5 and 10.11 branch which passed the perfschema tests (including --big-test), where previously there was failures.

            danblack Daniel Black added a comment - sanja , can I get a review on https://github.com/MariaDB/server/pull/3387 please. It was apparently your idea to just return 0 here. I tested with this on clang-18 WITH_ASAN on both 10.5 and 10.11 branch which passed the perfschema tests (including --big-test), where previously there was failures.

            I belive there are tests which check stack overflow, so switching off this for debug build should have influence on the tests, I do not see. Was all tests really run ?

            sanja Oleksandr Byelkin added a comment - I belive there are tests which check stack overflow, so switching off this for debug build should have influence on the tests, I do not see. Was all tests really run ?

            It looks like the tests switched off when _SANITIZE_ADDRESS_ (checking it)

            sanja Oleksandr Byelkin added a comment - It looks like the tests switched off when _ SANITIZE_ADDRESS _ (checking it)

            OK to push

            sanja Oleksandr Byelkin added a comment - OK to push
            danblack Daniel Black added a comment - Thanks anson , sanja , TheLinuxJedi

            People

              danblack Daniel Black
              anson Anson
              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.