JDK-8014212 : Robot captures black screen
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7u85,8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2013-05-08
  • Updated: 2023-10-09
  • Resolved: 2015-08-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b80Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Testsuite name: AWT

JDK/JRE tested: 1.8.0_b88 (32/64 bits)
OS/architecture: Ubuntu 12.04 x64
Reproducible: Always
Reproducible on machine: aeremeev-ru
Is it a Regression: No
Is it a platform specific issue: Yes

Robot captures a part of screen which differs from set in createScreenCapture on Ubuntu 12.04 if you have more than one screen devices.
If displays are duplicated, test passes. But if displays are extended, test fails.
To reproduce use attached test. 
Comments
RULE "sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java" Exception java.lang.RuntimeException: Test failed at ...-0 rgb=...
09-10-2015

URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/46894b1937af User: lana Date: 2015-09-01 20:27:06 +0000
01-09-2015

Moving rule from dup RULE closed/sun/java2d/DirectX/D3dTranslucency.java Exception java.lang.Error: Failed: Incorrect color in window: Expected pixel: ffff0000 Pixel found at (...,0): ff000000 RULE closed/sun/java2d/OpenGL/DrawImageBg.java Exception java.lang.RuntimeException: Failed: Incorrect color for outer pixel RULE closed/sun/java2d/OpenGL/XORPaint.java Exception java.lang.RuntimeException: Failed: Incorrect color for background(expected: ffffffff actual: ff000000) RULE closed/sun/java2d/doubleBuffering/DDrawD3DClash/DDrawBltTest.java Exception java.lang.Error: Failed: Incorrect color in window RULE closed/sun/java2d/OpenGL/XORPaint.java Exception java.lang.RuntimeException: Failed: Incorrect color for solid rect (non-AA)(expected: ff0000ff actual: ffffffff)
20-08-2015

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/46894b1937af User: azvegint Date: 2015-08-11 13:37:13 +0000
11-08-2015

After private discussion with Prasanta turns out that is not a coordinates issue. As a fix xwd screen capturing code can be replaced with a single XGetImage() call.
16-04-2015

@Alexander, I tried taking in your changes and build in ubuntu12.04 but still am able to see the problem. It seems Robot.createScreenCapture() is called with screenRect parameter where x=100, y=100, width=200, height=200 but in ubuntu14.04 x=100, y=128, width=200, height =200 so it seems Frame.getBounds() is returning different coordinate vis-a-vis ubuntu12.04 and ubuntu14.04
10-04-2015

I guess the issue relates to incorrect coordinate transformation which happens in two-screened configuration.
08-04-2015

Yes, It is not a problem with xrender but probably with X11 since Robot code is using X11 APIs. Robot.createScreenCapture() calls awt_Robot.c#Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl which calls GetMultiVisualRegions(),ReadAreaToImage to read the image content and XGetPixel() to get the pixels from the image which are all X11 calls and XGetPixel() return 0 in ubuntu12.04 but returns ff in ubuntu14.04 which will then be added to 0xff00000 so ubuntu12.04 gets 0xff00000 while ubuntu14.04 gets correct pixel 0xff0000ff .
08-04-2015

I guess Fram0 is an image which was created by Robot? If yes then it is unlikely a problem related to xrender, but you can check this via -Dsun.java2d.xrender=false.
07-04-2015

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

Converted "8-client-defer-candidate" label to "8-defer-request" by SQE' OK.
15-08-2013

*This is anti-deferral criteria list*: - P2 -------------- Engineering's Criteria ------------------------------------- - tck-red labeled - conformance labeled - P3 regressions reported/labeled against jdk8 - findbugs, parfait, eht labeled bugs - CAP <1 year reported - netbeans <1 year reported Victor ----------------- SQE's OK --------------------------------- Yes, we are ok with that thanks, Mikhail
15-08-2013

RULE 2D_Font/standalone/TextMustFit Exception java.lang.RuntimeException: Test failed: last letter is not found
17-06-2013

RULE 2D_MultiMonitor/RobotScreenCaptureTest ExitCode 1 RULE 2D_MultiMonitor/MoveWindowVirtualScreenTest ExitCode 2 RULE 2D_MultiMonitor/CreateWindowMultiScreenTest ExitCode 2 totally black all screenshots but one (with some garbage in it): RULE 2D_MultiMonitor/MoveWindowVirtualScreenTest ExitCode 1
13-05-2013