Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "A process reserves a 2 GiB anonymous range but touches only 8 MiB. Which conclusion is justified?" on CodeWiki (https://codewiki.com/practice/mcq/foundations/virtual-memory/virtual-versus-resident/).
Context (verbatim from the page):
"""
A process reserves a 2 GiB anonymous range but touches only 8 MiB. Which conclusion is justified?
It must already consume 2 GiB of private RAM.
Its virtual size can grow by 2 GiB without a matching 2 GiB increase in resident memory.
The untouched pages can never fail when written later.
The range cannot count toward any cgroup policy.
"""
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.