Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252562

NPE at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas when width or height of a Canvas is bigger than 8192

XMLWordPrintable

    • x86_64
    • windows_10

      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


        1. Test.java
          0.5 kB
          Praveen Narayanaswamy

            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: