Questions tagged [pageheap]

Image execution option in Windows placing invalid memory page after every heap allocation.

Pageheap is one of image execution options in Windows. It is designed to help with heap overrun debugging. Setting the option for an image (.exe file name) results in placing invalid memory pages after each heap allocation requested by the image. Pageheap option can be set using gflags or appverifier tools or directly in Windows Registry.

14 questions
6
votes
3 answers

Microsoft's strncat reads bytes beyond source buffer boundaries

I observe an interesting problem with the Microsoft implementation of strncat. It touches 1 byte beyond the source buffer. Consider the following code: #include #include #include #include void main() { …
glagolig
  • 1,100
  • 1
  • 12
  • 28
2
votes
2 answers

PageHeap does not show exact crash location

I am using PageHeap to identify heap corruption. My application has a heap corruption. But the application breaks(due to crash) when it creates an stl object for a string passed to a method. I cannot see any visible memory issues near the crash…
Maanu
  • 5,093
  • 11
  • 59
  • 82
2
votes
1 answer

Page Heap doesn't record useful stack infomation?

I'm trying to test a crash scenario (in an isolated test-app) with normal page heap (not full). I have set up the flags with gflags /p /enable Test.exe and I'm overwriting an integer buffer by one element ... const size_t s = 100; vector v1(s,…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
2
votes
0 answers

gethostbyname API fails when App Verifier is on

I ran into a problem trying to test an application under Application Verifier with Page Heap on. It turns out that gethostbyname API always fails even for legit host names like "localhost". The problem reproduces on every Win-7 or Server 2008 R2 I…
glagolig
  • 1,100
  • 1
  • 12
  • 28
2
votes
2 answers

Multi-threaded access in HEAP_NO_SERIALIZE heap

Our application crashes with the following error. =========================================================== VERIFIER STOP 00000003: pid 0x2E54: multithreaded access in HEAP_NO_SERIALIZE heap 00161000 : Heap handle 00001444 : Thread…
Maanu
  • 5,093
  • 11
  • 59
  • 82
1
vote
1 answer

Pageheap does not make my application break

I expected that Pageheap will force my application to crash while executing the 2nd and 3rd statements in the below code piece. But this is not happening. I enabled full page heap for the application. What extra things should I do to make pageheap…
Maanu
  • 5,093
  • 11
  • 59
  • 82
1
vote
0 answers

GetPrivateProfileString failed when I use gflags to enable page heap with flags(full unaligned traces)

My code is like this: #include #include int main () { TCHAR conffigPath[MAX_PATH] = {0}; GetCurrentDirectory(MAX_PATH, conffigPath); _tcscat_s(conffigPath, MAX_PATH, _T("\\config.ini")); TCHAR…
jeJee
  • 61
  • 4
1
vote
3 answers

CSocket:: Create throwing exception in my MFC application

I have my application(VC MFC) run with gflags with Pageheap enabled to track down the page heap corruption. Now the application has crashed and it shows this error, I could not interpret these lines (other than having a feel of resource…
buddy
  • 805
  • 1
  • 15
  • 30
0
votes
2 answers

Debug Visual C++ memory allocation problems

I'm debugging a software which crashes eventually with one of the following messages: 1. DAMAGE: after normal block (#24729280) at 0x00D710E0 2. Debug Assertion Failed Program: D:\Soft\Test.exe File: dbgheap.c Line: 1017 Expression:…
Rodrigo
  • 5,938
  • 6
  • 31
  • 39
0
votes
1 answer

Slow debugging in Visual Studio 2015 -- can't turn off page heap?

I am running Visual Studio 2015 and never had issues debugging before. However, lately debugging is very slow. I also started getting heap debug errors saying "Heap Corruption Detected" from the Microsoft Visual C++ Runtime Library. I will fix the…
lizcoder
  • 43
  • 6
0
votes
0 answers

SHGetFileInfo causes Heap Corruption when using SHGFI_ICON

When I enable Page Heap for my process under test, it triggers an Access Violation which indicates to me some type of heap corruption has occurred when SHGetFileInfo is called. The top of the call stack shows msvcr90!wcspbrk and walking down it…
JosephA
  • 1,187
  • 3
  • 13
  • 27
0
votes
2 answers

How to create random memory allocation failure?

I recently discovered PageHeap, a Windows debugging tool. Its option /fault permits injecting memory allocation failure every once in a while. Like, I want 1 allocation to fail every 100, or 1000, you decide. Do we have something similar on linux?…
qdii
  • 12,505
  • 10
  • 59
  • 116
0
votes
1 answer

Pageheap consumes a lot of memory

I have used pageheap for debugging heap corruptions in last four years. generally, I don't have any problems with it. But now I have faced with weird behavior. After enabling pageheap for my process in win7-sp1-x86 host using global flags with…
Anz
  • 21
  • 3
-5
votes
2 answers

After buf = malloc(1) with full page heap, why is the guard page exception not thrown until buf[16] is being overwritten?

Code in a bug int main() { void *ptr = 0; int overrun = 1; ptr = malloc(overrun); while(overrun++) { if(!ptr) while(1) Sleep(500); *((char*)ptr + (overrun+1)) = 'a'; …
user1813004