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

Hohensee, Paul hohensee at amazon.com
Fri Oct 15 20:39:47 UTC 2021

In attachListener.hpp, the AttachListenerState enum's underlying type will be int, so casting to jlong for the atomic operations will clobber whatever is beyond _state, and won't work at all on big-endian machines. C++11 adds enum base type specification, but we can't use C++11 features in 8u. I would define const int AL_* values and declare _state to be an int.

I'm leery of disabling the test. Please see if you can backport 8165500, which introduced LingeredApp.

You have code from 8237499 in the patch which has already been backported. Please remove it. Also, please post review requests for 8227815 and 8227738 backports, with the intent to push all three at once.


-----Original Message-----
From: jdk8u-dev <jdk8u-dev-retn at openjdk.java.net> on behalf of Yi Yang <qingfeng.yy at alibaba-inc.com>
Reply-To: Yi Yang <qingfeng.yy at alibaba-inc.com>
Date: Friday, October 8, 2021 at 4:21 AM
To: "jdk8u-dev at openjdk.java.net" <jdk8u-dev at openjdk.java.net>
Subject: [8u] RFR: 8225690: Multiple AttachListener threads can be created


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