Affects Version/s: 1.9
Fix Version/s: None
Running Batik in a multi-threaded environment (JAVA EE application server), we are sometimes having threads stuck in infinite loop.
Thread dump shows we are stucked in AWTGlyphGeometryCache.get() method.
Heap dump shows we have an AWTGlyphGeometryCache$Entry instance that is referencing itself as ".next" item, resulting in an infinite loop when trying to run through the collection in AWTGlyphGeometryCache.get().
Looking at the code, we found that the AWTGlyphGeometryCache.rehash() method is probably causing the problem : it is working on the 'table' class attribute and not on a copy. So if multiple threads enter this method concurrently, the following line may result in 'e.next = e' :
Possible solutions that should work :
- make the method synchronized
- work on a local 'tmpTable', and assign it to the class attribute 'table' at the end of the method (cf suggested patch)