[jira] [Created] (BATIK-1271) Thread-safety issue in AWTGlyphGeometryCache causing infinite loop
"Fabien Leroy (Jira)" <[email protected]> Fri, 18 Oct 2019 08:42:00 +0000 (UTC)
| Newsgroups | gmane.text.xml.batik.devel |
|---|---|
| Message-ID | <[email protected]> |
Fabien Leroy created BATIK-1271:
-----------------------------------
Summary: Thread-safety issue in AWTGlyphGeometryCache causing =
infinite loop
Key: BATIK-1271
URL: https://issues.apache.org/jira/browse/BATIK-1271
Project: Batik
Issue Type: Bug
Components: GVT
Affects Versions: 1.9
Reporter: Fabien Leroy
Attachments: AWTGlyphGeometryCache.diff, heap dump.png, partial th=
read dump.txt
Hello,
=C2=A0
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=C2=A0AWTGlyphGeometryCache.get() method=
.
Heap dump shows we have an AWTGlyphGeometryCache$Entry instance that is ref=
erencing 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() metho=
d is probably causing the problem : it is working on the 'table' class attr=
ibute and not on a copy. So if multiple threads enter this method concurren=
tly, the following line may result in 'e.next =3D e' :
{code:java}
e.next =3D table[index];{code}
=C2=A0
=C2=A0
Possible solutions that should work :
# make the method=C2=A0synchronized
# work on a local 'tmpTable', and assign it to the class attribute 'table'=
at the end of the method (cf suggested patch)=C2=A0
=C2=A0
=C2=A0
--
This message was sent by Atlassian Jira
(v8.3.4#803005)