Skip to content

javafx IndexOutOfBoundsException #4001

Closed

Description

@mdavidsaver

After updating to 5de3627 today I had phoebus become unresponsive with the following exception message being repeated at a high rate. Any idea what I can do to gather more information if/when this situation repeats?

Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
        at java.base/java.util.Objects.checkIndex(Objects.java:365)
        at java.base/java.util.ArrayList.get(ArrayList.java:428)
        at javafx.scene.Parent.updateCachedBounds(Parent.java:1772)
        at javafx.scene.Parent.recomputeBounds(Parent.java:1716)
        at javafx.scene.Parent.doComputeGeomBounds(Parent.java:1569)
        at javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:116)
        at com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:84)
        at com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:104)
        at javafx.scene.Node.updateGeomBounds(Node.java:3939)
        at javafx.scene.Node.getGeomBounds(Node.java:3901)
        at javafx.scene.Node.getLocalBounds(Node.java:3849)
        at javafx.scene.Node.updateTxBounds(Node.java:4003)
        at javafx.scene.Node.getTransformedBounds(Node.java:3795)
        at javafx.scene.Node.updateBounds(Node.java:859)
        at javafx.scene.Parent.updateBounds(Parent.java:1903)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Parent.updateBounds(Parent.java:1901)
        at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2691)
        at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:380)
        at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:401)
        at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:592)
        at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:572)
        at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:565)
        at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$0(QuantumToolkit.java:346)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$0(GtkApplication.java:242)
        at java.base/java.lang.Thread.run(Thread.java:1474)

Activity

  1. shroffk commented on Nov 2, 2026

    @shroffk
    Member

    The change has been reverted and we are going to be implementing the feature using a different strategy.

    Can you verify that the above problem is resolved.

  2. mdavidsaver commented on Nov 2, 2026

    @mdavidsaver
    ContributorAuthor

    I have updated to 5c0a71b, and will reopen this ticket if I see a repeat.

  3. emilioheredia-source commented on Nov 11, 2026

    @emilioheredia-source

    Thanks for reporting this, and for keeping an eye out for a repeat.

    I went through #3929 again to check whether it could have caused this, and I don't think it could:

    • It changes no JavaFX scene graph code. RTTank is a Canvas (a leaf node, no children). The changed code computes the fill and limit-line positions in AWT Graphics2D drawing into a BufferedImage on the plot's update thread. LinearTicks/LogTicks only change how the label strings are formatted.
    • The trace fails in Parent.updateCachedBounds() while walking a parent's children. In my experience that happens when a child list is changed off the FX thread, or changes during a bounds pass. A Canvas drawing an image can't do either.
    • The trace has no Phoebus frames, so it doesn't point at a specific widget.

    The merge commit 5de3627 also brought in everything since your previous update. So if it does come back on a build without #3929, the commit range between the two builds would be a good place to start. A thread dump (jstack <pid>) taken while it's spinning would show what else is running at that moment.

    The inverted scale is now back as a separate inverted_scale property, as suggested in #3996: #4016.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions