I altered the program to first allocate 64G then go through and write on each page of the allocation on my 16G machine, dropped my swap partition.
After suitable screwing around to keep gcc from optimizing away the writes, it goes a bit like this…
jim@gvdev:~$ ./fail
Before
Allocated 1 GB
Allocated 2 GB
...
Allocated 64 GB
After
Writing in 0 GB
Writing in 1 GB
...
Writing in 15 GB
... rather long delay here...
Write failed: Broken pipe
upstairs:~ jim$ <----- bad news here, notice the machine.
upstairs:~ jim$ slogin gvdev.XXXXX.net
ssh: connect to host gvdev.XXXXX.net port 22: Network is unreachable
… so now I have to get back in "going out" clothes, go downstairs, and drive over to gvdev and reboot it.