Heap Corruption in richedit
-
Hi I am getting a heap corruption. I am running under the visual studio debugger. and the exception is at
Quote:
ntdll.dll!RtlReportCriticalFailure() Unknown
My scenario is I have a DLL reading and formatting data for a .exe. I keep a record count so when I get a exception, at
Quote:
ntdll.dll!RtlReportCriticalFailure() Unknown
I insert code if (recordcount == 0x0000196e) __debugbreak; I then start stepping through the code looking for the problem how ever when stepping through the code works I try this multiple times however when I stop the code where the exception were to occur it always complete successfully The listing I am trying to to inset in the richedit is huge about 153 pages 30 lines to page, 134 bytes across I roughly calculate the number of bytes I am trying to insert into the richedit is 1.6 meg. I am not sure if the size is the issue I do a Rciheditctrl::LimitText with the amount bytes I need Again when break on the offending record and step thru the code it completes normally Here is the stack frame My code starts a the DriveRichedit.exe ntdll.dll!RtlReportCriticalFailure() Unknown ntdll.dll!RtlpHeapHandleError() Unknown ntdll.dll!RtlpHpHeapHandleError() Unknown ntdll.dll!RtlpLogHeapFailure() Unknown ntdll.dll!RtlpHeapFindListLookupEntry() Unknown ntdll.dll!RtlpFindEntry() Unknown ntdll.dll!RtlpAllocateHeap() Unknown ntdll.dll!RtlpAllocateHeapInternal() Unknown riched20.dll!CTxtArray::AddBlock(long,long) Unknown riched20.dll!CTxtArray::SplitBlock(long,long,long,long,int) Unknown riched20.dll!CTxtPtr::InsertRange(long,unsigned short const *) Unknown riched20.dll!CRchTxtPtr::ReplaceRange(long,long,unsigned short const *,class IUndoBuilder *,long,long *,unsigned long) Unknown riched20.dll!CTxtRange::ReplaceRange(long,unsigned short const *,class IUndoBuilder *,enum SELRR,long *,unsigned long) Unknown riched20.dll!CTxtRange::CheckLimitReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned long,long *,long,int,unsigned long) Unknown riched20.dll!CTxtRange::CleanseAndReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned short *,long *,unsigned long) Unknown riched20.dll!CLightDTEngine::ReadPlainText(class CTxtRange *,struct _editstream *,int,class IUndoBuilder *,long) Unknown riched20.dll!CLightDTEngine::LoadFromEs(class CTxtRange *,long,struc
-
Hi I am getting a heap corruption. I am running under the visual studio debugger. and the exception is at
Quote:
ntdll.dll!RtlReportCriticalFailure() Unknown
My scenario is I have a DLL reading and formatting data for a .exe. I keep a record count so when I get a exception, at
Quote:
ntdll.dll!RtlReportCriticalFailure() Unknown
I insert code if (recordcount == 0x0000196e) __debugbreak; I then start stepping through the code looking for the problem how ever when stepping through the code works I try this multiple times however when I stop the code where the exception were to occur it always complete successfully The listing I am trying to to inset in the richedit is huge about 153 pages 30 lines to page, 134 bytes across I roughly calculate the number of bytes I am trying to insert into the richedit is 1.6 meg. I am not sure if the size is the issue I do a Rciheditctrl::LimitText with the amount bytes I need Again when break on the offending record and step thru the code it completes normally Here is the stack frame My code starts a the DriveRichedit.exe ntdll.dll!RtlReportCriticalFailure() Unknown ntdll.dll!RtlpHeapHandleError() Unknown ntdll.dll!RtlpHpHeapHandleError() Unknown ntdll.dll!RtlpLogHeapFailure() Unknown ntdll.dll!RtlpHeapFindListLookupEntry() Unknown ntdll.dll!RtlpFindEntry() Unknown ntdll.dll!RtlpAllocateHeap() Unknown ntdll.dll!RtlpAllocateHeapInternal() Unknown riched20.dll!CTxtArray::AddBlock(long,long) Unknown riched20.dll!CTxtArray::SplitBlock(long,long,long,long,int) Unknown riched20.dll!CTxtPtr::InsertRange(long,unsigned short const *) Unknown riched20.dll!CRchTxtPtr::ReplaceRange(long,long,unsigned short const *,class IUndoBuilder *,long,long *,unsigned long) Unknown riched20.dll!CTxtRange::ReplaceRange(long,unsigned short const *,class IUndoBuilder *,enum SELRR,long *,unsigned long) Unknown riched20.dll!CTxtRange::CheckLimitReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned long,long *,long,int,unsigned long) Unknown riched20.dll!CTxtRange::CleanseAndReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned short *,long *,unsigned long) Unknown riched20.dll!CLightDTEngine::ReadPlainText(class CTxtRange *,struct _editstream *,int,class IUndoBuilder *,long) Unknown riched20.dll!CLightDTEngine::LoadFromEs(class CTxtRange *,long,struc
I am curios, are you using the MFC code in a Managed C++/CLI application? :confused:
-
I am curios, are you using the MFC code in a Managed C++/CLI application? :confused:
-
Hi I am getting a heap corruption. I am running under the visual studio debugger. and the exception is at
Quote:
ntdll.dll!RtlReportCriticalFailure() Unknown
My scenario is I have a DLL reading and formatting data for a .exe. I keep a record count so when I get a exception, at
Quote:
ntdll.dll!RtlReportCriticalFailure() Unknown
I insert code if (recordcount == 0x0000196e) __debugbreak; I then start stepping through the code looking for the problem how ever when stepping through the code works I try this multiple times however when I stop the code where the exception were to occur it always complete successfully The listing I am trying to to inset in the richedit is huge about 153 pages 30 lines to page, 134 bytes across I roughly calculate the number of bytes I am trying to insert into the richedit is 1.6 meg. I am not sure if the size is the issue I do a Rciheditctrl::LimitText with the amount bytes I need Again when break on the offending record and step thru the code it completes normally Here is the stack frame My code starts a the DriveRichedit.exe ntdll.dll!RtlReportCriticalFailure() Unknown ntdll.dll!RtlpHeapHandleError() Unknown ntdll.dll!RtlpHpHeapHandleError() Unknown ntdll.dll!RtlpLogHeapFailure() Unknown ntdll.dll!RtlpHeapFindListLookupEntry() Unknown ntdll.dll!RtlpFindEntry() Unknown ntdll.dll!RtlpAllocateHeap() Unknown ntdll.dll!RtlpAllocateHeapInternal() Unknown riched20.dll!CTxtArray::AddBlock(long,long) Unknown riched20.dll!CTxtArray::SplitBlock(long,long,long,long,int) Unknown riched20.dll!CTxtPtr::InsertRange(long,unsigned short const *) Unknown riched20.dll!CRchTxtPtr::ReplaceRange(long,long,unsigned short const *,class IUndoBuilder *,long,long *,unsigned long) Unknown riched20.dll!CTxtRange::ReplaceRange(long,unsigned short const *,class IUndoBuilder *,enum SELRR,long *,unsigned long) Unknown riched20.dll!CTxtRange::CheckLimitReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned long,long *,long,int,unsigned long) Unknown riched20.dll!CTxtRange::CleanseAndReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned short *,long *,unsigned long) Unknown riched20.dll!CLightDTEngine::ReadPlainText(class CTxtRange *,struct _editstream *,int,class IUndoBuilder *,long) Unknown riched20.dll!CLightDTEngine::LoadFromEs(class CTxtRange *,long,struc