2012-12-13 20 views

Odpowiedz

10

To dlatego jstack -F używa wywołania systemowego ptrace(2), aby spróbować i dostępu do danych JVM, który nie działa, jeśli nie masz prawa:

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

Od tej 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). 

Patrz także capabilities(7). Korzystając z sudo, otrzymujesz funkcje roota, które obejmują CAP_SYS_PTRACE.

Powiązane problemy