SpaiR / imgui-java

JNI based binding for Dear ImGui
MIT License
587 stars 90 forks source link

Bug: Looks like colorEdit4 crashes the JVM? #139

Closed ghost closed 1 year ago

ghost commented 1 year ago

Version

The latest one

What happened?

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fa6f1e8a9c0, pid=74922, tid=74928
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.4.1+1 (17.0.4.1+1) (build 17.0.4.1+1)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (17.0.4.1+1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x28a9c0]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /mnt/menel/run/core.74922)
#
# An error report file with more information is saved as:
# /mnt/menel/run/hs_err_pid74922.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
#

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

Reproduction

Create a new imgui application with this as a element:

static float color[];

ImGui.colorEdit4("Color editor", color, 0);

Relevant log output

No response

SpaiR commented 1 year ago

I believe that every imgui method expects to accept an initialized array. Try to init your static var with new float[4].

ghost commented 1 year ago

I believe that every imgui method expects to accept an initialized array. Try to init your static var with new float[4].

Yeah, that was it. Thank you :)