-
Bug
-
Resolution: Fixed
-
P2
-
6, 6u10
-
b45
-
x86
-
linux_suse_sles_11, solaris_10, windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2225671 | 7u6 | Vladislav Karnaukhov | P2 | Closed | Fixed | b17 |
JDK-2225666 | 6u34 | Vladislav Karnaukhov | P2 | Closed | Fixed | b03 |
JDK-2225834 | 6u33 | Vladislav Karnaukhov | P3 | Resolved | Fixed | b33 |
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Solaris 10 10/09 s10x_u8wos_08a X86
SunOS 5.10 Generic_142901-06 i86pc i386 i86pc
A DESCRIPTION OF THE PROBLEM :
Using one of the polymorphic methods java.awt.Graphics2D.drawString() leads to an endless loop when accessing this method in a multi threaded environment. For example, we use a 3rd party library jcaptcha (http://jcaptcha.sourceforge.net/) to generate images within our web application.
We discussed the problem and came to the conclusion, that not the implementation of the jcaptcha is the problem und must be implemented in a thread safe manner. Rather the implementation of the sdk code within sun.font.SunLayoutEngine.getEngine(LayoutEngineKey) should be thread safe. The read access to the hashmap is not synchronized and leads to endless loops for the threads which want to get the LayoutEngine. Unfortunatelly the thread which writes (hashmap.put()) has passed the code point and does not appear within our stack trace at all.
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at sun.font.SunLayoutEngine.getEngine(SunLayoutEngine.java:115)
at sun.font.GlyphLayout$EngineRecord.init(GlyphLayout.java:642)
at sun.font.GlyphLayout.nextEngineRecord(GlyphLayout.java:494)
at sun.font.GlyphLayout.layout(GlyphLayout.java:417)
at sun.font.ExtendedTextSourceLabel.createGV(ExtendedTextSourceLabel.java:308)
at sun.font.ExtendedTextSourceLabel.getGV(ExtendedTextSourceLabel.java:294)
at sun.font.ExtendedTextSourceLabel.createLogicalBounds(ExtendedTextSourceLabel.java:208)
at sun.font.ExtendedTextSourceLabel.getAdvance(ExtendedTextSourceLabel.java:117)
at java.awt.font.TextLine.init(TextLine.java:264)
at java.awt.font.TextLine.<init>(TextLine.java:110)
at java.awt.font.TextLine.fastCreateTextLine(TextLine.java:952)
at java.awt.font.TextLayout.fastInit(TextLayout.java:585)
at java.awt.font.TextLayout.<init>(TextLayout.java:511)
at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2804)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
difficult to reproduce, but we think the code tells enough to tell you about the thread safety.
REPRODUCIBILITY :
This bug can be reproduced rarely.
- backported by
-
JDK-2225834 Unsynchronized HashMap access causes endless loop
-
- Resolved
-
-
JDK-2225666 Unsynchronized HashMap access causes endless loop
-
- Closed
-
-
JDK-2225671 Unsynchronized HashMap access causes endless loop
-
- Closed
-
- duplicates
-
JDK-6953806 thread stuck in sun.font.SunLayoutEngine.getEngine java.util.HashMap.get
-
- Closed
-
-
JDK-6979122 Endless loop while concurrently rendering text in multiple threads
-
- Closed
-
- relates to
-
JDK-7183251 Netbeans editor renders text wrong on JDK 7u6 build 17
-
- Closed
-
-
JDK-6611637 sun.font.GlyphLayout not threadsafe causing NullPointerException
-
- Closed
-