I have observed that a large JavaFX application seems to work
correctly at first but then suddenly all text on all controls turns white and
white on white or light grey is not really readable anymore. I've never observed
such a behaviour on any other VM before. There is also no error message or
warning associated with this. It just happens.
This is for an application just running on the GraalVM and not via native-image!
Others have reported this same issue on Twitter too, although with a different color.
Some more observations:
This behaviour was observed on a MacBook Pro with Retina display on macOS 10.14.6.
All controls seem to be affected by this problem but a pure Text object, which had its color set explicitly in the code was not affected.
Another observation is that the application is still fully functional and when you work with it, the colors sometimes reappear and then vanish again after a few seconds. It's a mystery.
Up to know I have not been able to reproduce this behaviour in a small test case (just in case somone should ask.)
Hi @mipastgt , is this on GraalVM CE or EE? Does the application behave correctly on OpenJDK 11?
This was on GraalVM CE and yes, the application runs correctly on OpenJDK 11 (actually on all other VMs ranging from 11 to 14 EA).
Here is another reference to this issue:
https://twitter.com/dlemmermann/status/1197420548701208576
I just ran the test on the EE edition too. The result is technically the same, just the color is different. With the EE edition the switch is to cyan instead of white.

This is indeed a very strange failure mode. To help narrow it down, can you please disable the Graal compiler (-XX:-UseJVMCICompiler) and see if the problem still occurs.
Just checked this. Without the above flag I can reliably reproduce the error within a few seconds of operating the app. With the above flag set I cannot reproduce the error anymore.
As reported here on the openjfx-dev mailing list
https://mail.openjdk.java.net/pipermail/openjfx-dev/2019-November/024091.html
the bug can also be reproduced on Linux.
I think this is going to get very hard to investigate without a reproducer. Are you aware of any free JavaFX apps that we could use to reproduce this? Best of course would be one that you've confirmed it reproduces on.
Until then, the workaround is to use -XX:-UseJVMCICompiler.
Unfortunately I do not yet have such an example and the next few days I will also not be able to search for one due to other responsibilities. So, if someone else should find one in the meantime, please report it here.
Concerning the workaround: Using the GraalVM as a regular VM is of course just the preparation for the next step which is to create a native image and I fear that the workaround will then not be applicable.
I have found a little program which can reproduce the bug.
mvn compile javafx:runThanks for the reproducer @mipastgt . Could you check if running your application with -Dgraal.GraalArithmeticStubs=false makes the problem go away?
Yes, I can confirm that with this option I cannot reproduce the problem anymore. I cross-checked it twice with my full application. This seems to pin-point the root of the problem.
Hi @mipastgt , would it be possible for you to build Graal and test whether https://github.com/oracle/graal/commit/12f6d0eddb045527767943ef716267c4c751763d addresses the issue?
@mur47x111 I fear that is a little bit beyond my knowledge and time budget. But if you could point me to a nightly build or so for the macOS-version of the GraalVM, then I would be more than happy to give it a try.
Please re-open if not fixed in the next GraalVM release.
I can confirm that this bug seems to be fixed in 19.3.0.2. Thanks a lot.
Most helpful comment
I can confirm that this bug seems to be fixed in 19.3.0.2. Thanks a lot.