Re: Crash: HEAP: Free Heap block modified...



I see no place where this is happening. Look at the stack backtrace! There is no
instance of creating a process or window from OnPaint! Perhaps you were confused by
reading the stack trace backwards. There is no evidence in this stack trace of any
process creation in the middle of a paint operation.

***************TOP OF STACK (most recent execution)********************
NTDLL! 77f9193c()
NTDLL! 77f9c73e()
NTDLL! 77fb064e()
NTDLL! 77f9bd5a()
NTDLL! 77fcb63e()
_heap_alloc_base(unsigned int 112) line 200
_heap_alloc_dbg(unsigned int 68, int 1, const char * 0x5f4d096c
THIS_FILE, int 72) line 378 + 9 bytes
_nh_malloc_dbg(unsigned int 68, int 0, int 1, const char * 0x5f4d096c
THIS_FILE, int 72) line 248 + 21 bytes
_malloc_dbg(unsigned int 68, int 1, const char * 0x5f4d096c THIS_FILE,
int 72) line 165 + 27 bytes
operator new(unsigned int 68, int 1, const char * 0x5f4d096c
THIS_FILE, int 72) line 373 + 22 bytes
operator new(unsigned int 68, const char * 0x5f4d096c THIS_FILE, int
72) line 65 + 19 bytes
CMapPtrToPtr::InitHashTable(unsigned int 17, int 1) line 72 + 19 bytes
CMapPtrToPtr::operator[](void * 0x01010057) line 222
CHandleMap::SetPermanent(void * 0x01010057, CObject * 0x0012f804
{hDC=0x01010057 attrib=0x00000000}) line 183 + 12 bytes
CDC::Attach(HDC__ * 0x01010057) line 118
CWindowDC::CWindowDC(CWnd * 0x0cfd6d08 {CDockBar hWnd=0x0047086e})
line 1013 + 36 bytes
CControlBar::EraseNonClient() line 601 + 12 bytes
CDockBar::OnNcPaint() line 595
......stuff that happened before paint operation omitted
**************BOTTOM OF STACK*************

On Tue, 10 Apr 2007 17:04:51 +0200, Mihajlo Cvetanovic <mac@xxxxxxxxxxxxxxxxxx> wrote:

pascal.steiss@xxxxxx wrote:
...
AfxWndProcBase(HWND__ * 0x0047086e, unsigned int 133, unsigned int
2097417450, long 0) line 220 + 21 bytes
...
CDockBar::OnPaint() line 605 + 12 bytes
...

Somebody correct me if I'm wrong, but isn't it a bad idea to create
another window (or process messages in some other way) from OnPaint?
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Having C code looking like C++ code
    ... providing an integer stack. ... | extern int push; ... | typedef struct stacktype { ... muck around inside the encapsulation to use the interface. ...
    (comp.lang.c)
  • Re: [OT] C programming, variable size array
    ... The trick to understanding here is to know how memory gets allocated. ... int main{ ... The stack holds "automatic" variables used in C, ... Will automatically allocate and deallocate 1K of data on the stack. ...
    (Debian-User)
  • [EXPL] Avoiding Stack Protections Shellcode Example
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... systems that use stack protection. ... will be using pieces of code of ntdll for serving our purposes. ... executing our thread to code in ntdll.dll ...
    (Securiteam)
  • avoiding stackguard
    ... Shellcode without zeros. ... All we have listened about stack protections. ... In this code im using pieces of code of ntdll for doing my ... 0xDF,0x2F,0x46,0x78,//goto stosd/pop edi/retn 4 ...
    (Bugtraq)
  • Re: Link Instruction & tt command
    ... In order to do the trace, ... than C, the routine's entry point is non-standard, or the task's stack ... int f_c ... framepointer, and you can not make any stacktraces. ...
    (comp.os.vxworks)