mmap-io icon indicating copy to clipboard operation
mmap-io copied to clipboard

Bus error if 'offset' of mmap is greater than 2gb.

Open peekpi opened this issue 4 years ago • 1 comments

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

peekpi avatar Jan 03 '21 16:01 peekpi

We made https://github.com/ipinfo/mmap-utils with a fix for this.

UmanShahzad avatar Nov 30 '21 05:11 UmanShahzad