Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "After fork, why can a child write a private mapping without changing the parent’s value?" on CodeWiki (https://codewiki.com/practice/mcq/foundations/virtual-memory/copy-on-write-after-fork/).
Context (verbatim from the page):
"""
After fork, why can a child write a private mapping without changing the parent’s value?
The pipe automatically restores the parent page.
The child receives a new virtual address for every page.
Copy-on-write preserves private semantics by separating backing when a shared page is written.
Private mappings are always copied eagerly before fork returns.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in CS foundations. Where you are unsure, say so.