frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: The trickiest bug you've encountered?

3•chistev•1h ago

Comments

latexr•1h ago
Selection of stories.

https://500mile.email

chistev•1h ago
Cool!
ksherlock•1h ago
A buffer underflow that overwrote a pointer that overwrote 1 byte of code in the multiplication library (no hardware multiplication or memory protection, by the way) that caused unsigned multiplication to be handled as signed multiplication (or perhaps vice versa). This didn't manifest until much later, of course.
AnimalMuppet•44m ago
We had a function that looked like

  void f()
  {
    bool run = true;
    while (run)
    {
      g();
    }
  }
This function was exiting, and not because something threw. So the loop was terminating. And when it did, run was false.

The obvious answer is that g() was smashing the stack. But I ruled that out, because g() was returning to f(), and if g() was smashing the stack, I would expect it to destroy the return address before it destroyed a variable in f().

I tried to solve it for a month, off and on. Every time I tried to get more information, the problem disappeared.

Finally I got desperate enough to look at the assembly output of the compiler, and light dawned. (This was g++ on an ARM, by the way.)

run, the bool in f(), had no address. It lived in register R12. When f() called g(), it pushed the return address. In the implementation of g(), the first thing it did is push R12 so that it could place its own variable in the scratchpad register. So f()'s local variable wound up in g()'s stack frame...

And g() was smashing the stack. Duh.

In particular, it called msgrcv(int msqid, const void msgp, size_t msgsz, int msgflg), which has a highly misleading API. (For those not in the know, this is a POSIX message queue implementation.) It expects msgp to point to a structure like

  struct msgbuf {
      long mtype;       /* message type, must be > 0 */
      char mtext[1];    /* message data */
  };
and msgsize is the size of msgbuf.mtext array, not* the size of msgbuf.

The contractors who wrote this code used the size of msgbuf, which is 4 bytes too high, so they were writing four bytes too many, which happened to overwrite the pushed value of R12, which was f()'s run variable. (The queue did not get out of sync, because they made the same mistake on the other side, and wrote four bytes too many as well.)

One more twist: The message queue was actually wrapping communication with another CPU. So whenever an unrelated four bytes on a different CPU were zero, then the loop would exit and f() would terminate.

TacticalCoder•29m ago
Already posted it here in the past, answering the same question (and some people seem to like it so here we go).

Around 1991 I was writing a DOS game... In a very rare circumstance the game would crash but it could happen after playing for 15 minutes or more. Sometimes not at all. I couldn't make sense of it.

At some point I decided to rewrite my entire game loop to make the game engine fully deterministic: input, time (frame) at which input happened. So that I could then record myself playing the game and replay it fully deterministically.

Except this was in 1991 and deterministic game engines did not exist back then. The first time I read about one was on a postmortem about Age of Empire on Gamasutra (IIRC). I even wrote to the article's author telling him: "Oh wow, it's the first time I read about a deterministic game engine. I made one in 1991 but since then had never heard about anybody using one." and he answered, as much excited as I was, saying he didn't know about any game doing that in 1991 either and he liked why I came up with it.

Since then it became extremely common: a game like Warcraft III for example, where there can be hundreds of units, has tiny save game files for it only records inputs and the time at which they happened (and btw it of course requires to have a same version of the game engine, or a backward compatible one, to be able to replay the save files).

But Age of Empire (1997) is the first one that I remember describing using such an engine.

Back to my 1991 DOS game... I rewrote the game engine, wrote a simple recorder recording the inputs, and played and played and played until it crashed. I then replayed the game (seen that now I could): and, sure enough, the game crashed. Huge relief. At that point I knew the bug was dead: I could reproduce it, I knew I'd smash it.

Turns out: when the hero had taken an extra allowing it to fire two shot at once and would fire two shots, and the first shot would kill the last thing on the level, then the second shot would keep living it's life during the next level (my logic would keep updating that shot and overwriting memory it wasn't supposed to access), happily corrupting memory until something would make the game crash.

It was tricky because it require a special condition.

And the only way I found to be able to reproduce the bug was to basically invent the concept of a deterministic game engine. Or at the very least independently discover it.

The game was never published but it's how my career started (very long story, for a blog or something).

P.S: if anyone know of a game using a deterministic engine from before 1991, I'm all ears (especially if it's an arcade one: that'd really make my day).

chistev•17m ago
Cool story

WebGL Considered Harmful (2011)

https://www.microsoft.com/en-us/msrc/blog/2011/06/webgl-considered-harmful
1•leonidasv•37s ago•0 comments

How to Audit a Blog Post for SEO Without Using 5 Different Tools

https://kitful.ai/blog/how-to-audit-a-blog-post-for-seo-without-using-5-different-tools
1•eashish93•3m ago•0 comments

