Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 4  
28 Nov 17 01:49
Vincent Jin
xxxxxx@gmail.com
Join Date: 30 Nov 2011
Posts To This List: 13
How to debug heap corruption problem?

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.
  Message 2 of 4  
28 Nov 17 18:09
Mikae
xxxxxx@yahoo.com
Join Date: 17 Feb 2011
Posts To This List: 360
How to debug heap corruption problem?

Have you tried special pool? ( https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/special-pool )
  Message 3 of 4  
01 Dec 17 04:07
Vincent Jin
xxxxxx@gmail.com
Join Date: 30 Nov 2011
Posts To This List: 13
How to debug heap corruption problem?

Unfortunately, Special pool can't detect the error... It there any other methods?
  Message 4 of 4  
01 Dec 17 06:45
Martin Burnicki
xxxxxx@meinberg.de
Join Date: 11 Oct 2017
Posts To This List: 9
How to debug heap corruption problem?

xxxxx@gmail.com 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: SOME_STRUCURE *p; p = malloc( sizeof( p ) ); // wrong: size of the pointer only -vs- 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 -- Martin Burnicki Senior Software Engineer MEINBERG Funkuhren GmbH & Co. KG Email: xxxxx@meinberg.de Phone: +49 (0)5281 9309-14 Linkedin: https://www.linkedin.com/in/martinburnicki/ 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 Websites: https://www.meinberg.de https://www.meinbergglobal.com Training: https://www.meinberg.academy
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 21:43.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license