How to debug heap corruption on armv5

I am on linux on an embedded device. My architecture is armv5. My fairly large (~30kloc) has some kind of heap corruption that happens over time. I cannot run valgrind since my arch is not supported. I can only run a limited gdb since my app uses thread and the corruption most probably happens in one of the thread. I get warning: Unable to find libthread_db matching inferior's threa

如何在armv5上调试堆损坏

我在嵌入式设备上的Linux上。 我的架构是armv5。 我相当大的(〜30kloc)随着时间的推移发生了一些堆腐败。 由于我的拱不被支持,我无法运行valgrind。 我只能运行有限的gdb,因为我的应用程序使用线程,并且最可能发生的损坏发生在一个线程中。 我明白了 警告:无法找到匹配劣质线程库的libthread_db,线程调试将不可用。 libthread_db和libpthread来自我的gnueabi工具链。 我想知道现在最好的行动是什么。 我应

Why would fclose hang / deadlock? (Windows)

I have a directory change monitor process that reads updates from files within a set of directories. I have another process that performs small writes to a lot of files to those directories (test program). Figure about 100 directories with 10 files in each, and about 500 files being modified per second. After running for a while, the directory monitor process hangs on a call to fclose() in a

为什么会死锁/死锁? (视窗)

我有一个目录更改监视器进程,用于从一组目录中的文件读取更新。 我有另一个进程对很多文件执行小写操作(测试程序)。 图中大约有100个目录,每个目录有10个文件,每秒约有500个文件被修改。 运行一段时间后,目录监视器进程挂起一个调用fclose()的方法,该方法基本上拖曳文件。 在这个方法中,我fopen()文件,检查句柄是否有效,做一些查找和读取,然后调用fclose() 。 这些读取全部由该进程中的相同线程执行。 挂起之

how to fix bug due to a heap corruption

I have the following callstak when my application crash (create via MSVC210 save dump feature and winbdg in a second time with k command): 0012c720 7d684c89 0012c93c 7d656a16 063acab8 ntdll!DbgBreakPoint 0012c728 7d656a16 063acab8 0000035c 035f0000 ntdll!RtlpBreakPointHeap+0x28 0012c93c 7d685892 035f0000 50000161 0000035c ntdll!RtlAllocateHeapSlowly+0x231 0012c9b0 7d65695e 035f0000 50000161 0000

如何修复由于堆损坏导致的错误

当我的应用程序崩溃时(使用k命令第二次通过MSVC210保存转储功能和winbdg创建),我有以下callstak: 0012c720 7d684c89 0012c93c 7d656a16 063acab8 ntdll!DbgBreakPoint 0012c728 7d656a16 063acab8 0000035c 035f0000 ntdll!RtlpBreakPointHeap+0x28 0012c93c 7d685892 035f0000 50000161 0000035c ntdll!RtlAllocateHeapSlowly+0x231 0012c9b0 7d65695e 035f0000 50000161 0000035c ntdll!RtlDebugAllocateHeap+0xaf 0012cbc

C++ corruption of the heap