Thinking about objects in 4D space-time is efficient and consistent (ontology)

https://rubber-duck-typing.com/posts/2026-03-16-system-engineering-perdurantism.html
1•sayon•4m ago•0 comments

Naturalistic Driving Study on Cannabis Use in Washington and Virginia

https://vtechworks.lib.vt.edu/server/api/core/bitstreams/db02223d-1a8b-48be-a432-450cb39c3d41/con...
1•PaulHoule•5m ago•0 comments

State of the Docs by Gitbook

https://www.stateofdocs.com/2026
1•fazkan•6m ago•0 comments

Show HN: Blobsearch – Object storage and DuckDB based Elasticsearch alternative

https://github.com/amr8t/blobsearch
1•conqrr•7m ago•0 comments

Anthropic dispatch: more OpenClaw competiton

https://old.reddit.com/r/Anthropic/comments/1rx1z5c/anthropic_launched_a_new_cowork_feature_called/
1•gigatexal•8m ago•0 comments

Userdb: Add birthDate field to JSON user records

https://github.com/systemd/systemd/pull/40954
1•airhangerf15•12m ago•1 comments

Shared databases are not modular, they are just a weakness

1•davidvartanian•14m ago•0 comments

no-dna.org: an informal standard for CLI tools to detect non-human operators

https://no-dna.org/
1•nailer•14m ago•0 comments

PCB lead times extend as material shortages and AI demand strain supply chains

https://evertiq.com/news/2026-03-12-pcb-lead-times-extend-as-material-shortages-and-ai-demand-str...
1•ta988•15m ago•0 comments

Video Conferencing with Durable Streams

https://s2.dev/blog/video-conferencing
2•shikhar•18m ago•0 comments

Amazon ECR now supports pull through cache for Chainguard

https://aws.amazon.com/about-aws/whats-new/2026/03/amazon-ecr-pull-through-cache-chainguard/
2•stevehipwell•19m ago•0 comments

Apple Blocks Updates for Popular 'Vibe Coding' Apps

https://www.macrumors.com/2026/03/18/apple-blocks-updates-for-vibe-coding-apps/
2•dannyw•20m ago•0 comments

Disruption with Some GitHub Services

https://www.githubstatus.com/incidents/49xnkj77r7vl
1•thinkafterbef•22m ago•0 comments

LATTE ’26: Workshop on Languages, Tools, and Techniques for Accelerator Design

https://capra.cs.cornell.edu/latte26/
1•matt_d•23m ago•0 comments

China makes energy security 'reunification' offer to Taiwan amid Middle East war

https://www.reuters.com/world/china/china-makes-energy-security-reunification-offer-taiwan-amid-m...
3•mikhael•23m ago•1 comments

Why Are We Still Doing This?

https://www.wheresyoured.at/why-are-we-still-doing-this/
2•makaimc•23m ago•0 comments

Claude Code's poor time awareness

https://nicula.xyz/2026/03/18/time-and-llms.html
1•nicula•25m ago•0 comments

Corporate Clean Energy Buying Fell in 2025 After Nearly a Decade of Growth

https://about.bnef.com/insights/clean-energy/corporate-clean-energy-buying-fell-in-2025-after-nea...
2•zekrioca•26m ago•0 comments

Show HN: Jira-MCP – Full Jira for AI agents in 3 tools, not 72

https://github.com/mmatczuk/jira-mcp
1•michalmatczuk•27m ago•0 comments

GE's Walking Truck – ca. 1965

https://www.youtube.com/watch?v=coNO9FpDb6E
2•E-Reverance•30m ago•0 comments

Skillfile, the declarative skill manager, now auto-discovers skills in repos

https://github.com/eljulians/skillfile
1•_juli_•30m ago•0 comments

Why Iran's Most Dangerous Weapon in This War Isn't a Missile. It's the Yuan

https://europeanbusinessmagazine.com/business/iran-has-just-fired-the-most-dangerous-shot-of-this...
2•donutshop•31m ago•0 comments

Every time your AI runs, someone else makes money. Not you

https://apcher.dev:443/
2•Samueedwards1•35m ago•0 comments

Can I still find a social platform like early Facebook?

1•01-_-•35m ago•3 comments

Business-as-Code with LittleHorse 1.0

https://github.com/littlehorse-enterprises/littlehorse
10•coltmcnealy•36m ago•5 comments

Human OSS

https://www.human-oss.dev/
1•jensneuse•37m ago•0 comments

Give your AI a codebase map or it will build one the expensive way

https://codeir.dev/index.html
1•tinamnstr•39m ago•0 comments

Formalization of QFT?

https://www.math.columbia.edu/~woit/wordpress/?p=15637
1•jjgreen•40m ago•0 comments