You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently learning JNR by trying out various Linux libraries, most recently GTK3. I used this example as a reference and wrote the new demo that can be found here. But it crashes badly when I try to run it (using ./gradlew gtk3:run). Here's the crash log: hs_err_pid10169.log. I use GraalVM 21.3.0 as my JDK 11 on a x86_64 Linux machine (openSUSE tumbleweed). My installed GTK version is 3.24.30-2.3.
I can see that it crashes on line 31 of Gtk3App.java where I call from Java
which is supposed to act like a function pointer similar to on_app_activate from my C reference:
// callback function which is called when application is first startedstaticvoidon_app_activate(GApplication*app, gpointerdata) {
// create a new application window for the application// GtkApplication is sub-class of GApplication// downcast GApplication* to GtkApplication* with GTK_APPLICATION() macroGtkWidget*window=gtk_application_window_new(GTK_APPLICATION(app));
// a simple push buttonGtkWidget*btn=gtk_button_new_with_label("Click Me!");
// connect the event-handler for "clicked" signal of buttong_signal_connect(btn, "clicked", G_CALLBACK(on_button_clicked), NULL);
// add the button to the windowgtk_container_add(GTK_CONTAINER(window), btn);
// display the windowgtk_widget_show_all(GTK_WIDGET(window));
}
You can use https://github.com/praj-foss/jnr-demo to reproduce it using ./gradlew gtk3:run. The crash depends on the system as well: it ran perfectly fine on openSUSE leap 15.2, Mac OS, and Fedora Core 34 (verified by @headius and @enebo), but it crashed on openSUSE Tumbleweed and Ubuntu 21.10.
Note the difference between this issue and jnr/jnr-ffi#281 is that the latter turned out to be mostly due to a mistake in the client code that caused a bad pointer to be passed out to C. Fixing that fixed the issue for me and @enebo but exposed a new crash within jffi for @praj-foss. I asked them to re-open as a jffi issue so we could investigate the problem.
Hello there!
I'm currently learning JNR by trying out various Linux libraries, most recently GTK3. I used this example as a reference and wrote the new demo that can be found here. But it crashes badly when I try to run it (using
./gradlew gtk3:run
). Here's the crash log: hs_err_pid10169.log. I use GraalVM 21.3.0 as my JDK 11 on a x86_64 Linux machine (openSUSE tumbleweed). My installed GTK version is 3.24.30-2.3.I can see that it crashes on line 31 of
Gtk3App.java
where I call from JavaThe
onActivate
is a lambda looking like this:which is supposed to act like a function pointer similar to
on_app_activate
from my C reference:You can use https://github.com/praj-foss/jnr-demo to reproduce it using
./gradlew gtk3:run
. The crash depends on the system as well: it ran perfectly fine on openSUSE leap 15.2, Mac OS, and Fedora Core 34 (verified by @headius and @enebo), but it crashed on openSUSE Tumbleweed and Ubuntu 21.10.NOTE: This issue was earlier opened in jnr/jnr-ffi#281
The text was updated successfully, but these errors were encountered: