Click here to Skip to main content
15,926,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: destructor - string, multimap, ifstream Pin
Maxwell Chen14-Aug-07 21:18
Maxwell Chen14-Aug-07 21:18 
AnswerRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 19:58
Stephen Hewitt14-Aug-07 19:58 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 20:35
devvvy14-Aug-07 20:35 
GeneralRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 20:37
Stephen Hewitt14-Aug-07 20:37 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 20:43
devvvy14-Aug-07 20:43 
GeneralRe: destructor - string, multimap, ifstream Pin
Maxwell Chen14-Aug-07 21:04
Maxwell Chen14-Aug-07 21:04 
GeneralRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 21:10
Stephen Hewitt14-Aug-07 21:10 
AnswerRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 20:04
Stephen Hewitt14-Aug-07 20:04 
I'd guess you've corrupted the heap at another location in your program and the problem in manifesting here. Try the following:

I give the following advice about once a month; it often helps me track down the nastier heap errors:

Try enabling the page heap[^] for your process. Follow these steps:
1. Download and install WinDBG[^].
2. Select “Start”->“All Programs”->“Debugging Tools for Windows”->“Global Flags”.
3. Select the “Image File” tab.
4. In the “Image: (TAB to refresh)” edit control enter the name of your app then press TAB. Just the name with the extension; not the full path.
5. Tick the following:
- “Enable page heap”
- “Enable heap tail checking”
- “Enable heap free checking”
- “Enable heap parameter checking”
- “Enable heap validation on call”
- “Create user mode stack trace database”
6. Press “Apply”.
7. Debug your application. Any debugger will do but with WinDBG you have access to the stack traces of allocations via the !heap –p –a command, for example. When a heap problem is detected a breakpoint will be generated.
8. When done un-tick all the options you ticked, press “Apply” then dismiss GFlags. This step is important as if it’s skipped all applications named as entered in step 4 will run with the page heap enabled.

Note that when using the page heap your application will run much slower than normal and consume way more memory. It’s good to have a beefy machine to do such tests; and such tests should be ran regularly on all applications you develop as part of regular testing activities. If I find a part of my application that’s too slow with the page heap enabled I optimize the memory allocation in that region.


Steve

GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 21:49
devvvy14-Aug-07 21:49 
GeneralRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 21:51
Stephen Hewitt14-Aug-07 21:51 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 23:01
devvvy14-Aug-07 23:01 
GeneralRe: destructor - string, multimap, ifstream Pin
jhwurmbach14-Aug-07 23:23
jhwurmbach14-Aug-07 23:23 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 23:32
devvvy14-Aug-07 23:32 
GeneralRe: destructor - string, multimap, ifstream Pin
jhwurmbach14-Aug-07 23:35
jhwurmbach14-Aug-07 23:35 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy15-Aug-07 0:36
devvvy15-Aug-07 0:36 
GeneralRe: destructor - string, multimap, ifstream Pin
jhwurmbach15-Aug-07 1:22
jhwurmbach15-Aug-07 1:22 
Generalhow can I enable "Full-page heap" from Global Flags? Pin
devvvy15-Aug-07 17:43
devvvy15-Aug-07 17:43 
QuestionRe: destructor - string, multimap, ifstream Pin
David Crow15-Aug-07 3:17
David Crow15-Aug-07 3:17 
AnswerRe: destructor - string, multimap, ifstream Pin
devvvy15-Aug-07 13:49
devvvy15-Aug-07 13:49 
Questiona simple question for serialization Pin
asdertim14-Aug-07 12:33
asdertim14-Aug-07 12:33 
AnswerRe: a simple question for serialization Pin
Mark Salsbery14-Aug-07 14:51
Mark Salsbery14-Aug-07 14:51 
GeneralRe: a simple question for serialization Pin
asdertim14-Aug-07 18:42
asdertim14-Aug-07 18:42 
QuestionRe: a simple question for serialization Pin
Mark Salsbery14-Aug-07 19:05
Mark Salsbery14-Aug-07 19:05 
AnswerRe: a simple question for serialization Pin
asdertim14-Aug-07 19:20
asdertim14-Aug-07 19:20 
GeneralRe: a simple question for serialization Pin
Nelek20-Aug-07 20:02
protectorNelek20-Aug-07 20:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.