a page fault
A page fault is what happens when your program touches a virtual address whose page is not currently usable as requested — and despite the alarming name, most page faults are completely normal and expected, not crashes. It is the manager discovering the requested room is not ready yet, pausing the tenant, and going to fetch or prepare it.
Mechanically, when the MMU tries to translate an address and finds the page's present bit clear (or the access violates the page's permissions), it cannot complete the access, so it raises a CPU exception — the page fault — which traps into the operating system. The OS inspects what was wanted and decides. If the page is legitimately missing but should exist (it was never loaded yet, or was swapped to disk), the OS allocates a frame, loads the data if needed, fixes the page-table entry, and quietly restarts the faulting instruction as if nothing happened. If instead the access was genuinely illegal (a wild pointer into an unmapped region, or writing read-only memory), the OS refuses and delivers a fault to the program — on Unix that surfaces as the SIGSEGV behind a segmentation fault.
So the same mechanism serves two very different outcomes: a serviceable fault (the basis of demand paging, copy-on-write, and swapping, where the OS fixes things up and continues) and a fatal fault (a bug, where the program is killed). Knowing this distinction is key: a program can take millions of harmless page faults during normal operation. The crash is only one special, illegal kind.
Right after malloc() gives you 1 MiB, the bytes are not really in RAM yet. Writing buf[0] = 1 hits an unbacked page, causes a page fault, and the OS quietly maps in a fresh zero frame and lets the write finish — a normal, serviceable fault, not a crash.
Most page faults are routine; only the illegal ones crash.
A page fault is not the same as a segmentation fault. A page fault is the hardware mechanism; the OS may service it (normal) or, if the access is illegal, turn it into the program-killing segmentation fault (SIGSEGV). Most page faults never reach your program.