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

ER_OUTOFMEMORY reports incorrect "Needed %d bytes" on 64-bit systems

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      The error message ER_OUTOFMEMORY is reporting a signed 32-bit integer, while the unsigned size_t would be more appropriate. I originally noticed this when developing MDEV-38671.

      sql/share/errmsg-utf8.txt

      ER_OUTOFMEMORY HY001 S1001
              chi "内存不足; 重启后重试(需要 %d bytes)"
              cze "Málo paměti. Přestartujte daemona a zkuste znovu (je potřeba %d bytů)"
              dan "Ikke mere hukommelse. Genstart serveren og prøv igen (mangler %d bytes)"
              eng "Out of memory; restart server and try again (needed %d bytes)"
      

      These messages have to use the format %zu, and all callers will have to be adjusted if they are currently casting size_t to a narrower type. In this way, the correct amount will be reported on 64-bit systems.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.