a bizarre "Project.exe has triggered a breakpoint."?

just don't tell me google that, because I did it for the last 48 hours. this is my problem; I create a lon program, which execute many itterations; but in few itterations, this error comes ...

Critical error detected c0000374
Project.exe has triggered a breakpoint.
The program '[4452] Project.exe' has exited with code 0 (0x0).

so, Visual Studio 2012 opens newaop.cpp; which contains few line

// newaop -- operator new[](size_t) REPLACEABLE
#include <new>

void *__CRTDECL operator new[](size_t count) _THROW1(std::bad_alloc)
     {  // try to allocate count bytes for an array
return (operator new(count));
}

/*
 * Copyright (c) 1992-2007 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
 V5.03:0009 */

pointing to the return line... I searched so many; but nothing works; the problem in that, my program works for few itterations I tried to locate the instructions generating this erreor (with cout's) and I found this loop

for (int i = OriginalCadre.X.x + 1; i < OriginalCadre.X.x + OriginalCadre.height; i++){
            for (int j = OriginalCadre.X.y + 1; j < OriginalCadre.X.y + OriginalCadre.width; j++){
                QuantityColor[Pattern_init[i][j]] ++;
            }
        }

this loop works at the begening for few itterations; which is bizarre !


Critical error detected c0000374 is a sign of heap corruption, which means you might be doing bad things with memory eg writing after the end of a buffer, or writing to a buffer after it's been freed back to the heap.

I don't see any tell tale signs in that small loop, but likely you are writing past the memory location of QuantityColor or something similar.

Debugging heap corruption errors

链接地址: http://www.djcxy.com/p/82320.html

上一篇: 用户分类出现分段错误

下一篇: 一个奇怪的“Project.exe引发了一个断点。”?