I have a program I wanted to run through massif but it crashes (only when run through massif). Using a debug build I get a panic trace that points to the .INVAL => unreachable switch branch in std.os.mmap, during one of the start-up calls to mmap that I make. I am doing something potentially odd with mmap: at the start of the program I make 16 calls to mmap like this:
const fd = try std.os.memfd_create("name", 0);
const size = 64 * 1024 * 1024 * 1024;
try std.os.ftruncate(fd, size);
const ptr = try std.os.mmap(null, size, std.os.PROT.READ | std.os.PROT.WRITE, std.of.MAP.SHARED, fd, 0);
This means I try to map 1TiB of when the program starts. Does something about valgrind/massif mean that I just can't try to grab virtual memory like this, or is there something specific I have to do when using massif?