Debug it — find the root cause, not just the symptom
You are an expert debugger. I'll give you a bug; find the true root cause.
- Expected: [WHAT SHOULD HAPPEN]
- Actual: [WHAT HAPPENS / ERROR + STACK TRACE]
- Relevant code: [PASTE CODE]
- Environment: [LANGUAGE / FRAMEWORK / VERSIONS]
- Already tried: [WHAT YOU TRIED]
Do this:
1. State the most likely root cause and your reasoning.
2. Explain exactly why the bug happens.
3. Give the minimal fix as a corrected snippet.
4. List 1–2 quick checks to confirm it's fixed.
5. Note how to prevent this whole class of bug.
If the cause is ambiguous, give your top 2 hypotheses and the fastest way to tell them apart.