fusesource / jansi

Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
http://fusesource.github.io/jansi/
Apache License 2.0
1.1k stars 139 forks source link

JVM crash on C library init #282

Open tkrah opened 5 months ago

tkrah commented 5 months ago

Hi,

I tried running a spring-shell project from gradles bootRun task in non-interactive mode, but the JVM is just crashing:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f1a692c967e, pid=78732, tid=78736
#
# JRE version: OpenJDK Runtime Environment (17.0.9+9) (build 17.0.9+9-Ubuntu-122.04)
# Java VM: OpenJDK 64-Bit Server VM (17.0.9+9-Ubuntu-122.04, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x8c967e]  jni_SetStaticIntField+0xae
Stack: [0x00007f1a68500000,0x00007f1a68600000],  sp=0x00007f1a685f81b0,  free space=992k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x8c967e]  jni_SetStaticIntField+0xae
C  [libjansi.so+0x1b56]  Java_org_fusesource_jansi_internal_CLibrary_init+0x36

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.fusesource.jansi.internal.CLibrary.init()V+0
j  org.fusesource.jansi.internal.CLibrary.<clinit>()V+12
v  ~StubRoutines::call_stub
j  org.jline.terminal.impl.jansi.JansiNativePty.isPosixSystemStream(Lorg/jline/terminal/spi/SystemStream;)Z+4
j  org.jline.terminal.impl.jansi.JansiTerminalProvider.isPosixSystemStream(Lorg/jline/terminal/spi/SystemStream;)Z+1
j  org.jline.terminal.impl.jansi.JansiTerminalProvider.isSystemStream(Lorg/jline/terminal/spi/SystemStream;)Z+14
j  org.jline.terminal.TerminalBuilder.checkProvider(Ljava/lang/String;Ljava/lang/IllegalStateException;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;)V+56
j  org.jline.terminal.TerminalBuilder.getProviders(Ljava/lang/String;Ljava/lang/IllegalStateException;)Ljava/util/List;+56
j  org.jline.terminal.TerminalBuilder.doBuild()Lorg/jline/terminal/Terminal;+120
j  org.jline.terminal.TerminalBuilder.build()Lorg/jline/terminal/Terminal;+19
j  org.springframework.shell.boot.JLineShellAutoConfiguration.terminal(Lorg/springframework/beans/factory/ObjectProvider;)Lorg/jline/terminal/Terminal;+30
v  ~StubRoutines::call_stub

I don't know what the error here is but it should not crash the JVM, better bail with some exception what's unexpected in that setup.