On Thu, Sep 3, 2009 at 6:45 AM, Mulyadi Santosa<mulyadi.santosa@xxxxxxxxx> wrote: > On Wed, Sep 2, 2009 at 6:08 PM, Manish Katiyar<mkatiyar@xxxxxxxxx> wrote: >> Hi, >> >> I was going through this post >> http://kerneltrap.org/mailarchive/linux-kernel/2008/1/8/546623 and >> couldn't understand the steps around the below paragraph. >> >> " >> and run it under gdb, and then when it gets the SIGSEGV (due to the >> obvious NULL pointer dereference), I can just ask gdb to disassemble >> around the array that contains the code[] stuff. Try a few offsets, to see >> when the disassembly makes sense (and gives the reported EIP as the >> beginning of one of the disassembled instructions). >> " >> Has anyone tried this ?? I don't see any useful disas instructions >> when I do so ... Need help in interpreting the procedures of the above >> pos > > Hi Manish... > > I am not so clear either, but perhaps by exchanging each of our > knowledge, we can teach each other. Specificly, which part that > confuses you? The disas part? That's what the "x/20i" does toward the > start address of array "array". It turns that sequence of hex numbers > into instructions. > > I think the real art here is spotting the offending instruction. I > think Linus find it out actually by lookin that there is prefetch > instruction in array+49. And since it's prefetching at the address > stored in %eax, so the last instruction that modifies its content is > surely the root of the problem. > > In the other cases, decoding might be not that easy. So IMO that's why > stack trace provides code context. It's not just the offending > instruction which is dumped, but ones sorrounding it. thanks a lot.. now if I go back and read the post again, it is much more clear. BTW probably a stupid question, why does the op code in char string generates back the assembly ?? > > -- > regards, > > Mulyadi Santosa > Freelance Linux trainer > blog: the-hydra.blogspot.com > -- Thanks - Manish -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