evan_tech

Previous Entry Share Next Entry
10:19 pm, 1 Dec 08

dean schools me on assembly

An old friend was in town the past few weeks and we worked together a bit. His background is in "the hacking scene" so I always learn a ton from him. One event in particular for this post: in debugging a crash* where the backtrace indicated a jump to a garbage address, he immediately dropped to disassembly and pointed out the vtable call, and from there worked out the relevant types (what was expected, what was pointed at concretely) by examining memory.

I was struck by this in how different it was from how I'd have approached the problem (which can maybe be summarized as "stare at it really hard"). I can follow assembly when pressed but it would not have occurred to me to start from there. It also struck me how few people I know would even be able to recognize what calling through a vtable looks like in assembly (especially Intel syntax!), and how this is plainly a hole in my education / skill set.

Of course, one of my officemates is one of those people (and he's years younger than me, so that's no excuse). He explained he'd started out programming in assembly because he didn't have access to a compiler when he was little. Some people are just hard core.

* The problem ended up being a subclass's override of a virtual function where the superclass's function changed its type, causing the subclass code to no longer match and override. This was all far removed from the crash, of course. An extra twist of irony was that it only exhibited on a Digg article about Chrome working on Linux.