carrotdata / carrot-cache

In-Out-Process Java cache (L1/L2 off-heap, scalable, ZeroGC) with full SSD support
Apache License 2.0
3 stars 0 forks source link

[BUG] Test TestMemoryIndexMQMultithreaded flaky #371

Open VladRodionov opened 5 months ago

VladRodionov commented 5 months ago
Thread-43" #67 prio=5 os_prio=31 cpu=10850742.80ms elapsed=10858.23s tid=0x00007f9d189f8800 nid=0xa82b runnable  [0x000070000ec89000]
   java.lang.Thread.State: RUNNABLE
    at com.carrotdata.cache.index.MemoryIndex.lock(MemoryIndex.java:778)
    at com.carrotdata.cache.index.MemoryIndex.compareAndUpdate(MemoryIndex.java:1966)
    at com.carrotdata.cache.index.TestMemoryIndexMultithreadedBase.forceUpdate(TestMemoryIndexMultithreadedBase.java:354)
    at com.carrotdata.cache.index.TestMemoryIndexMQMultithreaded.updateIndexBytes(TestMemoryIndexMQMultithreaded.java:65)
    at com.carrotdata.cache.index.TestMemoryIndexMQMultithreaded.loadUpdateReadBytes(TestMemoryIndexMQMultithreaded.java:544)
    at com.carrotdata.cache.index.TestMemoryIndexMQMultithreaded.testLoadUpdateReadWithRehashBytes(TestMemoryIndexMQMultithreaded.java:370)
    at com.carrotdata.cache.index.TestMemoryIndexMQMultithreaded.lambda$testLoadUpdateReadWithRehashBytesMT$9(TestMemoryIndexMQMultithreaded.java:363)
    at com.carrotdata.cache.index.TestMemoryIndexMQMultithreaded$$Lambda$137/0x000000080026b840.run(Unknown Source)

Stuck here. 3 threads finished.

VladRodionov commented 2 months ago

Even worse:

Process crashed:

Thread 55 Crashed:: Java: Thread-43
0   libsystem_kernel.dylib                 0x19ee315f0 __pthread_kill + 8
1   libsystem_pthread.dylib                0x19ee69c20 pthread_kill + 288
2   libsystem_c.dylib                      0x19ed76a30 abort + 180
3   libsystem_malloc.dylib                 0x19ec86dc4 malloc_vreport + 896
4   libsystem_malloc.dylib                 0x19ecaaea8 malloc_zone_error + 104
5   libsystem_malloc.dylib                 0x19ec927e0 free_list_checksum_botch + 40
6   libsystem_malloc.dylib                 0x19ec7ffd8 small_free_list_remove_ptr_no_clear + 960
7   libsystem_malloc.dylib                 0x19ec7d5e0 free_small + 692
8   libjvm.dylib                           0x105f9da04 Unsafe_FreeMemory0(JNIEnv_*, _jobject*, long) + 84
9   ???                                    0x13831483c ???
10  ???                                    0x13832b750 ???

This is hard to reproduce. Looks like attempt to double free memory or free memory wrong address