Unable to get thread dump using jstack

255 Views Asked by At

When I run the command

jstack 23264 > threaddump.txt

I get:

23264: well-known file /tmp/.java_pid23264 is not secure: file should be owned by the current user (which is 0) but is owned by 9001

when i ran with -F I got

Error attaching to core file: cannot open binary file

Can someone help me resolve this issue ? I ran the above command as root

1

There are 1 best solutions below

1
CS1999 On

I got the answer. I need to login as the user associated with process. The root user was not owner of the process. Once I switched the user I was able to get the thread dump.