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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.4.2, 2.5.0
    • Affects Version/s: 2.4.0
    • Component/s: Logging
    • Labels:
      None
    • Environment:
      Linux 2.6.38-2-amd64
    • Fully Compatible
    • Linux
    • 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.

      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.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            strlee stronglee
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: