"getNativeWindowHandle+0x54" on Gluon JavaFX 16 EA 4 via DRM - javafx

I was following the steps given at Gluon Documentation to run JavaFX on Raspberry Pi 4 via DRM. I downloaded the JavaFX EA 16 builds from here.
javafx.properties file :
javafx.version=16-internal
javafx.runtime.version=16-internal+28-2020-11-10-180413
javafx.runtime.build=28
After cloning the samples repository containing hellofx, I compiled it via javac (according to the steps) and then ran this command to run it using DRM:
sudo -E java -Dmonocle.platform=EGL -Djava.library.path=/opt/arm32hfb-sdk/lib -Dmonocle.egl.lib=/opt/arm32fb-sdk/lib/libgluon_drm.so --module-path /opt/arm32fb-sdk/lib --add-modules javafx.controls -cp dist/. hellofx.HelloFX
However, this caused the following error :
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x9c3314dc, pid=734, tid=746
#
# JRE version: OpenJDK Runtime Environment (11.0.9+11) (build 11.0.9+11-post-Raspbian-1deb10u1)
# Java VM: OpenJDK Server VM (11.0.9+11-post-Raspbian-1deb10u1, mixed mode, serial gc, linux-)
# Problematic frame:
# C [libgluon_drm.so+0x14dc] getNativeWindowHandle+0x54
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/pi/samples/CommandLine/Modular/CLI/hellofx/hs_err_pid734.log
#
# If you would like to submit a bug report, please visit:
# Unknown
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted
It seems that while loading libgluon_drm.so in JavaFXSDK/lib/ fails at getNativeWindowHandle
What's weird is that after I ran sudo apt install libegl* mesa* libgl*, it actually succeeded but was asking me to set variable ENABLE_GLUON_COMMERCIAL_EXTENSIONS as true, which I had already done.
However, after rebooting, it started showing the same error.
I am using a Raspberry Pi 4 Model B with 2GB RAM. It is running on Raspberry Pi OS 32-Bit with desktop.
I had performed all of this on a clean installation.

Pi4 has both vc4 for render, and v3d for 3D. You can probe the devices for their capabilities - only one should acknowledge that it has DRIVER_RENDER or DRIVER_MODESET capabilities.
Pi4 DRM questions
The card which JavaFX selects by default is /dev/dri/card1. In my case, /dev/dri/card0 was the one to be used for render, and not card1. I solved the issue by using the following runtime argument :
-Degl.displayid=/dev/dri/card0
The JavaFX Version I used was 16-ea+5.

Related

R Suicide : Fatal error: unable to initialize the JIT

