You're using an offset
of pageSize
, meaning you're trying to map starting with the second page of the file. Since your file is small, this is off the end of the file and you get a bus error.
Change offset
to 0
and it should work as you expect.