locked
Memory Error and exception in Visual studio 2015 while using openCV RRS feed

  • Question

  • I am getting follwing issue  while using openCV library version opencv-3.3.1-vc14  by downloading it from openCv site

    "Exception thrown at 0x00000000774EF23C (ntdll.dll) in opencv_solution.exe: 0xC0000005: Access violation reading location 0x00000EB7503F7BA8.

    If there is a handler for this exception, the program may be safely continued."

    This issue occurs only in case of debuggimg/step in mode , in case i press Ctrl + F5 issue does not occur.

    I used a simple openCV example avalable on their site :

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    #include "opencv2/highgui/highgui.hpp"
    #include <iostream>

    using namespace cv;
    using namespace std;

    int main(int argc, const char** argv)
    {
    Mat img = imread("C:\\Users\\abha.jaswal\\Desktop\\Penguins.jpg", CV_LOAD_IMAGE_COLOR);

    if (img.empty())
    {
    cout << "Image cannot be loaded..!!" << endl;
    return -1;
    }

    Mat imgH = img + Scalar(75, 75, 75); //increase the brightness by 75 units
    //img.convertTo(imgH, -1, 1, 75);

    Mat imgL = img + Scalar(-75, -75, -75); //decrease the brightness by 75 units
    //img.convertTo(imgL, -1, 1, -75);

    namedWindow("Original Image", CV_WINDOW_AUTOSIZE);
    namedWindow("High Brightness", CV_WINDOW_AUTOSIZE);
    namedWindow("Low Brightness", CV_WINDOW_AUTOSIZE);

    imshow("Original Image", img);
    imshow("High Brightness", imgH);
    imshow("Low Brightness", imgL);

    waitKey(0);

    destroyAllWindows(); //destroy all open windows

    return 0;
    }


    Even if i run a empty main function like same error occurs:

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    #include "opencv2/highgui/highgui.hpp"
    #include <iostream>

    using namespace cv;
    using namespace std;

    int main(int argc, const char** argv)
    {
    return 0;
    }

    It gives me same error : its a weird bug . 

    Is there any solution to avoid this?

    https://opencv-srf.blogspot.in/2013/05/installing-configuring-opencv-with-vs.html  used for installing openCV on visual studio

    • Moved by Baron Bi Thursday, January 4, 2018 6:03 AM Third-party library issue
    Thursday, December 21, 2017 6:36 AM

All replies

  • Hi Abha Jaswal,

    thanks for posting here.

    >>"Exception thrown at 0x00000000774EF23C (ntdll.dll) in opencv_solution.exe: 0xC0000005: Access violation reading location 0x00000EB7503F7BA8.

    Have you tried to debug your application in vs? Starting in Visual Studio 2015 Update 1, the exception dialog box now explicitly names the pointer that caused the access violation.

    You could also refer to this document below to find memory leaks with CRT libraries.

    https://msdn.microsoft.com/en-us/library/x98tx3cf.aspx

    Besides, since this issue is caused by the OpenCV code, I suggest you post on their website below for better support. You could choose user Q&A forum or report a bug.

    https://opencv.org/

    Hope this could be help of you.

    Best Regards,

    Baron Bi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 22, 2017 7:55 AM