Open flot92 opened 3 years ago
I just realized it is an duplicate to... https://github.com/xerial/larray/issues/58 As mentioned there, the fix there is not included in the newest Maven 0.4.1 version though.
The way I patch the current larray-mmap-0.4.1.jar (if someone needs a quick fixed version someday)
Create new folder with:
LArrayNative.c
LArrayNative.h
Inside the Folder:
x86_64-w64-mingw32-gcc.exe -c -I"C:\Program Files\Java\jdk1.8.0_261\include" -I"C:\Program Files\Java\jdk1.8.0_261\include\win32" LArrayNative.c
x86_64-w64-mingw32-gcc.exe -shared -o larray.dll LArrayNative.o
Open larray-mmap-0.4.1.jar with 7-zip, replace "xerial\larray\native\Windows\amd64\larray.dll" with your newly created one
Thanks for sharing the whole project :)
FWIW, in line 126 result = FlushViewOfFile(a, (DWORD)size);
, size should be also be cast to SIZE_T, not DWORD.
The LArrayNative.mmap is not working for files > 4GB on windows 64 bit
I just spend way too many hours finding the problem crashing my jvm all of a sudden... So I want to document the problem here.
All you get back is the pointer therefore, in java, you are not aware of the mapping beeing smaller, till you violate memory access.
The C code uses the win32 int mapping also for the win64 bit version.
I will try to get it running.
the following should probably be long for the 64 bit case
highLen, lowLen, highOffset, lowOffset would need to be 64 bit.