heap-corruption

GFlags setting to catch heap corruption (other than Page Heap)?

百般思念 提交于 2020-01-01 02:32:47
问题 On one production site our application (*) crashes repeatedly, but non-reproducibly. Analyzing the crash dumps clearly shows that it's a heap corruption: The crashes are at different location, but always access violations inside kernel32!HeapFree / ntdll!RtlpLowFragHeapFree . Win Dbg !analyze -v also reports a heap corruption. What we have tried so far is to run the application with the GFlags option Page Heap. The problem is that the memory overhead of Page Heap is such that the application

What tools are available to detect heap corruption in .NET/C# program?

天涯浪子 提交于 2019-12-25 04:01:51
问题 I know that I can use WinDbg+PageHeap+ApplicationVerifier - Microsoft tools. I read there are many tools available for C++ and wonder if there is something similar exists for C#? 回答1: These are the kind of tools you use to troubleshoot mis-behaving native code. Access violations, heap corruption, resource leaks, that sort of thing. That just doesn't happen in pure managed code by virtue of the concept of safe code and the garbage collector. If you have a dependency on native code in your

What tools are available to detect heap corruption in .NET/C# program?

梦想与她 提交于 2019-12-25 04:01:17
问题 I know that I can use WinDbg+PageHeap+ApplicationVerifier - Microsoft tools. I read there are many tools available for C++ and wonder if there is something similar exists for C#? 回答1: These are the kind of tools you use to troubleshoot mis-behaving native code. Access violations, heap corruption, resource leaks, that sort of thing. That just doesn't happen in pure managed code by virtue of the concept of safe code and the garbage collector. If you have a dependency on native code in your

Heap Corruption with malloc, struct and char *

女生的网名这么多〃 提交于 2019-12-24 13:43:03
问题 I seem to have a memory corruption in my C program. I used _ASSERTE( _CrtCheckMemory( ) ); to find the problem statement and it breaks on a line that says scep_conf->engine_str = NULL; right before it. So if I understood it correctly, the malloc before that broke something, right? So this is the part of the code that causes the issue: scep_conf = (SCEP_CONF *) malloc(sizeof(scep_conf)); scep_conf->engine = (struct scep_engine_conf_st *) malloc(sizeof(struct scep_engine_conf_st)); scep_conf-

Heap Corruption using cv::FlannBasedMatcher and std::vector

有些话、适合烂在心里 提交于 2019-12-24 13:41:37
问题 I am developing a breast imaging features for object recognition, using FlannBasedMatcher to compute spatial histograms. Mat ComputeSpatialHistogram(Mat features, Mat vocabulary, int* region_index, int level, Ptr<DescriptorMatcher> flann_matcher) { int vocab_size = vocabulary.rows; Mat descriptor = Mat::zeros(1, vocab_size*my_pow(4, level), CV_32FC1); if (features.rows > 0) { vector<DMatch> matches; flann_matcher->match(features, matches); int word_idx, region_idx, descr_idx; for (int i = 0;

.NET 4: Can the managed code alone cause a heap corruption?

半世苍凉 提交于 2019-12-21 07:25:19
问题 I have a heap corruption in my multi-threaded managed program. Doing some tests I found that the corruption happens only when the background threads active in the program (they are switchable). The threads use some 3rd party components. After examining the code of the threads and 3rd party components (with .NET Reflector) I found that they are all managed, i.e. no "unsafe" or "DllImportAttribute" or "P/Invoke". It seems that the purely managed code causes a heap corruption, is this possible?

Immediate detection of heap corruption errors on Windows. How?

ぐ巨炮叔叔 提交于 2019-12-18 03:57:17
问题 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 actual memory overwrites. I have not slept till the middle of the night and crafted the following hack:

Heap corruption with strdup

与世无争的帅哥 提交于 2019-12-13 16:08:57
问题 I am using VTK together with MSVC and get a strange behaviour when trying to load data. I tinkered a little bit with it and even the following code generates a heap corruption, any ideas what is happening or what possibly went wrong? vtkAbstractArray *vtkDataReader::ReadArray(const char *dataType, int numTuples, int numComp) { char* type=strdup(dataType); free(type); // <--- here the heap corrution appears ... This is the call stack: > msvcr90d.dll!_CrtIsValidHeapPointer(const void *

Heap corruption while freeing memory

两盒软妹~` 提交于 2019-12-12 10:50:07
问题 I have a class as follows struct CliHandler { CliHandler(int argc, char** argv); ~CliHandler(); int doWork(); int argc_; char** argv_; private: CliHandler(const CliHandler&){} CliHandler& operator=(const CliHandler&){} }; //Constructor CliHandler::CliHandler(int argc, char** argv) { //set command line parameters argc_ = argc; argv_ = (char**) malloc(argc_ * sizeof(char*)); for(int i=0; i<argc_; ++i) { std::cout<<sizeof(argv[i]); argv_[i] = (char*) malloc(strlen(argv[i]) * sizeof(char));

What MDAs are useful to track a heap corruption?

故事扮演 提交于 2019-12-11 06:24:45
问题 I have a heap corruption in a .NET/C# program and cannot track it with WinDbg + PageHeap + Application Verifier. In the next step, I plan to use Managed Debugging Assistants (MDAs). Currently I try using these MDAs: <gcManagedToUnmanaged /> <gcUnmanagedToManaged /> <invalidVariant /> (Having these MDAs enabled makes the program run very slowly.) Are there any other I can try in this case? 回答1: As Hans Passant pointed out, the primary MDA for such cases would be <gcUnmanagedToManaged> .