dain / leveldb

Port of LevelDB to Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsafe usage cause coredump on HP-UX

sekaijin opened this issue · comments

Hi,

Running LevelDB on HP-UX cause coredump.
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j sun.misc.Unsafe.getInt(Ljava/lang/Object;J)I+0 j org.iq80.snappy.UnsafeMemory.loadInt([BI)I+50 j org.iq80.snappy.SnappyInternalUtils.loadInt([BI)I+5 j org.iq80.snappy.SnappyCompressor.findCandidate([BIIII[SI)[I+19 j org.iq80.snappy.SnappyCompressor.compressFragment([BII[BI[S)I+157 j org.iq80.snappy.SnappyCompressor.compress([BII[BI)I+63 j org.iq80.snappy.Snappy.compress([BII[BI)I+6 j org.iq80.leveldb.util.Snappy$IQ80Snappy.compress([BII[BI)I+7 j org.iq80.leveldb.util.Snappy.compress([BII[BI)I+9 j org.iq80.leveldb.table.TableBuilder.writeBlock(Lorg/iq80/leveldb/table/BlockBuilder;)Lorg/iq80/leveldb/table/BlockHandle;+54 j org.iq80.leveldb.table.TableBuilder.flush()V+51 j org.iq80.leveldb.table.TableBuilder.add(Lorg/iq80/leveldb/util/Slice;Lorg/iq80/leveldb/util/Slice;)V+172 j org.iq80.leveldb.impl.DbImpl.buildTable(Lorg/iq80/leveldb/impl/SeekingIterable;J)Lorg/iq80/leveldb/impl/FileMetaData;+135 j org.iq80.leveldb.impl.DbImpl.writeLevel0Table(Lorg/iq80/leveldb/impl/MemTable;Lorg/iq80/leveldb/impl/VersionEdit;Lorg/iq80/leveldb/impl/Version;)V+53 j org.iq80.leveldb.impl.DbImpl.compactMemTableInternal()V+41 j org.iq80.leveldb.impl.DbImpl.backgroundCompaction()V+11 j org.iq80.leveldb.impl.DbImpl.backgroundCall()V+94 j org.iq80.leveldb.impl.DbImpl.access$100(Lorg/iq80/leveldb/impl/DbImpl;)V+1 j org.iq80.leveldb.impl.DbImpl$2.call()Ljava/lang/Void;+4 j org.iq80.leveldb.impl.DbImpl$2.call()Ljava/lang/Object;+1
the cause of this error is the use of UnsafeMemory.

in org.iq80.leveldb.util.Snappy it is appealed to the library Snappy
using UnsafeMemory.loadInt. This causes exception in the JVM on multiple processors.
https://www.google.com/search?q=sun.misc.Unsafe+COREDUMP

Snappy the project opened an issue
dain/snappy#24

Bye
JYT
I'm trying Snappy 0.4 it works fine

The pure java version of level DB doesn't support HP-UX (IIRC, the problem is unaligned reads). Instead, I think you can use xerial snappy by setting -Dleveldb.snappy=xerial

Hi I'm trying ActiveMQ with level DB
I've change Snappy 0.2 by Snappy 0.4 on this version the alignement was correctly detected.

I will submit ActiveMQ to intensive load test for a month.
I started with 100 1KB messages on a single queue jms in parallel all the milliseconds
with a single Consumer
I will increase the number of jms queues and message size.
I must also test the interuption of service.

Since the message I posted, I began the first part of the test that works unabated.
I've, for now, not found abnormal consomations of memory or CPU, and no error is generated at LevelDB.

thank

A+JYT
PS: I'll Also try xerial

In the 0.9 release on last Thursday, I upgraded the snappy versions to the latest releases.