RFR: 8293592: Remove JVM_StopThread, stillborn, and related cleanup
David Holmes
dholmes at openjdk.org
Fri Sep 23 08:58:42 UTC 2022
Now that Thread.stop has been degraded to throw `UnsupportedOperationException` (JDK-8299610) the only direct source of async exceptions is from JVMTI `StopThread`. We can remove the `JVM_StopThread` code, remove the `stillborn` field from `java.lang.Thread` and its associated accesses from the VM, and we can stop special-casing `ThreadDeath` handling (as was done for the JDK code as part of JDK-8299610).
Note that JVMTI `StopThread` can only act on a thread that is alive, so it is no longer possible to stop a thread before it has been started.
Also note that there is a change in behaviour for JNI `ExceptionDescribe` as it no longer ignores `ThreadDeath` exceptions (not that it was ever specified to ignore them, it simply mirrored the behaviour of the default `UncaughtExceptionHandler` in `java.lang.ThreadGroup` - which also no longer ignores them so the mirroring behaviour remains the same).
Testing: tiers 1-3
-------------
Commit messages:
- Removal all special handling of ThreadDeath.
- Remove all references to the stillborn field
- Initial commit: remove JVM_StopThread
- Merge
- Updates to Java Thread Primitive Deprecation page
- Repalce "it" with "victim thread"
- Merge
- Revert test/langtools/ProblemList.txt as jshell tests no longer rely on Thread.stop
- become -> became in javadoc
- Merge
- ... and 5 more: https://git.openjdk.org/jdk/compare/01e7b881...58bfb313
Changes: https://git.openjdk.org/jdk/pull/10400/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10400&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8293592
Stats: 549 lines in 43 files changed: 134 ins; 308 del; 107 mod
Patch: https://git.openjdk.org/jdk/pull/10400.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10400/head:pull/10400
PR: https://git.openjdk.org/jdk/pull/10400
More information about the security-dev
mailing list