I have a simple synchronisedQueue template <typename T> class SynchronisedQueue { public: void Enqueue(const T& data) { boost::unique_lock<boost::mutex> lock(queueMutex); dataQueue.push(data); conditionVariable.notify_one(); } T Dequeue() { boost::unique_lock<boost::mutex&g

C ++腐败的堆

我有一个简单的同步队列 template <typename T> class SynchronisedQueue { public: void Enqueue(const T& data) { boost::unique_lock<boost::mutex> lock(queueMutex); dataQueue.push(data); conditionVariable.notify_one(); } T Dequeue() { boost::unique_lock<boost::mutex> lock(que

Debug assertion failed

I keep encountering this "Debug assertions failed!" error when I run my program in debug mode. I tried looking this error up on the visual C++ website but the explanations are too advanced for me and they don't have any resemblance to what my best guess as to the problem is. I have went through my code and narrowed down the point at which the error occurs. It seems to be happen

调试断言失败

我一直遇到这个"Debug assertions failed!" 当我在调试模式下运行我的程序时出错。 我试图在Visual C ++网站上查找这个错误,但是对于我来说解释过于先进,并且它们与我对该问题的最佳猜测没有任何相似之处。 我已经通过我的代码并缩小了发生错误的地方。 它似乎发生在代码的一部分,我在计算机移动到程序的下一部分之前手动删除了一堆堆阵列。 当我注释掉释放旧堆阵列的部分时,程序运行得非常好。 任何想法

Immediate detection of heap corruption errors on Windows. How?

I can't sleep! :) I have a reasonably large project on Windows and encountered some heap corruption issues. I have read all SO, including this nice topic: How to debug heap corruption errors?, however nothing was suitable to help me out-of-the-box. Debug CRT and BoundsChecker detected heap corruptions, but addresses were always different and detections point were always far away from the

立即检测Windows上的堆损坏错误。 怎么样?

我无法入睡! :) 我在Windows上有一个相当大的项目,并遇到一些堆腐败问题。 我已经阅读了所有这些,包括这个不错的主题:如何调试堆损坏错误?,但没有什么适合帮助我开箱即用。 Debug CRT和BoundsChecker检测到堆损坏,但地址总是不同,并且检测点始终远离实际的内存覆盖。 我一直睡到半夜才制作下面的黑客: DWORD PageSize = 0; inline void SetPageSize() { if ( !PageSize ) { SYSTEM_INFO sysInfo

what to do if debug runs fine, but release crashes

I have an application that runs just fine in the debug build, but when I start it in the release build, I get a unhandled Exception at 0x0043b134 in myapp.exe: 0xC0000005: Access violation while reading at position 0x004bd96c If I click on 'break' it tells me that there are no symbols loaded and the source code can't be displayed. What can I do in such a situation to track down th

如果调试运行正常,该怎么办,但释放崩溃

我有一个在调试版本中运行得很好的应用程序,但是当我在发布版本中启动它时,我得到了一个 unhandled Exception at 0x0043b134 in myapp.exe: 0xC0000005: Access violation while reading at position 0x004bd96c 如果我点击'break',它会告诉我没有加载符号,并且无法显示源代码。 在这种情况下我能做些什么来追踪问题? 这种问题通常是由于单位变量。 我会从那里开始寻找你的问题。 调试模式更加宽容,因为

multiple calls to realloc() seems to cause a heap corruption

What's the problem with this code? It crashes every time. One time it's a failed assertion "_ASSERTE(_CrtIsValidHeapPointer(pUserData));", other times it is just a "heap corrpuption" error. Changing the buffer size affects this issue in some strange ways - sometimes it crashes on the "realloc", and other times on the "free". I have debugged t

多次调用realloc()似乎会导致堆损坏

这段代码有什么问题? 它每次都会崩溃。 有一次,它是一个失败的断言“_ASSERTE(_CrtIsValidHeapPointer(pUserData));”,其他时候它只是一个“堆错误”错误。 改变缓冲区大小会以一些奇怪的方式影响这个问题 - 有时它会在“realloc”上崩溃,而其他时间会在“free”上崩溃。 我已经调试过这段代码很多次了,关于指针没有任何异常。 char buf[2000]; char *data = (char*)malloc(sizeof(buf)); unsigned int size = sizeof(bu

ptr in VC6 dll cause crash

// dll #include <memory> __declspec(dllexport) std::auto_ptr<int> get(); __declspec(dllexport) std::auto_ptr<int> get() { return std::auto_ptr<int>(new int()); } // exe #include <iostream> #include <memory> __declspec(dllimport) std::auto_ptr<int> get(); int main() { { std::auto_ptr<int> x = get(); } std::cout << "do

在VC6 DLL中的ptr导致崩溃

// dll #include <memory> __declspec(dllexport) std::auto_ptr<int> get(); __declspec(dllexport) std::auto_ptr<int> get() { return std::auto_ptr<int>(new int()); } // exe #include <iostream> #include <memory> __declspec(dllimport) std::auto_ptr<int> get(); int main() { { std::auto_ptr<int> x = get(); } std::cout << "do

Visual Leak Detector crashes on exit

ALL, I again have trouble with VLD. I am trying to write a program on Windows 8.1 using MSVC 2010. The debugger does report that there are memory leaks. So I turned on VLD and recompiled the software and all libraries (dll) that the binary is using. I was able to run the application and follow the procedure on which I saw the leaks during the debugger. However when I exit the application

Visual Leak Detector在出口处崩溃

所有, 我再次遇到VLD问题。 我正在尝试使用MSVC 2010在Windows 8.1上编写程序。调试器确实报告存在内存泄漏。 所以我打开VLD并重新编译了该二进制文件正在使用的软件和所有库(dll)。 我能够运行该应用程序,并遵循我在调试器中看到泄漏的过程。 但是,当我退出应用程序时,我得到了崩溃,并且消息说: “未处理的0xXXXXX(vld_x86.dll)中的异常。读取地址0xXXXXX的访问冲突”。 在坠机时的回溯是: vld_x86.dll