[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Interest in Java based attach provider implementation?
From:       Philippe Marschall <kustos () gmx ! net>
Date:       2022-04-20 20:13:20
Message-ID: 4b22f750-721f-e178-6618-0f0fb062c921 () gmx ! net
[Download RAW message or body]

Hello

I hope this is the right mailing list. I recently had a look at the
Linux attach provider implementation and could not help but noticing
that a large part, if not all of it, could be replaced with Java.
Besides getting rid of the C code this should allow us to unify the AIX,
Linux and macOS implementations under a single Unix implementation.

The permission check can be implemented using JSR 203 [1] to access uid,
gid and file mode and using jdk.internal.misc.VM to get the euid and egid.

Reading and writing to Unix domain sockets can be done through JEP 380 [2].

Sending SIGQUIT to a process could in theory done through JEP 102 [3]
however sending SIGQUIT to self is currently blocked. This is required
for the self attach mechanism. There a very small C function is still
needed for now, this is hopefully portable.

I did a small prototype [4]. The tier1 suite runs and I can attach to a
local JVM.

The overhead will likely be a bit higher as we go through more JDK
abstractions.

  [1] https://jcp.org/en/jsr/detail?id=203
  [2] https://openjdk.java.net/jeps/380
  [3] https://openjdk.java.net/jeps/102
  [4]
https://github.com/marschall/jdk/commit/207dac7e4d1bd65450bbd2c9e14d33fc34b7cebc

Cheers
Philippe
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic