Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenJDK 8-only JVM crash #12119

Open
juanputrerasm opened this issue Feb 23, 2022 · 25 comments
Open

OpenJDK 8-only JVM crash #12119

juanputrerasm opened this issue Feb 23, 2022 · 25 comments

Comments

@juanputrerasm
Copy link

I am getting a JVM crash only on OpenJDK 8. Standard JDK 8 works fine, and I wonder if is this a dependency issue.

Expected behavior

No JVM crash

Actual behavior

JVM crash / SIGSEGV

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001105f5bd8, pid=9249, tid=0x000000000000a503
#
# JRE version: OpenJDK Runtime Environment (8.0_312) (build 1.8.0_312-bre_2022_01_01_23_04-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.312-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x545bd8]  Unsafe_SetByte+0x61

---------------  T H R E A D  ---------------
Current thread (0x00007fb601c1e000):  JavaThread "reactor-http-nio-2" daemon [_thread_in_vm, id=42243, stack(0x0000700008fad000,0x00007000090ad000)]

Stack: [0x0000700008fad000,0x00007000090ad000],  sp=0x00007000090aa730,  free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x545bd8]  Unsafe_SetByte+0x61
j  sun.misc.Unsafe.putByte(Ljava/lang/Object;JB)V+0
j  io.netty.util.internal.PlatformDependent0.putByte(Ljava/lang/Object;JB)V+6
j  io.netty.util.internal.PlatformDependent.putByte(Ljava/lang/Object;JB)V+3
j  io.netty.buffer.ByteBufUtil.unsafeWriteUtf8([BJILjava/lang/CharSequence;II)I+73
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;II)I+79
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;I)I+7
j  io.netty.buffer.AbstractByteBuf.setCharSequence0(ILjava/lang/CharSequence;Ljava/nio/charset/Charset;Z)I+55
j  io.netty.buffer.AbstractByteBuf.writeCharSequence(Ljava/lang/CharSequence;Ljava/nio/charset/Charset;)I+8
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpRequest;)V+144
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpMessage;)V+6
j  io.netty.handler.codec.http.HttpObjectEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+88
j  io.netty.handler.codec.http.HttpClientCodec$Encoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+52
j  io.netty.handler.codec.MessageToMessageEncoder.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+25
j  io.netty.channel.CombinedChannelDuplexHandler.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+45
j  io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.write(Ljava/lang/Object;ZLio/netty/channel/ChannelPromise;)V+90
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;+4
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+6
j  io.netty.channel.DefaultChannelPipeline.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  io.netty.channel.AbstractChannel.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  reactor.netty.http.HttpOperations.lambda$send$0(Lio/netty/buffer/ByteBuf;)Lreactor/core/publisher/Mono;+106
j  reactor.netty.http.HttpOperations$$Lambda$252.apply(Ljava/lang/Object;)Ljava/lang/Object;+8
j  reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(Ljava/lang/Object;)V+31
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(Ljava/lang/Object;)V+112
j  reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(Ljava/lang/Object;)V+5
j  reactor.core.publisher.Operators$ScalarSubscription.request(J)V+29
j  reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.request(J)V+5
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(J)V+5
j  reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(Lorg/reactivestreams/Subscription;)V+15
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+24
j  reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+36
j  reactor.core.publisher.MonoJust.subscribe(Lreactor/core/CoreSubscriber;)V+9
j  reactor.core.publisher.Mono.subscribe(Lorg/reactivestreams/Subscriber;)V+71
j  reactor.core.publisher.FluxConcatIterable$ConcatIterableSubscriber.onComplete()V+157
j  reactor.core.publisher.FluxConcatIterable.subscribe(Lreactor/core/CoreSubscriber;)V+62
j  reactor.core.publisher.MonoFromFluxOperator.subscribe(Lreactor/core/CoreSubscriber;)V+33
j  reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(Ljava/lang/Object;)V+160
j  reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(Ljava/lang/Object;)V+17
j  reactor.core.publisher.Operators$MonoInnerProducerBase.complete()V+61
j  reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete()V+96
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete()V+17
j  reactor.core.publisher.Operators$ScalarSubscription.request(J)V+43
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(J)V+5
j  reactor.core.publisher.MonoSingle$SingleSubscriber.doOnRequest(J)V+7
j  reactor.core.publisher.Operators$MonoInnerProducerBase.request(J)V+44
j  reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Lorg/reactivestreams/Subscription;)V+92
j  reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+2
j  reactor.core.publisher.MonoSingle$SingleSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+21
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+24
j  reactor.core.publisher.MonoJust.subscribe(Lreactor/core/CoreSubscriber;)V+9
j  reactor.core.publisher.InternalMonoOperator.subscribe(Lreactor/core/CoreSubscriber;)V+33
j  reactor.core.publisher.MonoDefer.subscribe(Lreactor/core/CoreSubscriber;)V+39
j  reactor.netty.http.client.HttpClientConnect$HttpIOHandlerObserver.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+98
j  reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+29
j  reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+23
j  reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnection.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+217
j  reactor.netty.channel.ChannelOperationsHandler.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+70
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.AbstractChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+6
j  io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+4
j  io.netty.channel.ChannelInboundHandlerAdapter.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+1
j  io.netty.channel.CombinedChannelDuplexHandler.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+43
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.AbstractChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+6
j  io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+1
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.DefaultChannelPipeline.fireChannelActive()Lio/netty/channel/ChannelPipeline;+4
j  io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(Lio/netty/channel/ChannelPromise;Z)V+36
j  io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect()V+51
j  io.netty.channel.nio.NioEventLoop.processSelectedKey(Ljava/nio/channels/SelectionKey;Lio/netty/channel/nio/AbstractNioChannel;)V+78
j  io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized()V+51
j  io.netty.channel.nio.NioEventLoop.processSelectedKeys()V+8
j  io.netty.channel.nio.NioEventLoop.run()V+263
j  io.netty.util.concurrent.SingleThreadEventExecutor$4.run()V+44
j  io.netty.util.internal.ThreadExecutorMap$2.run()V+11
j  io.netty.util.concurrent.FastThreadLocalRunnable.run()V+4
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x2c3702]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x688
V  [libjvm.dylib+0x2c25af]  JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x119
V  [libjvm.dylib+0x2c279b]  JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*)+0x57
V  [libjvm.dylib+0x331dd2]  thread_entry(JavaThread*, Thread*)+0x78
V  [libjvm.dylib+0x52e033]  JavaThread::thread_main_inner()+0x89
V  [libjvm.dylib+0x52def1]  JavaThread::run()+0x171
V  [libjvm.dylib+0x465c76]  java_start(Thread*)+0xf1
C  [libsystem_pthread.dylib+0x6514]  _pthread_start+0x7d
C  [libsystem_pthread.dylib+0x202f]  thread_start+0xf
C  0x0000000000000000

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.misc.Unsafe.putByte(Ljava/lang/Object;JB)V+0
j  io.netty.util.internal.PlatformDependent0.putByte(Ljava/lang/Object;JB)V+6
j  io.netty.util.internal.PlatformDependent.putByte(Ljava/lang/Object;JB)V+3
j  io.netty.buffer.ByteBufUtil.unsafeWriteUtf8([BJILjava/lang/CharSequence;II)I+73
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;II)I+79
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;I)I+7
j  io.netty.buffer.AbstractByteBuf.setCharSequence0(ILjava/lang/CharSequence;Ljava/nio/charset/Charset;Z)I+55
j  io.netty.buffer.AbstractByteBuf.writeCharSequence(Ljava/lang/CharSequence;Ljava/nio/charset/Charset;)I+8
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpRequest;)V+144
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpMessage;)V+6
j  io.netty.handler.codec.http.HttpObjectEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+88
j  io.netty.handler.codec.http.HttpClientCodec$Encoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+52
j  io.netty.handler.codec.MessageToMessageEncoder.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+25
j  io.netty.channel.CombinedChannelDuplexHandler.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+45
j  io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.write(Ljava/lang/Object;ZLio/netty/channel/ChannelPromise;)V+90
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;+4
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+6
j  io.netty.channel.DefaultChannelPipeline.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  io.netty.channel.AbstractChannel.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  reactor.netty.http.HttpOperations.lambda$send$0(Lio/netty/buffer/ByteBuf;)Lreactor/core/publisher/Mono;+106
j  reactor.netty.http.HttpOperations$$Lambda$252.apply(Ljava/lang/Object;)Ljava/lang/Object;+8
j  reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(Ljava/lang/Object;)V+31
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(Ljava/lang/Object;)V+112
j  reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(Ljava/lang/Object;)V+5
j  reactor.core.publisher.Operators$ScalarSubscription.request(J)V+29
j  reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.request(J)V+5
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(J)V+5
j  reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(Lorg/reactivestreams/Subscription;)V+15
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+24
j  reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+36
j  reactor.core.publisher.MonoJust.subscribe(Lreactor/core/CoreSubscriber;)V+9
j  reactor.core.publisher.Mono.subscribe(Lorg/reactivestreams/Subscriber;)V+71
j  reactor.core.publisher.FluxConcatIterable$ConcatIterableSubscriber.onComplete()V+157
j  reactor.core.publisher.FluxConcatIterable.subscribe(Lreactor/core/CoreSubscriber;)V+62
j  reactor.core.publisher.MonoFromFluxOperator.subscribe(Lreactor/core/CoreSubscriber;)V+33
j  reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(Ljava/lang/Object;)V+160
j  reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(Ljava/lang/Object;)V+17
j  reactor.core.publisher.Operators$MonoInnerProducerBase.complete()V+61
j  reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete()V+96
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete()V+17
j  reactor.core.publisher.Operators$ScalarSubscription.request(J)V+43
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(J)V+5
j  reactor.core.publisher.MonoSingle$SingleSubscriber.doOnRequest(J)V+7
j  reactor.core.publisher.Operators$MonoInnerProducerBase.request(J)V+44
j  reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Lorg/reactivestreams/Subscription;)V+92
j  reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+2
j  reactor.core.publisher.MonoSingle$SingleSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+21
j  reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(Lorg/reactivestreams/Subscription;)V+24
j  reactor.core.publisher.MonoJust.subscribe(Lreactor/core/CoreSubscriber;)V+9
j  reactor.core.publisher.InternalMonoOperator.subscribe(Lreactor/core/CoreSubscriber;)V+33
j  reactor.core.publisher.MonoDefer.subscribe(Lreactor/core/CoreSubscriber;)V+39
j  reactor.netty.http.client.HttpClientConnect$HttpIOHandlerObserver.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+98
j  reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+29
j  reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+23
j  reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnection.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+217
j  reactor.netty.channel.ChannelOperationsHandler.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+70
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.AbstractChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+6
j  io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+4
j  io.netty.channel.ChannelInboundHandlerAdapter.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+1
j  io.netty.channel.CombinedChannelDuplexHandler.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+43
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.AbstractChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+6
j  io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+1
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.DefaultChannelPipeline.fireChannelActive()Lio/netty/channel/ChannelPipeline;+4
j  io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(Lio/netty/channel/ChannelPromise;Z)V+36
j  io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect()V+51
j  io.netty.channel.nio.NioEventLoop.processSelectedKey(Ljava/nio/channels/SelectionKey;Lio/netty/channel/nio/AbstractNioChannel;)V+78
j  io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized()V+51
j  io.netty.channel.nio.NioEventLoop.processSelectedKeys()V+8
j  io.netty.channel.nio.NioEventLoop.run()V+263
j  io.netty.util.concurrent.SingleThreadEventExecutor$4.run()V+44
j  io.netty.util.internal.ThreadExecutorMap$2.run()V+11
j  io.netty.util.concurrent.FastThreadLocalRunnable.run()V+4
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

Register to memory mapping:

RAX=0x000000011078bf90: _ZN20SafepointSynchronize6_stateE+0 in /usr/local/Cellar/openjdk@8/1.8.0+312/libexec/openjdk.jdk/Contents/Home/jre/lib/server/libjvm.dylib at 0x00000001100b0000
RBX=0x00007fb601c1e000 is a thread
RCX=0x00007fb60a006005 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x00007000090aa730 is pointing into the stack for thread: 0x00007fb601c1e000
RBP=0x00007000090aa760 is pointing into the stack for thread: 0x00007fb601c1e000
RSI=0x0000000000000006 is an unknown value
RDI=0x00007000090aa730 is pointing into the stack for thread: 0x00007fb601c1e000
R8 =0x000000000000002f is an unknown value
R9 =0x00000000ffffffe0 is an unknown value
R10=0x0000000111b193db is at code_begin+859 in an Interpreter codelet
method entry point (kind = native)  [0x0000000111b19080, 0x0000000111b19a00]  2432 bytes
R11=0x0000000110575f85: throw_unsatisfied_link_error+0 in /usr/local/Cellar/openjdk@8/1.8.0+312/libexec/openjdk.jdk/Contents/Home/jre/lib/server/libjvm.dylib at 0x00000001100b0000
R12=0x0000000000000000 is an unknown value
R13={method} {0x000000012937ee68} 'putByte' '(Ljava/lang/Object;JB)V' in 'sun/misc/Unsafe'
R14=0x000000000000002f is an unknown value
R15=0x00007fb60a006005 is an unknown value

Steps to reproduce

JVM crashes with OpenJDK 8 312 (latest) . Oracle JDK 8 202 works fine.

I am using Spring boot Starter Webflux 2.6.3 (reactor-netty 1.10.5) and netty-resolver-dns-native-macos version 4.1.72.Final.

The only transitive dependencies I could not update were netty-handler and netty-codec-http (version 4.1.52.Final). They are used by netty-reactive-streams-http 2.0.5, which is the version that Amazon's netty-nio-client 2.17.134 uses (for Amazon s3 2.17.134, their latest version) I haven't tried yet updating them manually.

Screen Shot 2022-02-23 at 13 35 29
I attached a screenshot of my maven dependency hierarchy

Netty version

4.1.72.Final

JVM version (e.g. java -version)

OpenJDK 8 1.8.0_312

OpenJDK 64-Bit Server VM (25.312-b00) for bsd-amd64 JRE (1.8.0_312-bre_2022_01_01_23_04-b00)

OS version (e.g. uname -a)

Mac OS 12.0.1

@chrisvest
Copy link
Contributor

How easily are you able to recreate this crash?

I looked through the buffer implementations, and I don't see any obvious issue, assuming that there isn't a release of a direct, unsafe ByteBuf that is racing with a call to writeUtf8 with that same ByteBuf.

