CS FundamentalsVery hardGATE CS
A process gets SIGSEGV writing to a page marked read-only that belongs to a copy-on-write mapping after fork(). Why is this NOT what normally happens?
- A. COW pages are never marked read-only
- B. The kernel recognises the protection fault as a COW fault (the region is writable in its VMA), copies the page, makes it writable, and restarts the instruction
- C. The parent always handles the write
- D. Writes to COW pages are ignored
Correct answer: B. The kernel recognises the protection fault as a COW fault (the region is writable in its VMA), copies the page, makes it writable, and restarts the instruction
The PTE is read-only but the area's permissions allow writing; the mismatch tells the fault handler to break sharing. Only a write to a truly read-only region results in SIGSEGV.
More Operating Systems questions
- A system uses paging with a 2-bit protection field (read, write) in each PTE and the CPU also has an execute-disable bit. Which page…
- Swap space is configured at 2 GB, RAM is 8 GB, and the OS uses overcommit. A process mallocs 20 GB and touches only 1 GB. What happens on…
- Which algorithm decides WHICH process to kill when Linux runs out of memory?
- NUMA systems: a thread running on node 0 frequently reads memory allocated on node 1. Which statement is correct?
- Which statement about the clock interrupt frequency (tick rate) is correct?
- A real-time task must respond within 50 µs. Which OS property matters most?