RFR: 8205992: jhsdb cannot attach to Java processes running in Docker containers

Yasumasa Suenaga yasuenag at gmail.com
Thu Jun 28 13:12:28 UTC 2018


Hi all,

Please review this change.

   JBS:    https://bugs.openjdk.java.net/browse/JDK-8205992
   webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8205992/webrev.00/

I tried to attach jhsdb to java process in docker container from container host, but it couldn't.
jcmd supports PID namespace in JDK-8193710, but jhsdb hasn't yet.

SA gets LWP ID via thread stack and funcs in libthread_db.so, but they returns PIDs in container - they are different from host's PID. So I added the code to scan /proc/<PID>/task to get all LWP IDs and they are kept in a Map in LinuxDebuggerLocal.

Also SA_ALTROOT is set to /proc/<PID>/root if SA detects debuggee runs in container. It helps SA to parse binaries in container.

This change has been pushed to submit repo, and it was failed on OS X (mach5-one-ysuenaga-JDK-8205992-20180628-1015-28963).
But I guess it causes JDK-8205906. This change affects to Linux only.

Could you review it?


Thanks,

Yasumasa



More information about the serviceability-dev mailing list