If you are able to trigger this issue reliably, it'd be interesting to have a debugger attached and see if we're writing to a byte[] or a direct memory address, based on the call graph.

@juanputrerasm
Copy link
Author

How easily are you able to recreate this crash?

I looked through the buffer implementations, and I don't see any obvious issue, assuming that there isn't a release of a direct, unsafe ByteBuf that is racing with a call to writeUtf8 with that same ByteBuf.

If you are able to trigger this issue reliably, it'd be interesting to have a debugger attached and see if we're writing to a byte[] or a direct memory address, based on the call graph.

By referencing the same libraries I mentioned in the main post, I was able to recreate the crash in this very simple test https://github.com/juanputrerasm/maven-test
The only requirements needed are a working POST endpoint (doesn't matter if the request/response is correct or not) and OpenJDK 8.

@Iam95a
Copy link

Iam95a commented Mar 2, 2022

i meet this problem too。os is mac monterey
hs_err_pid59583.log

@sumeetgajjar
Copy link

I am facing this problem too. I am trying to fetch Blobs from Azure Blob Storage using azure-storage-blob SDK which uses netty internally for handling HTTP transport.

Netty version: 4.1.72.Final
OS: macOS Monterey 12.1
JDK version:

openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-bre_2021_10_20_23_15-b00)
OpenJDK 64-Bit Server VM (build 25.312-b00, mixed mode)

Error message:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010eaabce8, pid=48749, tid=0x0000000000005803
#
# JRE version: OpenJDK Runtime Environment (8.0_312) (build 1.8.0_312-bre_2021_10_20_23_15-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.312-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x545ce8]

@jaGarcia
Copy link

Hitting same issue but stemming from Redisson's usage of netty:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j sun.misc.Unsafe.putByte(Ljava/lang/Object;JB)V+0 j io.netty.util.internal.PlatformDependent0.putByte(Ljava/lang/Object;JB)V+6 j io.netty.util.internal.PlatformDependent.putByte(Ljava/lang/Object;JB)V+3 j io.netty.buffer.ByteBufUtil.unsafeWriteUtf8([BJILjava/lang/CharSequence;II)I+73 j io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;II)I+79 j io.netty.buffer.ByteBufUtil.reserveAndWriteUtf8Seq(Lio/netty/buffer/ByteBuf;Ljava/lang/CharSequence;III)I+47 j io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/ByteBuf;Ljava/lang/CharSequence;)I+15 j org.redisson.client.handler.CommandEncoder.encode(Ljava/lang/Object;)Lio/netty/buffer/ByteBuf;+65 j org.redisson.client.handler.CommandEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Lorg/redisson/client/protocol/CommandData;Lio/netty/buffer/ByteBuf;)V+128 j org.redisson.client.handler.CommandEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/buffer/ByteBuf;)V+7

