JDK-8252562 : NPE at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas when width or height of a Canvas is bigger than 8192
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: openjfx14
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2020-08-30
  • Updated: 2020-09-02
  • Resolved: 2020-09-02
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 10

A DESCRIPTION OF THE PROBLEM :
"java.lang.NullPointerException" when width or height of a Canvas is bigger than 8192 .

ERROR MESSAGES/STACK TRACES THAT OCCUR : 
java.lang.NullPointerException
	at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(NGCanvas.java:214)
	at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.initCanvas(NGCanvas.java:644)
	at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.renderContent(NGCanvas.java:607)
	at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
	at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
	at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
	at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
	at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
	at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
	at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:479)
	at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:328)
	at javafx.graphics/com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
	at java.base/java.lang.Thread.run(Thread.java:832)


REGRESSION : Last worked in version 14.0.2

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This bug can be reproduced always. 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception
ACTUAL -
has exception

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

public class Test extends Application {
	@Override
	public void start(Stage primaryStage) {
		AnchorPane root = new AnchorPane();

		Canvas canvas = new Canvas(8193, 1);
		root.getChildren().add(canvas);

		Scene scene = new Scene(root, 400, 400);
		primaryStage.setScene(scene);
		primaryStage.show();
	}

	public static void main(String[] args) {
		launch(args);
	}
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
no workaround!

FREQUENCY : always



Comments
This is a duplicate of JDK-8090178
02-09-2020

This is not a regression, but a long-standing bug. Removing the regression keyword.
02-09-2020

Checking with testcase with -Dprism.verbose=true in Windows 10: Test Results: ============= Prism pipeline init order: d3d sw Using Double Precision Marlin Rasterizer Using dirty region optimizations Not using texture mask for primitives Not forcing power of 2 sizes for textures Using hardware CLAMP_TO_ZERO mode Opting in for HiDPI pixel scaling Prism pipeline name = com.sun.prism.d3d.D3DPipeline Loading D3D native library ... succeeded. D3DPipelineManager: Created D3D9Ex device Direct3D initialization succeeded (X) Got class = class com.sun.prism.d3d.D3DPipeline Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline Maximum supported texture size: 8192 Maximum texture size clamped to 4096 OS Information: Windows version 10.0 build 18362 D3D Driver Information: Intel(R) UHD Graphics 620 \\.\DISPLAY1 Driver igdumdim64.dll, version 26.20.100.6999 Pixel Shader version 3.0 Device : ven_8086, dev_3EA0, subsys_227917AA Max Multisamples supported: 4 vsync: true vpipe: true java.lang.NullPointerException at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(NGCanvas.java:214) at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.initCanvas(NGCanvas.java:644) at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.renderContent(NGCanvas.java:607) at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072) at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964) at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270) at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579) at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072) at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964) at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:479) at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:328) at javafx.graphics/com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) at javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125) at java.base/java.lang.Thread.run(Thread.java:832) QuantumRenderer: shutdown JDK 16ea13 + JavaFX 16-ea: Fail JDK 15ea36 + JavaFX 15-ea: Fail JDK 14.0.2 + JavaFX 14.0.2.1: Fail JDK 11.0.8 + JavaFX 11.0.7: Fail JDK 8u261: Fail
31-08-2020