0

I am trying to debug what is going on on an ubuntu server. I tried to use my good old friend smem but it does not display anything, even if run as root. strace shows the culprit:

open("/proc/32376/smaps", O_RDONLY)     = -1 ENOENT (No such file or directory)

I started to scream and kick. Hopefully, the server is not located in my office or it would have suffered some serious damage.

Maybe someone knows why the smaps files do not exist on this box ? (I am running a 2.6.38 kernel on a 64bit box so, it should be here, really)

Mathieu

5
  • Obvious check: is the process ID correct? – Hennes Feb 13 '13 at 16:19
  • Yes, could it be that PID 32376 is gone in the meantime? – ott-- Feb 13 '13 at 16:25
  • yes, the pid is correct: this was one of the very many errors I got with strace and I checked that cat /proc/self/smaps fails too. – mathieu Feb 13 '13 at 16:33
  • Please identify the specific distribution of Ubuntu. No issue but I am using a 3.2.0 kernel. Are you sure it is present in the 2.6.x kernels? – mdpc Feb 13 '13 at 17:42
  • You might try moving this question to the Ubuntu group. – mdpc Feb 13 '13 at 17:43
0

From the proc(5) manpage:

This file is only present if the CONFIG_MMU kernel configuration option is enabled.

Check the kernel configuration to see if this option is enabled (look for a config- file in /boot/ or for /proc/config.gz):

% grep CONFIG_MMU /boot/config-$(uname -r)\
CONFIG_MMU=y
CONFIG_MMU_NOTIFIER=y
2
  • I have CONFIG_MMU=y (zgrep CONFIG_MMU /proc/config.gz) but still getting the same error - find /proc -name smaps finds nothing, and smem shows no output. Additional ideas? – grebneke Feb 5 '14 at 15:46
  • 1
    Answering my own question for future readers: My kernel uses grsecurity patches. Grsecurity disables /proc/<pid>/smaps for security reasons. – grebneke Feb 5 '14 at 18:49
-2

Should enable kernel config:

CONFIG_PROC_PAGE_MONITOR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.