@jaGarcia
Copy link

@jaGarcia
Copy link

jaGarcia commented Mar 23, 2022

@chrisvest I attached a debugger and it appears to be a memory address

Screen Shot 2022-03-22 at 9 29 55 PM

Screen Shot 2022-03-22 at 9 30 00 PM

Screen Shot 2022-03-23 at 12 43 27 AM

@normanmaurer
Copy link
Member

@jaGarcia can you check if the buffer was released which means the refCnt is 0 ?

@jaGarcia
Copy link

At the exact same breakpoint I see refCnt == 1

Screen Shot 2022-03-23 at 9 58 36 AM

@jaGarcia
Copy link

Actually, little weirder than that -- middle section shows refCnt == 2, while the Watcher section shows == 1

Screen Shot 2022-03-23 at 10 00 32 AM

@jaGarcia
Copy link

I think this may be isolated to the homebrew openjdk@8 version 1.8.0+322. I'm not getting this error in AdoptOpenJDK 1.8 (b252) or Temurin 1.8 (b322). I'm now running into another SIGSEGV error but it doesn't appear to be coming from any netty resources...

@chrisvest
Copy link
Contributor

@juanputrerasm The reproducer you posted connects to something on localhost:8080. Did you intend for that connection to be refused, or is the reproducer expected to find something there?

@jaGarcia
Copy link

Hello!

My reporting here was a part of a multi-day JVM crashing bonanza-debugging session. Once i got past this part I ran into an error in grails 5 that is definitively stemming from our use of the springloaded agent. I haven't gone back to see if that was also causing my problem here with openJDK8 but figured it was worth mentioning to those following this thread just in case.

adding the following to dependencies {} in build.gradle caused the problem I reported here
agent "org.springframework:springloaded:1.3.0.BUILD-20210404.024037-2"

@juanputrerasm
Copy link
Author

juanputrerasm commented Mar 31, 2022

@juanputrerasm The reproducer you posted connects to something on localhost:8080. Did you intend for that connection to be refused, or is the reproducer expected to find something there?

@chrisvest the connection was intended to work, it can be anything; a GET, POST, an empty response body, etc. but it must work.
The crash will not be triggered if the connection is refused.

@qinghui-xu
Copy link

I have exactly the same problem with OpenJDK 8.0_302 (build 1.8.0_302-bre_2021_07_21_23_11-b00) under MacOS (Big Sur)

Stack: [0x000070000c78c000,0x000070000c88c000],  sp=0x000070000c889e90,  free space=1015k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x545faa]  Unsafe_SetByte+0x61
j  sun.misc.Unsafe.putByte(Ljava/lang/Object;JB)V+0
j  io.netty.util.internal.PlatformDependent0.putByte(Ljava/lang/Object;JB)V+6
j  io.netty.util.internal.PlatformDependent.putByte(Ljava/lang/Object;JB)V+3
j  io.netty.buffer.ByteBufUtil.unsafeWriteUtf8([BJILjava/lang/CharSequence;II)I+73
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;II)I+79
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;I)I+7
j  io.netty.buffer.AbstractByteBuf.setCharSequence0(ILjava/lang/CharSequence;Ljava/nio/charset/Charset;Z)I+55
j  io.netty.buffer.AbstractByteBuf.writeCharSequence(Ljava/lang/CharSequence;Ljava/nio/charset/Charset;)I+8
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpRequest;)V+144
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpMessage;)V+6
j  io.netty.handler.codec.http.HttpObjectEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+88
j  io.netty.handler.codec.http.HttpClientCodec$Encoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+52
j  io.netty.handler.codec.MessageToMessageEncoder.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+25
j  io.netty.channel.CombinedChannelDuplexHandler.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+45
j  io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.write(Ljava/lang/Object;ZLio/netty/channel/ChannelPromise;)V+90
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;+4
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+6
j  io.netty.channel.DefaultChannelPipeline.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  io.netty.channel.AbstractChannel.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  com.twitter.finagle.netty4.transport.ChannelTransport.write(Ljava/lang/Object;)Lcom/twitter/util/Future;+5
j  com.twitter.finagle.netty4.http.Netty4ClientStreamTransport.write(Lcom/twitter/finagle/http/Request;)Lcom/twitter/util/Future;+13
j  com.twitter.finagle.netty4.http.Netty4ClientStreamTransport.write(Ljava/lang/Object;)Lcom/twitter/util/Future;+5
j  com.twitter.finagle.http.HttpTransport.write(Lcom/twitter/finagle/http/Message;)Lcom/twitter/util/Future;+27
j  com.twitter.finagle.http.HttpTransport.write(Ljava/lang/Object;)Lcom/twitter/util/Future;+5
j  com.twitter.finagle.http.codec.HttpClientDispatcher.dispatch(Lcom/twitter/finagle/http/Request;Lcom/twitter/util/Promise;)Lcom/twitter/util/Future;+89
j  com.twitter.finagle.http.codec.HttpClientDispatcher.dispatch(Ljava/lang/Object;Lcom/twitter/util/Promise;)Lcom/twitter/util/Future;+6
j  com.twitter.finagle.dispatch.GenSerialClientDispatcher.com$twitter$finagle$dispatch$GenSerialClientDispatcher$$tryDispatch(Ljava/lang/Object;Lcom/twitter/util/Promise;)Lcom/twitter/util/Future;+93
j  com.twitter.finagle.dispatch.GenSerialClientDispatcher$$anonfun$apply$1.apply(Lcom/twitter/util/Try;)V+35
j  com.twitter.finagle.dispatch.GenSerialClientDispatcher$$anonfun$apply$1.apply(Ljava/lang/Object;)Ljava/lang/Object;+5
j  com.twitter.util.ConstFuture$$anon$8.run()V+28
j  com.twitter.concurrent.LocalScheduler$Activation.run()V+21
j  com.twitter.concurrent.LocalScheduler$Activation.submit(Ljava/lang/Runnable;)V+101
j  com.twitter.concurrent.LocalScheduler.submit(Ljava/lang/Runnable;)V+5
j  com.twitter.concurrent.Scheduler$.submit(Ljava/lang/Runnable;)V+5
j  com.twitter.util.ConstFuture.respond(Lscala/Function1;)Lcom/twitter/util/Future;+20
j  com.twitter.util.Future.proxyTo(Lcom/twitter/util/Promise;)V+83
j  com.twitter.finagle.netty4.ConnectionBuilder$$anon$1.operationComplete(Lio/netty/channel/ChannelFuture;)V+363
j  com.twitter.finagle.netty4.ConnectionBuilder$$anon$1.operationComplete(Lio/netty/util/concurrent/Future;)V+5
j  io.netty.util.concurrent.DefaultPromise.notifyListener0(Lio/netty/util/concurrent/Future;Lio/netty/util/concurrent/GenericFutureListener;)V+2
j  io.netty.util.concurrent.DefaultPromise.notifyListeners0(Lio/netty/util/concurrent/DefaultFutureListeners;)V+24
j  io.netty.util.concurrent.DefaultPromise.notifyListenersNow()V+58
j  io.netty.util.concurrent.DefaultPromise.notifyListeners()V+38
j  io.netty.util.concurrent.DefaultPromise.setValue0(Ljava/lang/Object;)Z+34
j  io.netty.util.concurrent.DefaultPromise.setSuccess0(Ljava/lang/Object;)Z+12
j  io.netty.util.concurrent.DefaultPromise.trySuccess(Ljava/lang/Object;)Z+2
j  io.netty.channel.DefaultChannelPromise.trySuccess()Z+2
j  io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(Lio/netty/channel/ChannelPromise;Z)V+14
j  io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect()V+51
j  io.netty.channel.nio.NioEventLoop.processSelectedKey(Ljava/nio/channels/SelectionKey;Lio/netty/channel/nio/AbstractNioChannel;)V+78
j  io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized()V+51
j  io.netty.channel.nio.NioEventLoop.processSelectedKeys()V+8
j  io.netty.channel.nio.NioEventLoop.run()V+263
j  io.netty.util.concurrent.SingleThreadEventExecutor$4.run()V+44
j  io.netty.util.internal.ThreadExecutorMap$2.run()V+11
j  java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j  com.twitter.finagle.util.BlockingTimeTrackingThreadFactory$$anon$1.run()V+10
j  java.lang.Thread.run()V+11

@qinghui-xu
Copy link

After switching to adoptopenjdk8, it's working. So probably the issue is on the open jdk 8's implementation.

@wangy325
Copy link

Same issue with OpenJDK Runtime Environment (8.0_302) (build 1.8.0_302-bre_2021_08_14_21_34-b00) on MacOS Big Sur. Switching to OpenJDK 16 can also evade the issue.

@normanmaurer
Copy link
Member

@wangy325 do you have a reproducer ?

@wangy325
Copy link

@wangy325 do you have a reproducer ?

It happens when I invoke a Restful service (get request) after spring-server initialized every time. A hs_err_pid.log was generated just quite the same as replied by @qinghui-xu :

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010934211a, pid=74454, tid=0x000000000000b003
#
# JRE version: OpenJDK Runtime Environment (8.0_302) (build 1.8.0_302-bre_2021_08_14_21_34-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.302-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x54611a]  Unsafe_SetByte+0x61
...
...
Stack: [0x000070000cc4d000,0x000070000cd4d000],  sp=0x000070000cd4b180,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x54611a]  Unsafe_SetByte+0x61
j  sun.misc.Unsafe.putByte(Ljava/lang/Object;JB)V+0
j  io.netty.util.internal.PlatformDependent0.putByte(Ljava/lang/Object;JB)V+6
j  io.netty.util.internal.PlatformDependent.putByte(Ljava/lang/Object;JB)V+3
j  io.netty.buffer.ByteBufUtil.unsafeWriteUtf8([BJILjava/lang/CharSequence;II)I+73
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;II)I+79
j  io.netty.buffer.ByteBufUtil.writeUtf8(Lio/netty/buffer/AbstractByteBuf;IILjava/lang/CharSequence;I)I+7
j  io.netty.buffer.AbstractByteBuf.setCharSequence0(ILjava/lang/CharSequence;Ljava/nio/charset/Charset;Z)I+55
j  io.netty.buffer.AbstractByteBuf.writeCharSequence(Ljava/lang/CharSequence;Ljava/nio/charset/Charset;)I+8
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpRequest;)V+144
j  io.netty.handler.codec.http.HttpRequestEncoder.encodeInitialLine(Lio/netty/buffer/ByteBuf;Lio/netty/handler/codec/http/HttpMessage;)V+6
j  io.netty.handler.codec.http.HttpObjectEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+88
j  io.netty.handler.codec.http.HttpClientCodec$Encoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V+52
j  io.netty.handler.codec.MessageToMessageEncoder.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+25
j  io.netty.channel.CombinedChannelDuplexHandler.write(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+45
j  io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V+10
j  io.netty.channel.AbstractChannelHandlerContext.write(Ljava/lang/Object;ZLio/netty/channel/ChannelPromise;)V+90
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;+4
j  io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+6
j  io.netty.channel.DefaultChannelPipeline.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  io.netty.channel.AbstractChannel.writeAndFlush(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;+5
j  reactor.netty.http.HttpOperations.lambda$then$2()Lio/netty/channel/ChannelFuture;+104
j  reactor.netty.http.HttpOperations$$Lambda$1739.get()Ljava/lang/Object;+4
j  reactor.netty.FutureMono$DeferredFutureMono.subscribe(Lreactor/core/CoreSubscriber;)V+4
j  reactor.core.publisher.Mono.subscribe(Lorg/reactivestreams/Subscriber;)V+71
j  reactor.core.publisher.FluxConcatIterable$ConcatIterableSubscriber.onComplete()V+157
j  reactor.core.publisher.FluxConcatIterable.subscribe(Lreactor/core/CoreSubscriber;)V+62
j  reactor.core.publisher.MonoFromFluxOperator.subscribe(Lreactor/core/CoreSubscriber;)V+33
j  reactor.core.publisher.MonoDefer.subscribe(Lreactor/core/CoreSubscriber;)V+39
j  reactor.netty.http.client.HttpClientConnect$HttpIOHandlerObserver.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+98
j  reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+29
j  reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+23
j  reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnection.onStateChange(Lreactor/netty/Connection;Lreactor/netty/ConnectionObserver$State;)V+217
j  reactor.netty.channel.ChannelOperationsHandler.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+70
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.AbstractChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+6
j  io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+4
j  io.netty.channel.ChannelInboundHandlerAdapter.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+1
j  io.netty.channel.CombinedChannelDuplexHandler.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+43
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.AbstractChannelHandlerContext.fireChannelActive()Lio/netty/channel/ChannelHandlerContext;+6
j  io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(Lio/netty/channel/ChannelHandlerContext;)V+1
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive()V+15
j  io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(Lio/netty/channel/AbstractChannelHandlerContext;)V+15
j  io.netty.channel.DefaultChannelPipeline.fireChannelActive()Lio/netty/channel/ChannelPipeline;+4
j  io.netty.channel.kqueue.AbstractKQueueChannel$AbstractKQueueUnsafe.fulfillConnectPromise(Lio/netty/channel/ChannelPromise;Z)V+44
j  io.netty.channel.kqueue.AbstractKQueueChannel$AbstractKQueueUnsafe.finishConnect()V+95
j  io.netty.channel.kqueue.AbstractKQueueChannel$AbstractKQueueUnsafe.writeReady()V+11
j  io.netty.channel.kqueue.KQueueEventLoop.processReady(I)V+170
j  io.netty.channel.kqueue.KQueueEventLoop.run()V+162
j  io.netty.util.concurrent.SingleThreadEventExecutor$4.run()V+44
j  io.netty.util.internal.ThreadExecutorMap$2.run()V+11
j  io.netty.util.concurrent.FastThreadLocalRunnable.run()V+4
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x2c55d4]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x6a4
V  [libjvm.dylib+0x2c4465]  JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x119
V  [libjvm.dylib+0x2c4651]  JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*)+0x57
V  [libjvm.dylib+0x333836]  thread_entry(JavaThread*, Thread*)+0x78
V  [libjvm.dylib+0x52e836]  JavaThread::thread_main_inner()+0x82
V  [libjvm.dylib+0x52e6fb]  JavaThread::run()+0x169
V  [libjvm.dylib+0x466a1a]  java_start(Thread*)+0xf1
C  [libsystem_pthread.dylib+0x68fc]  _pthread_start+0xe0
C  [libsystem_pthread.dylib+0x2443]  thread_start+0xf
C  0x0000000000000000
...

