[8u] RFR: 8225690: Multiple AttachListener threads can be created

Yi Yang qingfeng.yy at alibaba-inc.com
Fri Oct 8 11:03:37 UTC 2021


Can I have a review for this backport of JDK-8225690?
Original Issue: https://bugs.openjdk.java.net/browse/JDK-8225690
Original Changeset: https://hg.openjdk.java.net/jdk/jdk/rev/70fab3a8ff02
Backport Issue: https://bugs.openjdk.java.net/browse/JDK-8274953
Backport Changeset: http://cr.openjdk.java.net/~yyang/8274953/

VM can't be attached If someone cleans up the /tmp directory. This patch
addresses the problem. It can not apply cleanly, some minor conflicts are as follows:

1. Atomic::store(new_state, &_state)
jdk8u does not have templated Atomic function family, use explicitly type 
conversion `Atomic::store((jlong)new_state, (volatile jlong*)&_state)`.

2. IsRegisteredEnum<AttachListenerState>
jdk8u does not have metaprogramming type traits, 
`template<> struct IsRegisteredEnum<AttachListenerState> : public TrueType {};`
simply omit it.

3. os::naked_yield
os::naked_yield is missing due to https://bugs.openjdk.java.net/browse/JDK-8047714,
use os::yield instead.

4. log_debug(attach)("...")
jdk8u does not have unified logging system. Use the following code:

5. Test
They can not work because of the usages of LingeredApp. Remove @test tag to
disable them while keeping their source code.

Test cases have been passed manually. The original issue has related bugs:
I'd like to create follow-up backports(JDK-8227815 and JDK-8227738) once this
merged. JDK-8235211 is not necessary since RemovingUnixDomainSocketTest.java
will be ignored as I said before.


More information about the jdk8u-dev mailing list