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

fflush(stderr) call improvement in signal_handler.cc

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
    • Fix Version/s: 10.3, 10.4, 10.5, 10.6
    • Component/s: None
    • Labels:
      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

              Assignee:
              Unassigned Unassigned
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.