from Hacker News

The case of a program that crashed on its first instruction

by zdimension on 11/8/24, 5:43 PM with 19 comments

  • by tzs on 11/8/24, 9:29 PM

    I remember someone quipped that every program always has at least one bug left, and every program could be optimized to be smaller.

    It follows then that with a sufficiently good optimizer every program can be reduced to a single wrong instruction.

  • by xen0 on 11/8/24, 8:17 PM

    Sometimes I start to feel like I'm pretty good at what I do.

    Then I read one Raymond's investigations like this and realise I'm still not that good.

  • by pdonis on 11/8/24, 8:57 PM

    I love this comment:

    "So at least it’s nice that this rogue code was compiled with stack buffer overflow protection. Can’t be too careful."

  • by interroboink on 11/8/24, 10:49 PM

    Could someone explain to me — it's not actually crashing on its first instruction, I take it?

    Why does it appear to be crashing on the first instruction?

    Did the malware mess with the main thread's code, so that the first instruction of the main thread was the invalid write instruction?

    But then the malware thread must have run first somehow, no? (since that thread is in the same process)

    I think I followed the article generally, but I don't understand what actual sequence of events might have taken place that resulted in this report of "crashed on first instruction."

  • by jandrese on 11/8/24, 9:57 PM

    I guessed wrong from the title. I was expecting a C/C++ programmer that tried to stick too much stuff on the stack and crashing immediately on start. That's usually the case when someone asks me why their previously working program doesn't even make it to the first instruction.
  • by wizzwizz4 on 11/8/24, 9:36 PM

    If it's not loading, add the following CSS:

      :root > body {
        visibility: visible;
        opacity: 1;
      }
  • by JSDevOps on 11/8/24, 10:06 PM

    Wow