Sunbug 6934356: Vector.writeObject() synchronization risks serialization deadlock
Alan Bateman
Alan.Bateman at oracle.com
Tue Jan 11 13:47:06 UTC 2011
Brian Goetz wrote:
> While on the subject of serialization deadlocks in core libraries, Amy Williams and Mike Ernst did a paper (also became Amy's masters thesis) back when Mike was at MIT on static detection of deadlocks and they built a tools which found several deadlocks in the JDK collections. Does anyone recall any bugs from this source being fixed?
>
>
I don't have history in this area but I see her M.Sc. is online and sure
enough, in section 6.1.1 "As an example, consider java.util.Hashtable.
This class can be deadlocked by creating two Hashtable objects and
adding each as an element of the other, i.e., by forming a cyclic
relationship between the instances." and further on, "all synchronized
Collections and combinations of such Collections (e.g., a Vector in a
cyclic relationship with a Hashtable) can be dead- locked in a similar
fashion". Looks like she was running with JDK 1.4 but I don't think
legacy Hashtable or Vector have changed much since then. I see someone
actually ran into this with j.u.Properties:
6582568: (coll) Concurrent Hashtable.equals deadlock
-Alan.
More information about the core-libs-dev
mailing list