You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mmap() calls performed by CuckooFilter and InternalCuckooMap reserve a file-backed range of virtual memory. There is a seek and write to the very end of the memory-mapped file, but on some file systems that will create only a sparse file. The file is not pre-allocated at least, so there is no guarantee that when there is enough disk space when there is a read or write to the memory-mapped file.
For example, mmapping a range of 32 MB memory backed by a file may work, but the file system may only reserve a few pages of disk space. It may allocate the other space lazily, but this can fail. If it does, there is access to memory not backed by any file and this will normally fail at runtime with SIGBUS or so.
Failure can probably be reproduced by creating the memory-mapped files on a too small disk partition and then writing to the full memory range. This should fail somewhere in the middle, when the file system needs to provide the actual space but runs out of it.
I think a fix for this is to pre-allocate disk space for the memory-mapped file so it is guaranteed that later accesses to the file's memory will succeed. This could be done using fallocate(), posix_fallocate() or simply write().
The text was updated successfully, but these errors were encountered:
The mmap() calls performed by CuckooFilter and InternalCuckooMap reserve a file-backed range of virtual memory. There is a seek and write to the very end of the memory-mapped file, but on some file systems that will create only a sparse file. The file is not pre-allocated at least, so there is no guarantee that when there is enough disk space when there is a read or write to the memory-mapped file.
For example, mmapping a range of 32 MB memory backed by a file may work, but the file system may only reserve a few pages of disk space. It may allocate the other space lazily, but this can fail. If it does, there is access to memory not backed by any file and this will normally fail at runtime with SIGBUS or so.
Failure can probably be reproduced by creating the memory-mapped files on a too small disk partition and then writing to the full memory range. This should fail somewhere in the middle, when the file system needs to provide the actual space but runs out of it.
I think a fix for this is to pre-allocate disk space for the memory-mapped file so it is guaranteed that later accesses to the file's memory will succeed. This could be done using fallocate(), posix_fallocate() or simply write().
The text was updated successfully, but these errors were encountered: