When running test262parallel, it sometimes hangs indefinitely. Looks like this happens because sometimes threads try to read the protoHistory of the same PropertyMap at the same time it is being modified, and this unfortunately can lead to an infinite loop in WeakHashMap due to the way it is written (it is not threadsafe): at java.util.WeakHashMap.get(WeakHashMap.java:403) at jdk.nashorn.internal.runtime.PropertyMap.checkProtoHistory(PropertyMap.java:687) at jdk.nashorn.internal.runtime.PropertyMap.changeProto(PropertyMap.java:886) at jdk.nashorn.internal.runtime.ScriptObject.setProto(ScriptObject.java:1288) ... It seems that in a multithreaded environment, PropertyMap.history and .protoHistory would need to be threadsafe. They're both caches with weak keys and soft values (WeakHashMap<K, SoftReference<V>>) and WeakHashMap is unfortunately not threadsafe.
|