-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b124
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8163709 | 8u121 | Sergey Bylokhov | P4 | Resolved | Fixed | b01 |
JDK-8159847 | 8u112 | Sergey Bylokhov | P4 | Resolved | Fixed | b02 |
JDK-8167835 | emb-8u121 | Sergey Bylokhov | P4 | Resolved | Fixed | b01 |
After some investigation of the problem I was able to create a test for the JDK-7172749.
To reproduce the bug the next sequence is necessary:
Thread A
- create the surface
- SG2D is created for the surface
- SG2D.drawLine is called
- XRRenderer(Pipe).drawLine is called
- ========= STOP "THREAD A" for a nanoseconds=========
Thread B
- SG2D is created for the surface create in Thread A
- SG2D.drawLine is called or any other draw operations.
- The surface is flushed.
Thread A
- ========= RUN "THREAD A" again=========
- (we still inside XRRenderer(Pipe).drawLine)
- SG2D.getCompClip() is called, and this caused revalidation of SG2D, because it was already flushed. This means that the surface/pipes etc are changed, but note we still in the old XRRenderer(PixelDrawPipe) which actually should be disposed as well
- we try to use the new surface and got ClassCastException.
- After the fix we will start to draw the line again from "SG2D.drawLine" above, using new surface and the new PixelDrawPipe.
The interesting thing is how we will work if revalidation will replace the surface to the same type(so ClassCastException will not occurred) but the pipe will be changed to the new? I cannot prove it but it seems that we will draw something to the new surface using the old PixelDrawPipe. (But this is only for the record if someone will work on this/or similar issues).
And the test which reproduce the bug.
Bug: https://bugs.openjdk.java.net/browse/JDK-8158072
Webrev can be found at: http://cr.openjdk.java.net/~serb/8158072/webrev.00
To reproduce the bug the next sequence is necessary:
Thread A
- create the surface
- SG2D is created for the surface
- SG2D.drawLine is called
- XRRenderer(Pipe).drawLine is called
- ========= STOP "THREAD A" for a nanoseconds=========
Thread B
- SG2D is created for the surface create in Thread A
- SG2D.drawLine is called or any other draw operations.
- The surface is flushed.
Thread A
- ========= RUN "THREAD A" again=========
- (we still inside XRRenderer(Pipe).drawLine)
- SG2D.getCompClip() is called, and this caused revalidation of SG2D, because it was already flushed. This means that the surface/pipes etc are changed, but note we still in the old XRRenderer(PixelDrawPipe) which actually should be disposed as well
- we try to use the new surface and got ClassCastException.
- After the fix we will start to draw the line again from "SG2D.drawLine" above, using new surface and the new PixelDrawPipe.
The interesting thing is how we will work if revalidation will replace the surface to the same type(so ClassCastException will not occurred) but the pipe will be changed to the new? I cannot prove it but it seems that we will draw something to the new surface using the old PixelDrawPipe. (But this is only for the record if someone will work on this/or similar issues).
And the test which reproduce the bug.
Bug: https://bugs.openjdk.java.net/browse/JDK-8158072
Webrev can be found at: http://cr.openjdk.java.net/~serb/8158072/webrev.00
- backported by
-
JDK-8159847 Need a test for JDK-7172749
- Resolved
-
JDK-8163709 Need a test for JDK-7172749
- Resolved
-
JDK-8167835 Need a test for JDK-7172749
- Resolved
- relates to
-
JDK-7172749 Xrender: Class cast exception in 2D code running an AWT regression test
- Resolved