JDK-8298104 : NPE on synchronizeSceneNodes()
  • Type: Bug
  • Component: javafx
  • Sub-Component: scenegraph
  • Affected Version: jfx19
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2022-12-02
  • Updated: 2024-07-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
A null pointer exception occurs on the ScenePulseListener when iterating through the dirty node list:

for (int i = 0 ; i < dirtyNodesSize; ++i) {
  Node node = dirtyNodes[i];
  dirtyNodes[i] = null;
  if (node.getScene() == Scene.this) node.syncPeer();
}

A null check is needed on the node before calling node.getScene()

Note: this bug was previously reported on JDK 8 and marked as fixed:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8095034

The latest code does not preform this check.

The original bug mentions that this is a symptom and not a cause, but there does not appear to be any way to determine the cause in this case.

In some cases, this happens so frequently that the application locks up and the end user needs to restart.  I have downloaded the JFX project from git hub and manually patched which solves the problem.

A one line fix would be greatly appreciated (and/or an explanation of what the cause could be).


CUSTOMER SUBMITTED WORKAROUND :
I have manually downloaded the GITHub project and added the NPE check.  This fixes the issue.

FREQUENCY : occasionally



Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1123 Date: 2023-05-03 11:46:50 +0000
09-07-2024

This seems like a rare corner case scenario. Adding a null check blindly would be like just avoiding the side effect. Cause could be in application or in JavaFX, but hard to say anything without a test program or the scenario when this issue occurs.
02-01-2023

Relates to JDK-8095034
05-12-2022