Closed ghost closed 2 years ago
Update: This fails on UFS as well, so I am assuming its not filesystem-dependent
@Quurks thanks for this report. Seems like problem with a problem JNA, JNA is not able to capture msync system call on FreeBSD. I'm able to reproduce the problem, but I'm not able to test with different test build, because I'm not familiar with FreeBSD and seems like it doesn't support anything (I even cannot unzip or untar an archive). Could you rebuild Chronicle Map with JNA 4.4.0 and try to run this test?
@leventov I build ChronicleMap 3.13 with JNA 4.4.0. The Map creation succeeds now, but the JVM crashes (SIGSEGV) on put.
Since I seem to be the only FreeBSD user and the fix / debug process is probably nontrivial I am going to look for another embedded Map.
On the off chance you are going to fix this or it becomes relevant later:
pkg install maven3
is way outdatedpkg install gradle
is required (thus you need to use gradle
instead of ./gradlew
)pkg install unzip
@Quurks SIGSEGV on put may be related to the feature of Linux and Windows on which Chronicle Map relies, is that file length is adjusted automatically when a region of a file (beyond the prev. file length) is mapped into memory, and then the first access to that memory occurs. FreeBSD may not support that. You may try something like
File file = new File("test.dat");
ChronicleMap<Integer, Integer> storage = ChronicleMapBuilder.of(Integer.class, Integer.class).
name("test").
constantKeySizeBySample(1).
constantValueSizeBySample(1).
entries(10000).
createPersistedTo(file);
try (RandomAccessFile raf = new RandomAccessFile(file, "rw") {
raf.setLength(storage.offHeapMemoryUsed());
}
If it works we would add an opt-in feature to support this inside the Chronicle Map library.
However I just checked and seems that we already set the correct file length before memory mapping, so the above message may be completely misleading
Yes, does not seem to make a difference: hs_err_new.txt hs_err_old.txt
Could you please try to add the following code in VanillaChronicleHash.zeroOutNewlyMappedTier()
:
for (long i = tierOffset; i < tierOffset + tierSize - tierEntrySpaceOuterSize; i++) {
bytesStore.writeByte(i, 0);
}
I will be back in 10 hours.
Looks like a bug in Chronicle Map. Thanks for report and help with testing
Do you still get this issue with the latest version?
I am closing this issue now @Quurks . Let me know if you want the issue reopened (if the problem remains in a more recent version of Map)
Chronicle-Map 3.13.0 / Java8u121
Steps to reproduce:
Reproduce with VirtualBox:
./MapTest/bin/MapTest
Expected:
Map is created (program prints "Map created")
Actual:
Map source code: