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 inavailablity) Can anyone throw a light on what exactly is the reason that has caused the crash of the app? (info: Application is a multithreaded one about

CSocket ::在MFC应用程序中创建抛出异常

我有我的应用程序(VC MFC)使用启用PageHAP的gflags运行以追踪页堆损坏。 现在应用程序崩溃了,它显示了这个错误,我无法解释这些行(除了感觉到资源不可用) 任何人都可以点亮导致应用崩溃的原因究竟是什么? (info:应用程序是一个多线程程序,在多处理器机器中运行约500个线程) kernel32!RaiseException+53 msvcrt!_CxxThrowException+36 mfc42u!AfxThrowResourceException+19 mfc42u!AfxRegisterWndClass+ab mf

Heap corruption c++ Function to return a table pointer

I've got this problem with a program that I've been trying to solve by myself for days now and still don't know what exactly am I doing wrong. Could you please help? First I thought the fuss is all about the null at the end of the char table, but as you can see I fixed that and Visual Studio still tells me that I cause heap corruption somehow: "HEAP CORRUPTION DETECTED: after

堆腐败c ++函数返回一个表指针

我有一个程序,我一直试图自己解决好几天,但仍然不知道我到底做错了什么。 能否请你帮忙? 首先,我认为大惊小怪是关于char表末尾的null,但正如你所看到的,我修正了这个问题,Visual Studio仍然告诉我,我会以某种方式导致堆损坏: “HEAP CORRUPTION DETECTED:Normal block(#186)at 0x02BAEC90.CTRL detected that the application write to memory after heap buffer buffer。” 感谢所有希望提前帮助初学者的人!

HEAP CORRUPTION DETECTED: after Normal block

I am trying to define on my own the string class in C++ just for practice and when defining an append function I get the following error: HEAP CORRUPTION DETECTED: after Normal block CRT detected that the application wrote to memory after end of heap buffer. The break is when I try to deallocate memory in "delete[] aPtr" Here is my code: Private members: int len, cap; char *aPtr;

HEAP CORRUPTION DETECTED:after Normal block

我想自己定义C ++中的字符串类只是为了练习,当定义一个附加函数时,我得到以下错误: HEAP CORRUPTION DETECTED:普通模块CRT检测到应用程序在堆缓冲区结束后写入内存之后。 当我尝试在“delete [] aPtr”中释放内存时,这个中断就是我的代码: 私人会员:int len,cap; char * aPtr; String::String() //default constructor { len = 0; cap = 1; aPtr = new char[1]; aPtr[0] = ''; } String::String(const String &a

c++ array iteration with addresses

I am new to c++ and trying out some stuff. So recently I tried to create an int array on the heap and iterate it with addressation instead the standard way with [x]. Everytime I execute my code I get a heap corruption error. I tried several things (also searched here on stackoverflow) but could not find any answers. int* p = new int[5]; for (int i = 0; i <= 4; i++){ /*p[i] = i; c

带地址的c ++数组迭代

我是新来的C + +尝试一些东西。 所以最近我试图在堆上创建一个int数组,然后用地址化代替标准的[x]方法迭代它。 每次执行我的代码时,我都会收到一个堆损坏错误。 我尝试了几件事(也在这里搜索stackoverflow)但找不到任何答案。 int* p = new int[5]; for (int i = 0; i <= 4; i++){ /*p[i] = i; cout << p[i] << endl;*/ //This is the standard way and works *p = i; cout <<

C++ delete crashes on certain instances

I have the following C++ method: void MyClass::FindBottom ( CIppImage& bwImage, FieldRec* obField, int& bottomBorder_top, int& bottomBorder_bottom, int& topBorder_top, int& topBorder_bottom, bool& algoFoundBorder ){ int scanYStart = topBorder_top + obField->getH() - VERTICAL_SCAN_AMOUNT; int scanYEnd = topBorder_top + obField->getH() + ( VERTICAL_SCAN_AMOUN

C ++在某些情况下删除崩溃

我有以下C ++方法: void MyClass::FindBottom ( CIppImage& bwImage, FieldRec* obField, int& bottomBorder_top, int& bottomBorder_bottom, int& topBorder_top, int& topBorder_bottom, bool& algoFoundBorder ){ int scanYStart = topBorder_top + obField->getH() - VERTICAL_SCAN_AMOUNT; int scanYEnd = topBorder_top + obField->getH() + ( VERTICAL_SCAN_AMOUNT * 1.5 );

Can calling memset on a dynamically allocated memory cause heap corruption

While debugging a segmentation fault in a real project, where the crash happens after a long run with random testing which are not easy to reproduce. Crash point shows crash in a function which is written something like void deallocateObject( objectType* ptr) { ASSERT(ptr); if(!ptr) return; if(ptr->customDeallocator) ptr->customDeallocator->deallocate();

可以在动态分配的内存上调用memset会导致堆损坏

在真正的项目中调试分段错误时,在长时间运行后发生崩溃并且随机测试不容易重现。 崩溃点显示在写入类似的函数中崩溃 void deallocateObject( objectType* ptr) { ASSERT(ptr); if(!ptr) return; if(ptr->customDeallocator) ptr->customDeallocator->deallocate(); else free(ptr); } 项目中使用了各种分配器和释放器。 为了验证分段错误不是因为分配的内存在释放后没有

What can explain heap corruption on a call to free()?

I have been debugging a crash for days now, that occurs in the depths of OpenSSL (discussion with the maintainers here). I took some time investigating so I'll try to make this question interesting and informative. First and to give some context, my minimal-sample that reproduces the crash is as follow: #include <openssl/crypto.h> #include <openssl/ec.h> #include <openssl/o

什么可以解释对free()的调用堆腐败?

我已经调试了几天的崩溃,这发生在OpenSSL的深处(与维护人员讨论)。 我花了一些时间进行调查,所以我会尽量让这个问题有趣和丰富。 首先,为了给出一些上下文,我的最小样本再现崩溃如下: #include <openssl/crypto.h> #include <openssl/ec.h> #include <openssl/objects.h> #include <openssl/pem.h> #include <openssl/err.h> #include <openssl/engine.h> int main() { ERR_

Finding heap corruption

This is an extension of my previous question, Application crash with no explanation. I have a lot of crashes that are presumably caused by heap corruption on an application server. These crashes only occur in production; they cannot be reproduced in a test environment. I'm looking for a way to track down these crashes. Application Verifier was suggested, and it would be fine, but it&#

发现堆腐败

这是我以前的问题的延伸,应用程序崩溃没有解释。 我有很多崩溃,这大概是由应用程序服务器上的堆损坏引起的。 这些崩溃只发生在生产中; 他们不能在测试环境中复制。 我正在寻找一种方法来追踪这些崩溃。 应用程序验证器被建议,它会很好,但它对我们的生产服务器无法使用。 当我们尝试使用应用程序验证程序在生产环境中启动它时,即使这是一个相当强大的服务器(64位应用程序,16 GB内存,8个处理器),它变得非常缓慢

Segmentation faults in deque of user

I have a deque<rect*> rects where rect is a user-defined class. When I try to insert a rect* into it, I get a segmentation fault. gdb traces the problem back to a function called __memmove_sse3() from my calling rects.insert(it,new rect([constructor parameters])); where it is a deque<rect*>::iterator . What could cause this error? EDIT: here is a snippet of my code: for(deque&l

用户分类出现分段错误

我有一个deque<rect*> rects ,其中rect是用户定义的类。 当我尝试在其中insert rect*时,出现分段错误。 gdb从我调用的rects.insert(it,new rect([constructor parameters]));这个问题追溯到一个名为__memmove_sse3()的函数rects.insert(it,new rect([constructor parameters])); it是一个deque<rect*>::iterator 。 什么可能导致这个错误? 编辑:这是我的代码片段: for(deque<rect*>::iterator it=r

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

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

只是不要告诉我谷歌,因为我在过去的48小时内做了。 这是我的问题; 我创建了一个lon程序,它执行很多次迭代; 但是在很少的传播中,这个错误来了... Critical error detected c0000374 Project.exe has triggered a breakpoint. The program '[4452] Project.exe' has exited with code 0 (0x0). 因此,Visual Studio 2012将打开newaop.cpp; 其中包含几行 // newaop -- operator new[](size_t) REPLACEABLE #include <ne