Tag Archives: R6010 -abort() has been called

R6010 -abort() has been called error analysis and solutions

Preface

R6010 -abort() has been called errors are often encountered during code debugging. Here, let’s analyze the problem.

The manifestation of the error:

The reasons for this are:
1. Illegal pointer access and memory leak;
2. Check it again, there must be a problem with the pointer. The pointer range you set is not right for your operation;
3. The pointer access memory is out of bounds and there is a problem;
4. It is because Chinese is not supported;
5. The memory is not allocated enough;
6. The problem found in the later inspection should be the problem of multi-threaded access to resources. ;
7. Check if exe and dll are mixed with different versions of crt;

Solution:
First: check that the requested space has not been released;
second: check whether the stack space has been fully allocated, it is recommended that the memory allocation should not be too large each time, and remember to release;
third: the pointer points to unexpected memory position;

In response to my question,

Found an error in the following code:

features(temp, feature);

And the declaration of this function is:

extern  void features( const Mat& image, Mat& features);

the reason:

The global variable image has been declared and defined in the program, and a mutex lock is used for the image variable during a short period of running. Multiple threads will use the image variable, and the image variable is used many times in the features function that has problems, so Error

Solution:

Where the image variable is used in the features function, use other variable names;

Another reason is,

There is a problem with the variable data in the code. For example, the function input should be a color RGB image, but the grayscale image used before, forgot to remove the grayscale part, so an error occurred.