Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9047

warning: failed to read from /proc/self/numa_maps: errno:2 No such file or directory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.2, 2.5.0
    • Component/s: Logging
    • Labels:
      None
    • Environment:
      Linux 2.6.38-2-amd64
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      Linux
    • Steps To Reproduce:
      Hide

      Change line[100] to line[20] and you will see this warnning message on any machine.

      Show
      Change line [100] to line [20] and you will see this warnning message on any machine.

      Description

      The 100 character buffer used to read /proc/self/numa_maps at startup will be too small when MongoDB has been unpacked into, for example, /usr/local/mongodb-linux-x86_64-2.4.0/bin/.

      The buffer size should be increased, perhaps to 1024 characters or more.

      See src/mongo/db/db.cpp line 230 in today's master branch.

      Original report:

      When starts mongod, it writes this warning message to the log.
      Actually, /proc/self/numa_maps is existed.

      Please look at the source code:

      char line[100]; //we only need the first line
      f.getline(line, sizeof(line));
      if (f.fail()) {
        warning() << "failed to read from /proc/self/numa_maps: "
            << errnoWithDescription() << startupWarningsLog;
        warned = true;
      }

      It's just because the first line of my system in /proc/self/numa_maps is longer than 100 chars. When the line is larger than the buffer, the f's failbit will be set after getline() without setting the errno, so errnoWithDescription() displays last errno message.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: