GoogleCloudPlatform / spring-cloud-gcp

New home for Spring Cloud GCP development starting with version 2.0.
Apache License 2.0
428 stars 318 forks source link

Upgrade to spring cloud gcp 5.7.0 netty_internal_tcnative_SSLContext_JNI_OnLoad #3296

Closed showmethemoney closed 4 weeks ago

showmethemoney commented 1 month ago

Development environment:

After upgrading the version of spring-cloud-gcp from 5.6.1 to 5.7.0, the application fails to start when running docker run. The error message is as follows:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000000000204b6, pid=1, tid=7
#
# JRE version: OpenJDK Runtime Environment Temurin-21.0.4+7 (21.0.4+7) (build 21.0.4+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (21.0.4+7-LTS, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, serial gc, linux-amd64)
# Problematic frame:
# C  [libio_grpc_netty_shaded_netty_tcnative_linux_x86_645177916680606850614.so+0x2a154]  netty_internal_tcnative_SSLContext_JNI_OnLoad+0x9c4
#
# 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:
# /tmp/hs_err_pid1.log
[1.635s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
maximilianbauerConrad commented 1 month ago

is this maybe related? https://github.com/googleapis/google-cloud-java/issues/11219

matthiasheimerl commented 1 month ago

I had the same issue, but I was able to fix it with reverting one other dependency version I'm using this dependency. I reverted to the version 26.47.0 and now it's working.

<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>${gcp-libraries-bom.version}</version>
<type>pom</type>
<scope>import</scope>

The hint from @maximilianbauerConrad helped to find the solution

JoeWang1127 commented 4 weeks ago

Please upgrade spring-cloud-gcp to 5.8.0 to fix this issue.

showmethemoney commented 4 weeks ago

@JoeWang1127

upgrade pring-cloud-gcp:5.8.0 & eclipse-temurin:21-jre-alpine Still doesn't work

JaredHatfield commented 3 weeks ago

Agreed, I actually discovered this issue when upgrading from 5.6.1 to 5.8.0. Downgrading to 5.7.0 didn't solve the issue for me.

For my app specifically I'm compiling with maven:3.9-amazoncorretto-17 and running with amazoncorretto:17-alpine-jdk where I'm experiencing the issue.

I'd consider this still an issue.

JaredHatfield commented 3 weeks ago

For the benefit of others that may run across the same issue, after digging into the logs more I found the relevant line of code pointed me in the correct direction.

C  [libio_grpc_netty_shaded_netty_tcnative_linux_x86_644283023756439931644.so+0x2a154]  netty_internal_tcnative_SSLContext_JNI_OnLoad+0x9c4

My understanding of the problem is:

The solution for my specific implementation was moving from amazoncorretto:17-alpine-jdk to gcr.io/distroless/java17-debian12.

The closet related issue I could find to this is: https://github.com/grpc/grpc-java/issues/10096#issuecomment-1521958350

Leaving this comment here in hopes that this helps anyone else that is running into a similar issue as it does seem a breaking change was introduced after version 5.6.1.