2012-12-13 16 views

Antwort

10

Es ist, weil jstack -F verwendet das ptrace(2) Systemaufruf, um zu versuchen und die JVM auf Daten zugreifen, die, wenn Sie die Rechte nicht haben versagt:

$ strace -e all -f jstack -F 26846 
... 
[pid 27653] ptrace(PTRACE_ATTACH, 26846, 0, 0) = -1 EPERM (Operation not permitted) 
... 

Vom ptrace(2) man:

EPERM The specified process cannot be traced. This could be because the parent 
     has insufficient privileges (the required capability is CAP_SYS_PTRACE); 
     unprivileged processes cannot trace processes that they cannot send 
     signals to or those running set-user-ID/set-group-ID programs, for obvious 
     reasons. Alternatively, the process may already be being traced, or be 
     init(8) (PID 1). 

Siehe auch capabilities(7). Unter Verwendung von sudo erhalten Sie die Funktionen von root, einschließlich CAP_SYS_PTRACE.

Verwandte Themen