RFR: 8264639: SA: Worker thread for ptrace on Linux should be more robustness
Yasumasa Suenaga
ysuenaga at openjdk.java.net
Fri Apr 2 12:28:42 UTC 2021
LinuxDebuggerLocal has worker thread (LinuxDebuggerLocalWorkerThread) to call ptrace(2) because it have to call from same thread.
LinuxDebuggerLocalWorkerThread does not have queue, so it depends on synchronized statement as following:
https://github.com/openjdk/jdk/blob/66d9961cbd83dbfca20b0af3c20693438d4aff3f/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java#L156-L192
If `execute()` is called in same time, `task` would be broken.
Fortunately all of caller of `execute()` are guarded with `synchronized` now. But task worker should be more robustness.
I used `Executors::newSingleThreadExecutor`, so we don't need to take care task queue.
I tested this change with serviceability/sa jtreg tests on Linux x64.
-------------
Commit messages:
- 8264639: SA: Worker thread for ptrace on Linux should be more robustness
Changes: https://git.openjdk.java.net/jdk/pull/3321/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3321&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8264639
Stats: 172 lines in 1 file changed: 17 ins; 108 del; 47 mod
Patch: https://git.openjdk.java.net/jdk/pull/3321.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3321/head:pull/3321
PR: https://git.openjdk.java.net/jdk/pull/3321
More information about the serviceability-dev
mailing list