O'Reilly logo

Memory Dump Analysis Anthology, Volume 7 by Dmitry Vostokov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Divide by Zero (User Mode)

This is a Mac OS X / GDB counterpart to Divide by Zero (user mode) pattern previously described for Windows platforms (Volume 2, page 96):

(gdb) bt
#0 0×000000010d3ebe9e in bar (a=1, b=0)
#1 0×000000010d3ebec3 in foo ()
#2 0×000000010d3ebeeb in main (argc=1, argv=0×7fff6cfeab18)


(gdb) x/i 0×000000010d3ebe9e
0×10d3ebe9e : idiv %esi


(gdb) info r rsi
rsi 0×0 0

The modeling application source code:

int bar(int a, int b)
{
        return a/b;
}

int foo()
{
        return bar(1,0);
}

int main(int argc, const char * argv[])
{
        return foo();
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required