When mapping memory with mmap(), we should use a fd of -1, not 0. 0 may work on linux, but it doesn't work on FreeBSD, and probably other OSes. It would be nice to backport this to 1.8 to help debugging there.