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

showing and hiding many popups throws a RuntimeException - BaseWnd::RegisterClassEx

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: openjfx17
    • Fix Version/s: None
    • Component/s: javafx

      Description

      A DESCRIPTION OF THE PROBLEM :
      If I show and hide a javafx Popup many times approx 9800 times, the jvm crashes.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the test code attached to this report, and eventually the jvm will crash

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Test app would complete without errors
      ACTUAL -
      Running the test source code results in error:
      Exception in Application start method
      Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
      at javafx.base/com.sun.javafx.binding.ExpressionHelper.removeListener(ExpressionHelper.java:73)
      at javafx.base/javafx.beans.property.ReadOnlyBooleanPropertyBase.removeListener(ReadOnlyBooleanPropertyBase.java:67)
      at javafx.graphics/javafx.stage.PopupWindow.unbindOwnerFocusedProperty(PopupWindow.java:903)
      at javafx.graphics/javafx.stage.PopupWindow.doVisibleChanged(PopupWindow.java:550)
      at javafx.graphics/javafx.stage.PopupWindow$1.doVisibleChanged(PopupWindow.java:112)
      at javafx.graphics/com.sun.javafx.stage.PopupWindowHelper.visibleChangedImpl(PopupWindowHelper.java:63)
      at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanged(WindowHelper.java:77)
      at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1163)
      at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
      at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
      at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1190)
      at javafx.graphics/javafx.stage.Window.hide(Window.java:1215)
      at javafx.graphics/javafx.stage.PopupWindow.hide(PopupWindow.java:489)
      at javafx.graphics/javafx.stage.PopupWindow.lambda$new$0(PopupWindow.java:148)
      at javafx.base/javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:86)
      at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
      at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.graphics/com.sun.javafx.scene.TreeShowingExpression.invalidate(TreeShowingExpression.java:105)
      at javafx.graphics/com.sun.javafx.scene.TreeShowingExpression.updateTreeShowing(TreeShowingExpression.java:149)
      at javafx.graphics/com.sun.javafx.scene.TreeShowingExpression.lambda$new$0(TreeShowingExpression.java:45)
      at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:360)
      at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.base/javafx.beans.property.ReadOnlyBooleanPropertyBase.fireValueChangedEvent(ReadOnlyBooleanPropertyBase.java:78)
      at javafx.base/javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:103)
      at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
      at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
      at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1190)
      at javafx.graphics/javafx.stage.Window.hide(Window.java:1215)
      at javafx.graphics/com.sun.javafx.stage.WindowPeerListener.closed(WindowPeerListener.java:105)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:144)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:40)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.lambda$handleWindowEvent$4(GlassWindowEventHandler.java:178)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:176)
      at javafx.graphics/com.sun.glass.ui.Window.handleWindowEvent(Window.java:1336)
      at javafx.graphics/com.sun.glass.ui.Window.notifyDestroy(Window.java:1250)
      at javafx.graphics/com.sun.glass.ui.win.WinWindow._close(Native Method)
      at javafx.graphics/com.sun.glass.ui.Window.close(Window.java:352)
      at javafx.graphics/com.sun.glass.ui.win.WinWindow.close(WinWindow.java:316)
      at javafx.graphics/com.sun.glass.ui.Application.terminate(Application.java:397)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$exit$13(QuantumToolkit.java:843)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithRenderLock(QuantumToolkit.java:442)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.exit(QuantumToolkit.java:839)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$tkExit$16(PlatformImpl.java:624)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
      at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
      at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
      at java.base/java.lang.Thread.run(Thread.java:833)
      java.lang.reflect.InvocationTargetException
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:465)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
      Caused by: java.lang.RuntimeException: Exception in Application start method
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:901)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
      at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.lang.RuntimeException: could not create platform window
      at javafx.graphics/com.sun.glass.ui.Window.<init>(Window.java:294)
      at javafx.graphics/com.sun.glass.ui.win.WinWindow.<init>(WinWindow.java:54)
      at javafx.graphics/com.sun.glass.ui.win.WinApplication.createWindow(WinApplication.java:229)
      at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.initPlatformWindow(WindowStage.java:201)
      at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.init(WindowStage.java:143)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.createTKPopupStage(QuantumToolkit.java:690)
      at javafx.graphics/javafx.stage.PopupWindow.doVisibleChanging(PopupWindow.java:522)
      at javafx.graphics/javafx.stage.PopupWindow$1.doVisibleChanging(PopupWindow.java:108)
      at javafx.graphics/com.sun.javafx.stage.PopupWindowHelper.visibleChangingImpl(PopupWindowHelper.java:57)
      at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanging(WindowHelper.java:73)
      at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1068)
      at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
      at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
      at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1190)
      at javafx.graphics/javafx.stage.Window.show(Window.java:1205)
      at javafx.graphics/javafx.stage.PopupWindow.showImpl(PopupWindow.java:475)
      at javafx.graphics/javafx.stage.PopupWindow.show(PopupWindow.java:420)
      at test.TestFX.start(TestFX.java:20)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
      at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
      at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
      ... 1 more
      Exception running application test.TestFX


      ---------- BEGIN SOURCE ----------
      package test;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Popup;
      import javafx.stage.Stage;

      public class TestFX extends Application {

      @Override
      public void start(Stage primaryStage) {
      System.out.println("javafx.runtime.version: " + System.getProperties().get("javafx.runtime.version"));
      Stage stage = new Stage();
      Scene scene = new Scene(new StackPane());
      stage.setScene(scene);
      stage.show();
      Popup popOver = new Popup();
      for (int i = 0; i < 99999; i++) {
      popOver.show(scene.getRoot(), 1, 1);
      popOver.hide();
      System.out.println(i);
      }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      If I set setOpacity = 0 instead of hiding the popup, it doesn't crash

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pnarayanaswa Praveen Narayanaswamy
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: