Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Two-Tier Encryption in the UK – Identical Apple Devices, Different Protection(macanorak.com)
    59comments
  2. Nokia Design Archive (2025)(aalto.fi)
    72comments
  3. Linux support is coming to Snapdragon X2 Series(qualcomm.com)
    212comments
  4. Owners mourn spoiled food after firmware update bricks Samsung smart fridges(arstechnica.com)
    75comments
  5. Ideas on modernizing the open-source desktop(lwn.net)
    294comments
  6. Claude discovers a novel enzyme system with CRISPR-like repeats(anthropic.com)
    724comments
  7. Enjoy Every Sandwich(bradmontague.substack.com)
    2comments
  8. RAM: the forgotten history (2024)(coredump.cx)
    2comments
  9. OpenAI agent hacked Australian government website, PM says(bbc.com)
    114comments
  10. The newest ESP32 can run Linux and it's getting close to a Raspberry Pi(xda-developers.com)
    32comments
  11. Meta takes down a critical video about meta AI Glasses after filming at Meta(reddit.com)
    242comments
  12. ArXiv receives multiyear commitments to support it as an independent nonprofit(arxiv.org)
    30comments
  13. When the Debugger Lies(danielmangum.com)
    10comments
  14. VSCode's SSH Agent Is Bananas (2025)(fly.io)
    166comments
  15. Early rogue AI agent activity and attempts to hack found on urlquery.net(transluce.org)
    160comments
  16. Contrastive Language Models(contrastive-lm.notion.site)
    29comments
  17. The "Windows XP Box" (2003)(mini-itx.com)
    37comments
  18. Virtio-nvgpu: Near-native Nvidia GPU access inside a KVM guest(github.com/nestrilabs)
    54comments
  19. Hackers influence ChatGPT and Gemini to direct users to scam centers(medium.com/arielsimon)
    15comments
  20. Oracle Cites 'Force Majeure' to Shield Itself on Controversial Data Center(bloomberg.com)
    5comments
  21. Fixing the Portobello Police Station Clock(pointinthecloud.com)
    110comments
  22. The Year of Internal Tools(geocod.io)
    8comments
  23. Why 'What's Opera, Doc?' looks like that(animationobsessive.substack.com)
    19comments
  24. Automated optimization of a molecular simulation program(shishir-iyer.medium.com)
    2comments
  25. Mercury 2.5 LLM hits 770 tokens per second(artificialanalysis.ai)
    79comments
  26. Women Who Sold Books Door to Door(jstor.org)
    6comments
  27. Making Tailscale Faster(tailscale.com)
    79comments
  28. Making portable my unportable transputer C compiler(nanochess.org)
    8comments
  29. Meta VR Glasses(meta.com)
    409comments
  30. The mystery animal on an ancient god's head(signoregalilei.com)
    37comments

When the Debugger Lies

26 pointsby 2d agodanielmangum.com
10 comments
1d agoHN ↗

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

56m agoHN ↗

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.

39m agoHN ↗

Another issue that happened in the same project is that for some reason whenever I compiled it with a regular C++ compiler, field writes were disappearing into the abyss. I think I actually never figured that out because it was literally the same object at the same memory address, there were no other threads and yet when a subroutine returned after writing the field, the write disappeared?? The strangest thing is that Emscripten's C++-to-WASM cross-compiler worked perfectly fine with the exact same routines. I wonder if the compiler I used simply had fuckass issues, it was an oldish (by modern standards) Apple clang from like probably macOS 10.14 or so.

31m agoHN ↗

That or you hit some UB elsewhere that caused the compiler to assume things that you didn't follow.

Trying UBSAN and ASAN might have been worth it. I don't think comparing debug and release builds would have helped: could be buggy optimisations or UB in your code regardless of what the outcome of that test was.

25m agoHN ↗

In this case I was reading memory with a debugger and could see that it literally was the same object at the same memory address, but what I did not know was whether or not different parts of the code had different views of that field for some reason, or any number of other things that could have been causing the issue. Either way, it was super weird and frustrating.

35m agoHN ↗

It makes no sense to me that C and C++ didn't require a diagnostic for this, rather you hit UB.

I know that at least modern GCC and Clang will warn and/or error for this (not sure which as I use -Werror), but still, this is pointless UB to have.

And no, in this case I don't buy that a C90 compiler would have been unable to check this.

14m agoHN ↗

It seems like something that could have been trapped right in k&r.

Was it ever even theoretically under any circumstances for any reason intended to be able to write a stack of functions with no returns that just fall into each other like assembly? I can't believe it.

So it seems like something even the very first compiler could have cought right in an early parser pass or stage.

But I also decline to believe I have a better idea about something than K or R, so there must be a non-triviality I don't see. I mean goto() exists in the language so ?

... I guess simply detecting the end of a function isn't a good enough definition of the problem. You can have any number of returns or gotos in the middle and intentionally no return at the end because instead you have an assert or a goto.

51m agoHN ↗

Very cool! I love reading about details like this.