cognitect-labs / REBL-distro

REBL-distro
368 stars 10 forks source link

Bottom right panel becomes unusable #21

Closed jelmerderonde closed 4 years ago

jelmerderonde commented 5 years ago

Often when using REBL I get the following stacktrace:

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at javafx.scene.control.skin.TableCellSkin.tableColumnProperty(TableCellSkin.java:97)
    at javafx.scene.control.skin.TableCellSkinBase.getTableColumn(TableCellSkinBase.java:123)
    at javafx.scene.control.skin.TableCellSkinBase.dispose(TableCellSkinBase.java:136)
    at javafx.scene.control.skin.TableCellSkin.dispose(TableCellSkin.java:88)
    at javafx.scene.control.Control$2.invalidated(Control.java:267)
    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
    at javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:82)
    at javafx.scene.control.Control$2.set(Control.java:250)
    at javafx.scene.control.Control$2.set(Control.java:233)
    at javafx.scene.control.Control.setSkin(Control.java:230)
    at javafx.scene.control.skin.TableRowSkinBase.recreateCells(TableRowSkinBase.java:715)
    at javafx.scene.control.skin.TableRowSkinBase.updateCells(TableRowSkinBase.java:505)
    at javafx.scene.control.skin.TableRowSkinBase.checkState(TableRowSkinBase.java:649)
    at javafx.scene.control.skin.TableRowSkinBase.computePrefHeight(TableRowSkinBase.java:588)
    at javafx.scene.control.Control.computePrefHeight(Control.java:570)
    at javafx.scene.Parent.prefHeight(Parent.java:1037)
    at javafx.scene.layout.Region.prefHeight(Region.java:1559)
    at javafx.scene.control.skin.VirtualFlow.resizeCellSize(VirtualFlow.java:1863)
    at javafx.scene.control.skin.VirtualFlow.addTrailingCells(VirtualFlow.java:2043)
    at javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1253)
    at javafx.scene.control.skin.VirtualFlow$5.invalidated(VirtualFlow.java:837)
    at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:113)
    at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:148)
    at javafx.scene.control.skin.VirtualFlow.setCellCount(VirtualFlow.java:855)
    at javafx.scene.control.skin.TableViewSkinBase.updateItemCount(TableViewSkinBase.java:549)
    at javafx.scene.control.skin.VirtualContainerBase.checkState(VirtualContainerBase.java:170)
    at javafx.scene.control.skin.VirtualContainerBase.layoutChildren(VirtualContainerBase.java:145)
    at javafx.scene.control.skin.TableViewSkinBase.layoutChildren(TableViewSkinBase.java:407)
    at javafx.scene.control.Control.layoutChildren(Control.java:601)
    at javafx.scene.Parent.layout(Parent.java:1204)
    at javafx.scene.Parent.layout(Parent.java:1211)
    at javafx.scene.Parent.layout(Parent.java:1211)
    at javafx.scene.Parent.layout(Parent.java:1211)
    at javafx.scene.Parent.layout(Parent.java:1211)
    at javafx.scene.Parent.layout(Parent.java:1211)
    at javafx.scene.Parent.layout(Parent.java:1211)
    at javafx.scene.Parent.layout(Parent.java:1211)
    at javafx.scene.Scene.doLayoutPass(Scene.java:576)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2482)
    at com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:412)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:411)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:438)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:519)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:499)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:492)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)

After this, the bottom right panel of REBL is no longer usable: it either resizes to 0x0/hides/or something else, but I can no longer read the contents.

deps.edn:

:rebl {:extra-deps {com.cognitect/rebl              {:local/root "/Users/jelmer/bin/REBL-0.9.149.jar"}
                               org.clojure/core.async        {:mvn/version "0.4.490"}
                               org.openjfx/javafx-fxml       {:mvn/version "11.0.2"}
                               org.openjfx/javafx-controls {:mvn/version "11.0.2"}
                               org.openjfx/javafx-swing     {:mvn/version "11.0.2"}
                               org.openjfx/javafx-base       {:mvn/version "11.0.2"}
                               org.openjfx/javafx-web        {:mvn/version "11.0.2"}}
           :main-opts  ["-m" "cognitect.rebl"]}}}

Java version: openjdk version "11.0.1" 2018-10-16 OpenJDK Runtime Environment 18.9 (build 11.0.1+13) OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

seancorfield commented 4 years ago

I see this happening with openjfx 11.0.2 and 14.0.1 as well. I can reproduce it fairly reliably but it's not a simple set of steps -- it's more to do with how fast you perform certain steps it seems.

  1. Fire up REBL
  2. (require '[clojure.reflect :as r])
  3. (r/reflect {:a 1})
  4. Switch to the browse pane
  5. Navigate right as far as you can (five times, should get you to nil)
  6. Navigate left twice
  7. Repeatedly navigate right and then left
  8. If you do that often enough and/or fast enough it should trigger the stacktrace
  9. At that point the bottom right pane will either be blank or show the value in a smaller area, with blank grey space below and to the right -- and REBL never fully recovers so you have to restart the UI.
jelmerderonde commented 4 years ago

@seancorfield , great that you've managed to find the steps to reproduce the issue. To me it always seemed sort of random.

puredanger commented 4 years ago

Seems like this is https://bugs.openjdk.java.net/browse/JDK-8217953 Reported fixed in https://bugs.openjdk.java.net/browse/JDK-8244112 recently for javafx15 (don't see backport)

seancorfield commented 4 years ago

I just tried OpenJFX 15 early access 6 and I can no longer repro this:

                org.openjfx/javafx-fxml     {:mvn/version "15-ea+6"}
                org.openjfx/javafx-controls {:mvn/version "15-ea+6"}
                org.openjfx/javafx-graphics {:mvn/version "15-ea+6"}
                org.openjfx/javafx-media    {:mvn/version "15-ea+6"}
                org.openjfx/javafx-swing    {:mvn/version "15-ea+6"}
                org.openjfx/javafx-base     {:mvn/version "15-ea+6"}
                org.openjfx/javafx-web      {:mvn/version "15-ea+6"}
jelmerderonde commented 4 years ago

Thanks for this @puredanger! After changing my javafx dependencies the bug no longer occurs. I think this can be closed?

puredanger commented 4 years ago

Thanks! We are working on a release with updated deps and I'll close it when that's out.

puredanger commented 4 years ago

REBL 0.9.226 provides pre-built deps.edn files that pull in OpenJavaFX 15-ea6 - see https://github.com/cognitect-labs/REBL-distro#usage for more details.