Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 528968

Summary: [Wayland] JVM crashes when running JUnit tests on Wayland
Product: [Eclipse Project] Platform Reporter: Eric Williams <ericwill>
Component: SWTAssignee: Eric Williams <ericwill>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lufimtse
Version: 4.8Keywords: triaged
Target Milestone: 4.8 M5   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/114440
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=9913c5a1d7242c20e4a6f4f111e4d54e5569991f
Whiteboard:
Bug Depends on:    
Bug Blocks: 516841    

Description Eric Williams CLA 2017-12-19 11:49:44 EST
Running the SWT JUnit tests on Wayland crashes the JVM, as the library used to take screenshots uses X11 specific calls. The stack trace is below:

j  sun.awt.X11.XRobotPeer.getRGBPixelsImpl(Lsun/awt/X11GraphicsConfig;IIII[I)V+0
j  sun.awt.X11.XRobotPeer.getRGBPixels(Ljava/awt/Rectangle;)[I+33
j  java.awt.Robot.createScreenCapture(Ljava/awt/Rectangle;)Ljava/awt/image/BufferedImage;+50
j  org.eclipse.test.internal.AwtScreenshot.main([Ljava/lang/String;)V+32

IMO we shouldn't have a dependency on outside libraries in the SWT testing project, but if we must then these two calls should be guarded against Wayland somehow.
Comment 1 Leo Ufimtsev CLA 2017-12-19 11:56:54 EST
(In reply to Eric Williams from comment #0)
> Running the SWT JUnit tests on Wayland crashes the JVM, as the library used
> to take screenshots uses X11 specific calls. The stack trace is below:
> 
> j 
> sun.awt.X11.XRobotPeer.getRGBPixelsImpl(Lsun/awt/X11GraphicsConfig;IIII[I)V+0
> j  sun.awt.X11.XRobotPeer.getRGBPixels(Ljava/awt/Rectangle;)[I+33
> j 
> java.awt.Robot.createScreenCapture(Ljava/awt/Rectangle;)Ljava/awt/image/
> BufferedImage;+50
> j  org.eclipse.test.internal.AwtScreenshot.main([Ljava/lang/String;)V+32
> 
> IMO we shouldn't have a dependency on outside libraries in the SWT testing
> project, but if we must then these two calls should be guarded against
> Wayland somehow.

+1. (voting feature not working atm).
Comment 2 Eclipse Genie CLA 2017-12-19 12:54:43 EST
New Gerrit change created: https://git.eclipse.org/r/114440
Comment 4 Eric Williams CLA 2017-12-22 09:03:17 EST
(In reply to Eclipse Genie from comment #3)
> Gerrit change https://git.eclipse.org/r/114440 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=9913c5a1d7242c20e4a6f4f111e4d54e5569991f

Fix is in master now.
Comment 5 Eric Williams CLA 2018-01-23 11:04:58 EST
Verified in I20180122-2000.