[stringtemplate-interest] thread-safety issue in ST-4.0.4

Terence Parr parrt at cs.usfca.edu
Thu Nov 24 08:44:06 PST 2011


yikes. let me take a look.
T
On Nov 24, 2011, at 1:41 AM, Oliver Flege wrote:

> 
> Hi,
> 
> I just found out the hard way that
> org.stringtemplate.v4.misc.ObjectModelAdaptor ist not thread-safe:
> 
> The field classAndPropertyToMemberCache can be accessed by multiple
> threads at the same time.
> Since org.antlr.runtime.misc.DoubleKeyMap and its internal
> java.util.LinkedHashMap aren't thread-safe, parallel puts might
> corrupt the map's structure (in my case: the pointers to the next
> Entry ended up forming an infinite loop).
> 
> classAndPropertyToMemberCache.get/put should be synchronized on
> a common mutex object.
> 
> Regards,
> Oliver
> 
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list