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

Linux - use O_TMPFILE for create_temp_file

Details

    Description

      This pr, branched from #639, uses the Linux the open(2) O_TMPFILE option to create an already delete temporary.

      With this option we don't need to delete the created file and for convenience we don't use my_register_filename to allocate string copies of names (as an aside - is this really still needed in the code? Seems only there for debugging).

      As such we don't need to dup in innobase_mysql_tmpfile.

      Like the my_register_filename, we do increase statistic counters like #657.

      If the open(O_TMPFILE) fails, unsupported filesystem for instance, fall back to mk{,o}stemp

      Attachments

        Issue Links

          Activity

            This contribution causes open(2) to be invoked with a potentially NULL first argument. Because the system call wrapper function is declared with nonnull first argument, this allows GCC 8 to assume that the parameter dir is actually nonnull, and to optimize away some necessary code in a later code path.

            Similar to MDEV-15587, the fix is to ensure that functions declared with nonnull are not being called with NULL parameters.

            This bug caused a crash in mysqlbinlog, which was invoking create_temp_file() with the argument dir=NULL. The affected test was binlog.binlog_mysqlbinlog_base64. It would display the following message before crashing:

            mariadb-10.4.4

            mysqlbinlog: O_TMPFILE is not supported on (null) (disabling future attempts)
            Segmentation fault
            

            marko Marko Mäkelä added a comment - This contribution causes open(2) to be invoked with a potentially NULL first argument. Because the system call wrapper function is declared with nonnull first argument, this allows GCC 8 to assume that the parameter dir is actually nonnull , and to optimize away some necessary code in a later code path. Similar to MDEV-15587 , the fix is to ensure that functions declared with nonnull are not being called with NULL parameters. This bug caused a crash in mysqlbinlog, which was invoking create_temp_file() with the argument dir=NULL . The affected test was binlog.binlog_mysqlbinlog_base64 . It would display the following message before crashing: mariadb-10.4.4 mysqlbinlog: O_TMPFILE is not supported on (null) (disabling future attempts) Segmentation fault

            I pushed a fix of the regression to 10.4. It will be in MariaDB 10.4.5.

            marko Marko Mäkelä added a comment - I pushed a fix of the regression to 10.4. It will be in MariaDB 10.4.5.

            People

              serg Sergei Golubchik
              svoj Sergey Vojtovich
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.