Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

How to debug heap corruption problem?

Vincent_JinVincent_Jin Member Posts: 33
I'm debugging a storport driver. There's a heap corruption when I try to format the storage device. It's only a check afterward. Is there any method to find out when the real heap corruption happens?

It's also very strange to this storport driver. When I use fio to test the raw disk, It works fine. But when I use the management tool to format the disk, it reports heap corruption.


  • Vincent_JinVincent_Jin Member Posts: 33
    Unfortunately, Special pool can't detect the error...
    It there any other methods?
  • Martin_BurnickiMartin_Burnicki Member - All Emails Posts: 18 wrote:
    > Unfortunately, Special pool can't detect the error...
    > It there any other methods?

    No idea how to detect the real location of the error automatically, and
    haven't tried things like "special pool", yet.

    However, doesn't this sound like a kind of buffer overflow?

    I had a similar problem with some code like this:


    p = malloc( sizeof( p ) ); // wrong: size of the pointer only
    p = malloc( sizeof( *p ) ); // correct size of the buffer

    Erroneously typed "sizeof( p )" instead of "sizeof( *p )", so only the
    size of a pointer got allocated instead of the real size of the
    structure. So when another structure was copied to the allocated one
    some bytes were written beyond the allocated buffer.

    Eventually there's something similar in your code. Just an idea.

    Martin Burnicki

    Senior Software Engineer

    MEINBERG Funkuhren GmbH & Co. KG
    Phone: +49 (0)5281 9309-14

    Lange Wand 9, 31812 Bad Pyrmont, Germany
    Amtsgericht Hannover 17HRA 100322
    Geschäftsführer/Managing Directors: Günter Meinberg, Werner Meinberg,
    Andre Hartmann, Heiko Gerstung
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!