Here is the pid file:
hs_err_pid74454.log

By the way, I go to IDEAproject settings -> project ->sdk, select jdk16(another openjdk installed on my mac), and then no error occurs.

@TengHuo
Copy link

TengHuo commented Sep 28, 2022

Switched to Temurin OpenJDK 8, and it can work

openjdk version "1.8.0_345"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_345-b01)
OpenJDK 64-Bit Server VM (Temurin)(build 25.345-b01, mixed mode)

@slandelle
Copy link
Contributor

Switched to Temurin OpenJDK 8, and it can work

Then, it's most likely not a matter of switch vendor but of upgrading from 1.8.0_302 to 1.8.0_345.

@TengHuo
Copy link

TengHuo commented Sep 28, 2022

Switched to Temurin OpenJDK 8, and it can work

Then, it's most likely not a matter of switch vendor but of upgrading from 1.8.0_302 to 1.8.0_345.

I got this JVM issue in Flink code, not in netty, not eaxctly the same error, but I believe they are the same problem in OpenJDK.

I tried Homebrew OpenJDK 1.8.0_345 before, got the same error, think they haven't fixed this problem.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010cdacf59, pid=93371, tid=0x0000000000013003
#
# JRE version: OpenJDK Runtime Environment (8.0_345) (build 1.8.0_345-bre_2022_08_04_23_35-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.345-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x549f59]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   https://github.com/Homebrew/homebrew-core/issues
#

---------------  T H R E A D  ---------------

Current thread (0x00007f9390ef7800):  JavaThread "Map -> row_data_to_hoodie_record (4/4)#0" [_thread_in_vm, id=77827, stack(0x0000700014557000,0x0000700014657000)]
...
Stack: [0x0000700014557000,0x0000700014657000],  sp=0x0000700014656290,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x549f59]
J 1899  sun.misc.Unsafe.getInt(Ljava/lang/Object;J)I (0 bytes) @ 0x00000001156caabe [0x00000001156caa00+0xbe]
j  org.apache.flink.core.memory.MemorySegment.getInt(I)I+33
j  org.apache.flink.core.memory.MemorySegment.getIntBigEndian(I)I+8
...

Temurin OpenJDK 1.8.0_345-b01 fixed my problem.

@xia-fei
Copy link

xia-fei commented Nov 4, 2022

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
 <version>4.1.36.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>

I reduced the Netty version and solved the problem. The previous Netty version was "4.1.82"

@zouxyan
Copy link

zouxyan commented Apr 1, 2023

same error with open-jdk 1.8

@franz1981
Copy link
Contributor

franz1981 commented Apr 1, 2023

Maybe the buffer used to perform the utf8 write have a long encoded string and is released elsewhere without being retained? Hence is shared without increase ref counter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests