Live data from Hacker News

The case of a program that crashed on its first instruction

devblogs.microsoft.com

1–10 of 20 posts

Re: The case of a program that crashed on its first instruction

#4
post #2

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.

IMO the main reason Raymond Chen is so good at that, he does that a lot. Unless you work for Microsoft, it’s very unlikely your job requires analyzing thousands of crash dumps of random third-party programs.

I do that very rarely, and I only analyze the dumps of the programs I made. Of course, Raymond is way better than me at that, but I’m fine with it. People pay me to develop software for them; I only debug stuff when I have to.

BTW, couple years ago I wrote an article on the topic: http://const.me/articles/windbg/windbg-intro.pdf

Re: The case of a program that crashed on its first instruction

#5
post #2

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.

He has obviously decades of experience, but the basics of debugging with windbg aren't actually that difficult to start with. I remember trying to look into some memory dumps we got from crashes of our application from internal users, and was able to get relevant information pretty quickly just from some basic built-in diagnostic commands I picked up from his and the old NTDebugging blog (which seems to be sadly gone).

Re: The case of a program that crashed on its first instruction

#9
post #6

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.

    /* Optimize a program.
       May perform unsafe optimizations.
       May introduce up to 1 bug.
     */
    char *optimize(char *program) {
        (void) program;
        return ".export main\nmain:\n\tub2\n";
    }

Re: The case of a program that crashed on its first instruction

#10
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.
Post reply on HN