Home > Uncategorized > Core Dumps Rock

Core Dumps Rock

So it’s been a while since my last post, and I find myself thinking about core dumps lately.

I won’t be wowing you with my awesome knowledge or teaching obscure implementation details regarding core dumps… I guess my bottom line message is “core dumps rock.”

Some of the more hard-core guys like Linus don’t believe in debuggers (real men don’t need ’em, eh?) but for the rest of us mere mortals debuggers are vital tools. And while I agree with Linus’s reasoning against debuggers, especially in the kernel — I guess I’m a pragmatist at heart. Use whatever tool helps you get the job done…

Anyways, core dumps are awesome. Especially if any of the following are true:
– you’re chasing an intermittent bug that only happens once in N runs or doesn’t reproduce with a debugger attached
– your code is running on an embedded device and there’s no JTAG (hence no realtime debugging/debugger)
– you want to save a snapshot of the system/app/problem for debugging later

Core dumps (and what triggers them) vary from OS to OS, but they generally contain some/all of the following:
– the page tables/memory for the crashing process, or a full RAM dump on some embedded targets
– the processor registers, including MMU configuration and other hardware configuration/state info

This info can be loaded into a debugger later on to construct a backtrace, examine variables, and can go a long ways towards solving the crash at hand.

I’ve used core dumps several times recently and it’s been a real lifesaver. The exact mechanics of using core dumps are already documented ad nauseum elsewhere, so I won’t repeat that info here. Just wanted to put in a plug for core dumps… Because when you need ’em, they… Rock.


Categories: Uncategorized Tags: ,
  1. Eddie
    April 24, 2011 at 7:03 pm

    wow, because of what you said about Linus, I just read: http://linuxmafia.com/faq/Kernel/linus-im-a-bastard-speech.html

    … and I find there is some truth to his argument, but I don’t agree with the result. And wow, Linus is so offensive. Glad I don’t have to work with him. Such a jerk. But I suppose in order to be a leader, one has to occasionally offend people. Still, I think he’s wrong about debuggers. [/rant]

    • April 24, 2011 at 8:22 pm

      I’ve never met Linus so I can’t speak to what he’s like in real life, but in his emails he is very opinionated and doesn’t pull any punches. You’re right, he’s not very nice and downright mean sometimes. But having worked with (and intrerviewed) some people who couldn’t code their way out of a paper bag… I totally get his frustration with incompetence. I’d probably rather work with someone rude but highly competent than someone who’s nice but technically useless. You can learn a lot and do cool things with the first kind of person but you waste a lot of time trying to fix mistakes made by people in the latter group.

      All that aside I still think debuggers are useful in the right hands.. and coredumps rock 🙂

  2. Eddie
    April 24, 2011 at 7:11 pm

    I mean, my opinion of him just went way, way down. I’m kind of shocked.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: