facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.61k stars 6.32k forks source link

RocksJava using ZStd for bottommostCompression gives SIGSEGV #5795

Open adamretter opened 5 years ago

adamretter commented 5 years ago

On Ubuntu 18.04 x64 - in RocksJava after setting:

ColumFamilyOptions
    .setBottommostCompressionType(CompressionType.ZSTD_COMPRESSSION)

I am getting the following crash.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fa1d9359222, pid=27833, tid=27859
#
# JRE version: Java(TM) SE Runtime Environment (11.0.4+10) (build 11.0.4+10-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.4+10-LTS, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [librocksdbjni5356951061235791870.so+0x5d4222]  ZSTD_decompressBegin+0x2

The backtrace:

#22 0x00007fd2198ac93e in VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*) () from /usr/lib/jvm/java-11-oracle/lib/server/libjvm.so
#23 0x00007fd21968e340 in JVM_handle_linux_signal () from /usr/lib/jvm/java-11-oracle/lib/server/libjvm.so
#24 0x00007fd219681f28 in signalHandler(int, siginfo*, void*) () from /usr/lib/jvm/java-11-oracle/lib/server/libjvm.so
#25 <signal handler called>

#26 0x00007fd1d9068222 in ZSTD_decompressBegin () from /tmp/librocksdbjni8076693560591390552.so
#27 0x00007fd1d90682f2 in ZSTD_decompressBegin_usingDict () from /tmp/librocksdbjni8076693560591390552.so
#28 0x00007fd1d9068785 in ?? () from /tmp/librocksdbjni8076693560591390552.so
#29 0x00007fd1d9068bcf in ZSTD_decompress_usingDict () from /tmp/librocksdbjni8076693560591390552.so
#30 0x00007fd1d8ecb3a8 in rocksdb::UncompressBlockContentsForCompressionType(rocksdb::UncompressionInfo const&, char const*, unsigned long, rocksdb::BlockContents*, unsigned int, rocksdb::ImmutableCFOptions const&, rocksdb::MemoryAllocator*) () from /tmp/librocksdbjni8076693560591390552.so
#31 0x00007fd1d8e913f4 in rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::Slice const&, rocksdb::BlockHandle*, bool) () from /tmp/librocksdbjni8076693560591390552.so
#32 0x00007fd1d8e918ac in rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::BlockBuilder*, rocksdb::BlockHandle*, bool) () from /tmp/librocksdbjni8076693560591390552.so
#33 0x00007fd1d8e91945 in rocksdb::BlockBasedTableBuilder::Flush() () from /tmp/librocksdbjni8076693560591390552.so
#34 0x00007fd1d8e94dd8 in rocksdb::BlockBasedTableBuilder::Add(rocksdb::Slice const&, rocksdb::Slice const&) () from /tmp/librocksdbjni8076693560591390552.so
#35 0x00007fd1d8ccb08c in rocksdb::CompactionJob::ProcessKeyValueCompaction(rocksdb::CompactionJob::SubcompactionState*) () from /tmp/librocksdbjni8076693560591390552.so
#36 0x00007fd1d8ccd7c8 in rocksdb::CompactionJob::Run() () from /tmp/librocksdbjni8076693560591390552.so
#37 0x00007fd1d8d16eb6 in rocksdb::DBImpl::BackgroundCompaction(bool*, rocksdb::JobContext*, rocksdb::LogBuffer*, rocksdb::DBImpl::PrepickedCompaction*, rocksdb::Env::Priority) ()
   from /tmp/librocksdbjni8076693560591390552.so
#38 0x00007fd1d8d1db56 in rocksdb::DBImpl::BackgroundCallCompaction(rocksdb::DBImpl::PrepickedCompaction*, rocksdb::Env::Priority) () from /tmp/librocksdbjni8076693560591390552.so
#39 0x00007fd1d8d1e03a in rocksdb::DBImpl::BGWorkCompaction(void*) () from /tmp/librocksdbjni8076693560591390552.so
#40 0x00007fd1d8f10114 in rocksdb::ThreadPoolImpl::Impl::BGThread(unsigned long) () from /tmp/librocksdbjni8076693560591390552.so
#41 0x00007fd1d8f102ad in rocksdb::ThreadPoolImpl::Impl::BGThreadWrapper(void*) () from /tmp/librocksdbjni8076693560591390552.so
#42 0x00007fd1d909fb8f in ?? () from /tmp/librocksdbjni8076693560591390552.so

I need to investigate...

koldat commented 5 years ago

I created similar issue for this. For me it helped to reconfigure. Java API has different defaults.

5496

mvu-tk commented 4 years ago

I have the same problem. can you please let me know where to fix this?

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000013a8cabad, pid=58282, tid=38659
#
# JRE version: Java(TM) SE Runtime Environment (11.0.4+10) (build 11.0.4+10-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.4+10-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# C  [librocksdbjni5948292878350556323.jnilib+0x41fbad]  ZSTD_decompress_usingDict+0x6d
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
brary commented 4 years ago

I also faced a similar issue. Then I tried using setCompressionPerLevel config to set compression at l0 and l1 to lz4 and rest all levels to std. That also fails with sigsegv.

 A fatal error has been detected by the Java Runtime Environment:
  SIGSEGV (0xb) at pc=0x00007fad5f4c8532, pid=2501, tid=0x00007fad5ef22700

 JRE version: OpenJDK Runtime Environment (8.0_141-b16) (build 1.8.0_141-b16)
 Java VM: OpenJDK 64-Bit Server VM (25.141-b16 mixed mode linux-amd64 compressed oops)
 Problematic frame:
 C  [librocksdbjni2384593668707621085.so+0x5a5532]  ZSTD_decompressBegin+0x2