# When the Debugger Lies: A Stale Cache Mystery on Nordic's nRF54L

> Hacker News story 49799306 · language: en · submitted 2026-09-22
> Web version: https://zeli.app/story/49799306
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 71 · by [hasheddan](<https://news.ycombinator.com/user?id=hasheddan>) · 💬 19
[original](<https://danielmangum.com/posts/when-the-debugger-lies/>) · [HN discussion](<https://news.ycombinator.com/item?id=49799306>)

## Summary

While exploring the nRF54L's Key Management Unit via GDB, Daniel Mangum found that pushed key values never updated at the destination address. The debugger's memory reads returned stale data, but a direct AHB-AP read showed the correct value. The culprit: GDB's default read path goes through the CPU's data cache, while J-Link's ReadMemAP bypasses it. The post unpacks the SoC's debug architecture and explains when to distrust your debugger.

## Key quote

> Sure enough, reading directly from the AHB-AP showed the expected value. Furthermore, after issuing the read, subsequent examine (x) commands from GDB continued to return stale values.

## HN discussion (19 comments)

### [zavec](<https://news.ycombinator.com/item?id=49830294>)

> Very cool! I love reading about details like this.

### [Loren_SL](<https://news.ycombinator.com/item?id=49805601>)

> Nice writeup.  WinDbg has the same stale-cache trap on live Windows targets.

### [LoganDark](<https://news.ycombinator.com/item?id=49830248>)

> Once upon a time I had to figure out an issue where I forgot a `return` statement at the end of a non-`void` function, so the C++ compiler happily omitted both RETs for some reason and let the program go straight into illegal instructions. That was fun to debug (not fun, I practically had to single-step through the entire program) because every time this happened the debugger was incredibly confused about what the fuck was going on and nothing made any sense.

---

## Cite

- Page: https://zeli.app/story/49799306
- Date: 2026-09-22
- Source: danielmangum.com (https://danielmangum.com/posts/when-the-debugger-lies/)
- Hacker News: https://news.ycombinator.com/item?id=49799306

## Other languages

- zh: https://zeli.app/zh/story/49799306 · markdown: https://zeli.app/zh/story/49799306.md
- ja: https://zeli.app/ja/story/49799306 · markdown: https://zeli.app/ja/story/49799306.md
- ko: https://zeli.app/ko/story/49799306 · markdown: https://zeli.app/ko/story/49799306.md
- de: https://zeli.app/de/story/49799306 · markdown: https://zeli.app/de/story/49799306.md
- es: https://zeli.app/es/story/49799306 · markdown: https://zeli.app/es/story/49799306.md
- ru: https://zeli.app/ru/story/49799306 · markdown: https://zeli.app/ru/story/49799306.md
