[SERVER-9047] warning: failed to read from /proc/self/numa_maps: errno:2 No such file or directory Created: 21/Mar/13  Updated: 11/Jul/16  Resolved: 29/Mar/13

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: 2.4.0
Fix Version/s: 2.4.2, 2.5.0

Type: Bug Priority: Minor - P4
Reporter: stronglee Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 2.6.38-2-amd64


Issue Links:
Duplicate
is duplicated by SERVER-9177 "warning: failed to read from /proc/s... Closed
Backwards Compatibility: Fully Compatible
Operating System: Linux
Steps To Reproduce:

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

Participants:

 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.



 Comments   
Comment by auto [ 29/Mar/13 ]

Author:

{u'date': u'2013-03-29T18:14:36Z', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-9047 Don't limit line length when reading numa_maps
Branch: v2.4
https://github.com/mongodb/mongo/commit/85fc27444fa888d30cba56b31b6dfec8072a9116

Comment by auto [ 29/Mar/13 ]

Author:

{u'date': u'2013-03-29T18:14:36Z', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-9047 Don't limit line length when reading numa_maps
Branch: master
https://github.com/mongodb/mongo/commit/26867fd66d6174beca2155ae2fb2c63d7a658ed7

Comment by Tad Marshall [ 21/Mar/13 ]

Thanks.

Your result is similar to what I see in Ubuntu 12.04, and the major variable is going to be the path to the executable, which could be pretty much anything. We should probably have a buffer size more like 1 KB or 10 KB to be safer ... 100 bytes is pretty small.

Comment by stronglee [ 21/Mar/13 ]

Oh, I am sorry.
Our system administrator installed mongodb cluster by their own distribute tools, so the mongodb binaries located in none standard directory.

Comment by stronglee [ 21/Mar/13 ]

Hi,

I am running mongodb2.4 release, which was installed using apt-get in Debian6.0.

cat /proc/15902/numa_maps

00400000 interleave:0-1 file=/usr/local/mongodb-linux-x86_64-2.4.0/bin/mongod mapped=2466 active=1853 N0=2466
016dd000 interleave:0-1 file=/usr/local/mongodb-linux-x86_64-2.4.0/bin/mongod anon=64 dirty=64 mapped=77 active=72 N0=44 N1=33
...
...

The first line contains 109 characters long...

Comment by Tad Marshall [ 21/Mar/13 ]

Thanks for the report and diagnosis!

What distro are you running? What hardware or virtualized environment is mongod running on?

Can you post the results from 'cat /proc/<pid>/numa_maps' for the mongod process?

Generated at Thu Feb 08 03:19:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.