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

fflush(stderr) call improvement in signal_handler.cc

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
    • N/A
    • Server
    • None

    Description

      In https://github.com/MariaDB/server/blob/10.6/sql/signal_handler.cc, the following flush happens in one case:

      #else
        char buff[80];
        my_getwd(buff, sizeof(buff), 0);
        my_safe_printf_stderr("Writing a core file at %s\n", buff);
        fflush(stderr);                                                                          <<<<<<<<<<<<<<<<<<
      #endif
      

      Yet, there are three other parts just above it that also write to stderr in similar ways, and that do not flush stderr.

      Suggested fix; either add fflush(stderr); to the other three parts above it too, or move the fflush(stderr); to just outside the #endif so it may always be called irrespective (best solution imho; less code duplication and future proof)

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.