Chronicle-Bytes icon indicating copy to clipboard operation
Chronicle-Bytes copied to clipboard

mappedBytes: better protection when the disk is full

Open RobAustin opened this issue 5 years ago • 4 comments

Currently, if the disk is full, we allow the mapped bytes to be created, then crash the JVM with an hs_err_file if we attempt to access the mapped bytes ( see below which was run on a mount which had a full disk )

Ideally, users should never run the code on a system with a full disk, however, The problem about crashing the JVM is it makes diagnosing what caused the crash rather difficult as it is not immediately obvious that the issue is related to the disk being full.

Stack: [0x00007f394adaf000,0x00007f394aeb0000],  sp=0x00007f394aeae4c0,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xac3677]  Unsafe_GetIntVolatile+0x67
j  sun.misc.Unsafe.getIntVolatile(Ljava/lang/Object;J)I+0
j  net.openhft.chronicle.core.UnsafeMemory.readVolatileInt(J)I+5
j  net.openhft.chronicle.bytes.NativeBytesStore.readVolatileInt(J)I+14
j  net.openhft.chronicle.bytes.AbstractBytes.readVolatileInt(J)I+14
j  software.chronicle.market.data.distributor.ConcurrentReadWriteBuffer.init(Lnet/openhft/chronicle/bytes/Bytes;IJI)V+172
j  software.chronicle.market.data.distributor.ConcurrentReadWriteBuffer.<init>(Ljava/io/File;III)V+55
j  software.chronicle.market.data.distributor.ConcurrentReadWriteBufferTest$1Writer.run()V+13
j  java.lang.Thread.run()V+11
j  net.openhft.chronicle.core.threads.CleaningThread.run()V+1
v  ~StubRoutines::call_stub
V  [libjvm.so+0x67d2a5]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0xc55
V  [libjvm.so+0x67aa0f]  JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x27f
V  [libjvm.so+0x67afc7]  JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*)+0x77
V  [libjvm.so+0x6c183f]  thread_entry(JavaThread*, Thread*)+0x7f
V  [libjvm.so+0xaa5d04]  JavaThread::thread_main_inner()+0x214
V  [libjvm.so+0xaa60e8]  JavaThread::run()+0x3a8
V  [libjvm.so+0x8cd662]  java_start(Thread*)+0x162
C  [libpthread.so.0+0x82de]  start_thread+0xfe

RobAustin avatar Nov 13 '20 17:11 RobAustin

Agreed we should have a better accounting of disk usage to prevent this.

peter-lawrey avatar Jan 20 '21 13:01 peter-lawrey

@peter-lawrey just pointing you at this as I know that you are working on mapped bytes at the moment.

RobAustin avatar Apr 22 '21 11:04 RobAustin

Any progress on this?

minborg avatar Mar 28 '22 08:03 minborg

Needs https://github.com/OpenHFT/Chronicle-Threads/issues/71

peter-lawrey avatar Apr 07 '22 12:04 peter-lawrey

https://github.com/OpenHFT/Chronicle-Threads/pull/189 will help

JerryShea avatar Mar 30 '23 07:03 JerryShea

Threads implementation covers the same.

yevgenp avatar Jan 18 '24 15:01 yevgenp