I have installed R on my windows server 2019 and installed Rcpp package, then compressed its installation to a zip file (R-4.0.2.zip).
In a C++ application on another machine, I decompress this R-4.0.2.zip, set R_HOME and PATH to point to the extracted directory and /bin/x64, respectively. I then load R.dll to run a simple R script.
I have run this application on my machine using the extracted R-4.0.2.zip and also another machine with no pre-installation of R where I have access to its graphical user interface. However, when I run it on another machine (server), which I don't have access to its graphical interface, the R suicides itself with a message in a messagebox (that I can only see with a windows debugger from its dump).
Fatal error: unable to initialize the JIT
user32!SoftModalMessageBox+0x228b [d:\xx\windows\core\ntuser\client\msgbox.c # 1235]
user32!MessageBoxWorker+0x2ec [d:\xx\windows\core\ntuser\client\msgbox.c # 782]
user32!MessageBoxTimeoutW+0xd5 [d:\xx\windows\core\ntuser\client\msgbox.c # 439]
user32!MessageBoxTimeoutA+0x102 [d:\xx\windows\core\ntuser\client\msgbox.c # 483]
user32!MessageBoxExA+0x10 [d:\xx\windows\core\ntuser\client\msgbox.c # 369]
user32!MessageBoxA+0x4e [d:\xx\windows\core\ntuser\client\msgbox.c # 342]
R!R_Suicide+0x39
R!setup_Rmainloop+0x954
Any idea what could be the potential problem for this? do I need to install a specific package such as Rserve, any specific firewall rule? [the CPP application and R script run on the same machine though]

Windows Subsytem for Linux - running applications that use openGL

I am able to run a number of GUI applications successfully on windows subsystem for linux (WSL), Ubuntu 14.04.4 LTS, using X-forwarding (via MobaXterm).
I recently tried to run an application that uses OpenGL. Although the GUI opens, there are a number of errors and some aspects of the GUI don't work properly. The errors are:
QT error: 1
QT error: <PyQt5.QtCore.QMessageLogContext object at 0x7f88e21d9ba8>
QT error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
libGL error: failed to load driver: swrast
I can get rid of the swrast error by setting export LIBGL_ALWAYS_INDIRECT=1 but the other errors remain:
QT error: 1
QT error: <PyQt5.QtCore.QMessageLogContext object at 0x7fed3689e828>
QT error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
A typical error when attempting to use part of the GUI is:
WARNING: QT error: 1 (Gui.qtMessageHandler:51)
WARNING: QT error: <PyQt5.QtCore.QMessageLogContext object at 0x7f9b35e7b6d8> (Gui.qtMessageHandler:51)
WARNING: QT error: QOpenGLWidget: Failed to make context current (Gui.qtMessageHandler:51)
I can run glxgears, but I realise this only checks a fraction of OpenGLs functions. If I run glmark2 I get the following:
glmark2
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
Error: Glmark2 needs OpenGL(ES) version >= 2.0 to run (but version string is: '1.4 (4.0.0 - Build 10.18.10.4358)')!
Error: main: Could not initialize canvas
If I run find /usr -iname "*libGL.so*" -exec ls -l -- {} + suggested on this link https://askubuntu.com/questions/541343/problems-with-libgl-fbconfigs-swrast-through-each-update I get the following output but I'm not sure if this indicates an error or not?
lrwxrwxrwx 1 root root 14 Jan 12 2016 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0
-rw-r--r-- 1 root root 413968 Jan 12 2016 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
Running glxinfo seems to indicate the on-chip graphics card is used (there is a separate AMD graphics card but I don't think it's necessary to use that).
glxinfo | grep render
direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
OpenGL renderer string: Intel(R) HD Graphics 4000
How can I successfully run OpenGL applications via WSL?

RPM build fails locating libelf.so.dts.1 when using Developer Toolset 7

I am compiling software for Red Hat/CentOS 7 (running on CentOS) using the compiler from Developer Toolset 7, and when I try to create an RPM, rpmbuild fails with the following error:
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/peter/src/foo/rpmbuild/BUILD/mypackage-5.4.0_10_243_g2564bd2ee3
extracting debug info from /home/peter/rpmbuild/BUILDROOT/mypackage-5.4.0_10_243_g2564bd2ee3-1.x86_64/path/to/my/bin/binary
eu-strip: error while loading shared libraries: libelf.so.dts.1: cannot open shared object file: No such file or directory
I did not see this using Toolset 3, and basically all I did was to change the 3 in my build script to a 7.
EDIT: If I disable extraction of debug information (%define debug_package %{nil}), I do not get the error.

JDK 9 SIGSEGV Fatal Error

Running eclipse plugin with a WebView component ends with SIGSEGV error, which happens to be an ancient bug as in here.
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000013a06a254, pid=23881, tid=775
#
# JRE version: Java(TM) SE Runtime Environment (9.0+11) (build 9.0.4+11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (9.0.4+11, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# C [libjfxwebkit.dylib+0x5ff254] WebCore::FrameTree::top() const+0x4
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Applications/Eclipse.app/Contents/MacOS/hs_err_pid23881.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
Is there any new configuration or vm parameter we are missing specific to Java 9 ?

JVM crashes after one successful request when using JRI

I am using the JRI api to use "R" in Java. I have created a web-service which has the JRI code . When I consume this web-service for the first time it works properly, but with a subsequent request the JVM crashes and says : "The crash happened outside the Java Virtual Machine in native code."
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (0xc0000029), pid=9148, tid=9716
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) Client VM (20.1-b02 mixed mode windows-x86 )
# Problematic frame:
# C [ntdll.dll+0x8e1b9]
#
# An error report file with more information is saved as:
# C:\Users\ambarish\.netbeans\dev\config\GF3\domain1\hs_err_pid9148.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
Is this somehow connected to the fact that R has no threading support, you can run only one instance of R within a multi-threaded application?
I am using Rengine to run R scripts in Java, I tried to stop/destroy the Rengine object but it did not work. How can I make sure that Rengine instance is garbage-collected before the second request.
Please let me know how can I solve this issue.
One can only create a single instance of Rengine using JRI. So use Rserve instead, which supports threading.

Resources