ben-manes / caffeine

A high performance caching library for Java
Apache License 2.0
15.71k stars 1.59k forks source link

CaffeineCache.get results in SIGSEGV error #1676

Closed pagrawal10 closed 4 months ago

pagrawal10 commented 4 months ago

Caffeine version: 2.8.0 Application: https://github.com/apache/druid

Function:

 @Override
  public byte[] get(NamedKey key)
  {
    return deserialize(cache.getIfPresent(key));
  }

Log line:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fdbcaa21568, pid=1, tid=1318
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.10+7 (17.0.10+7) (build 17.0.10+7)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (17.0.10+7, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# J 21512 c2 org.apache.druid.client.cache.CaffeineCache.get(Lorg/apache/druid/client/cache/Cache$NamedKey;)[B (18 bytes) @ 0x00007fdbcaa21568 [0x00007fdbcaa21020+0x0000000000000548]
#
# Core dump will be written. Default location: /opt/druid/core.1
#
# An error report file with more information is saved as:
# /opt/druid/hs_err_pid1.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
#
ben-manes commented 4 months ago

This looks like something you'd need to investigate further using the log and dump files. The line of code is too abstract to isolate to Caffeine, as their deserializer uses Unsafe and JNI. This is also a very old version of our library, where 2.x used Unsafe (Java 8) and 3.x does not (Java 11 VarHandles) so it would not be capable of that impact. You should request that they upgrade and in the meantime could do so yourself since it is typically drop-in compatible. We have certainly observed JDK bugs (e.g. SOLR-16463's JIT compilation error) so you should definitely try to use the latest builds. Good luck.