[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: JDK-8298104: NPE on synchronizeSceneNodes()
From:       John Hendrikx <jhendrikx () openjdk ! org>
Date:       2023-12-22 10:40:51
Message-ID: U_eri1DuyJ6epHsxeoA_4kSdYuDsPxhOID8Kp4hF6ds=.b8248485-e6aa-42da-b6dc-3ed2da3e3bcc () github ! com
[Download RAW message or body]

On Wed, 3 May 2023 11:46:50 GMT, Daniel <duke@openjdk.org> wrote:

> A null pointer exception occurs on the ScenePulseListener when iterating through \
> the dirty node list. A null check is needed on the node before calling \
> node.getScene(). 
> The error occurs occasionally and causes the application to crash.
> 
> Issue: [JDK-8298104: NPE on \
> synchronizeSceneNodes()](https://bugs.openjdk.org/browse/JDK-8298104)

If you are not using modules, you don't need to compile javafx.graphics to attempt to \
analyze the problem.  You can include a copy of `Scene` with your sources (making \
sure that it is in the original package `javafx.scene`) to debug this further.

If you can reproduce this problem in a small program that you can share, we can try \
and find out why there is a NPE there -- if only a single thread is using the \
`dirtyNodes` array, I don't think there can be a `null` in there, but perhaps there \
is a mistake in the code.

As noted before, a possible cause of this problem is accessing FX components that are \
currently part of the Scene graph on the wrong thread.  This is not allowed, and such \
accesses must be wrapped in `Platform::runLater`.  I realize that in a large \
application it might be hard to find what is doing this, but if you have multiple \
threads, then inspect if any thread is accessing FX components (like `Node`s, \
`Timeline`s, etc) directly.  Not all such calls will inform you of problems, so \
assuming that a call is allowed because you didn't get an exception is incorrect.

edit: feel free to contact me more directly (gmail john.hendrikx)

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1123#issuecomment-1867524649


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic