mmap-io
mmap-io copied to clipboard
Bus error if 'offset' of mmap is greater than 2gb.
js code to reproduce:
...
const mmap = require("mmap-io")
const fd = ... // openSync, ftruncateSync, etc
const buf = mmap.map(mmap.PAGESIZE, mmap.PROT_WRITE | mmap.PROT_READ, mmap.MAP_SHARED, fd, 0x80000000);
console.log(buf); // will cause bus error;
...
The possible reason is the use of int
:
https://github.com/ozra/mmap-io/blob/c751580e24c67abe6a0cadaf92ee22d7d810dd80/src/mmap-io.cc#L124
We made https://github.com/ipinfo/mmap-utils with a fix for this.