Sorry, you need to enable JavaScript to visit this website.

ERROR: application performed illegal memory access and is being terminated

Solved
3 posts / 0 new
ERROR: application performed illegal memory access and is being terminated

Hello.

I tried Reference Desgin "ZedBoard + FMC-HDMI-CAM + PYTHON-1300-C SDSoC platform, Vivado 2015.4", and worked out the demo.
Next, I modify "sds_sobel.cpp" to understand the relationship of video_in and video_out.
Compilation passed, but Error occured when the program run.

"ERROR: application performed illegal memory access and is being terminated"

Why is the error occured?

I show modification part below.

void sds_sobel(unsigned short *img_in, unsigned short *img_out, int rows, int cols, int stride)
{
    int row;
    int col;
       // constructing OpenCV interface
    IplImage* src_dma = cvCreateImageHeader(cvSize(cols, rows), IPL_DEPTH_8U, 3); //BGR
    IplImage* dst_dma = cvCreateImageHeader(cvSize(cols, rows), IPL_DEPTH_8U, 3); //BGR

    src_dma->imageData = (char *) img_in;
    dst_dma->imageData = (char *) img_out;
    src_dma->widthStep = 2 * stride;
    dst_dma->widthStep = 2 * stride;

    cv::Mat src_img;

        src_img = src_dma;
        if (src_img.empty()) {
            return;
        }

        * dst_dma = src_img;

         img_out = (unsigned short *) dst_dma->imageData;

        cvReleaseImage(&src_dma);
        cvReleaseImage(&dst_dma);
}

Thank you
Hisashi

JFoster's picture
JFoster
Moderator(48)
Hi Hisashi,

Hi Hisashi,

Take a look at this forum post

https://forums.xilinx.com/t5/SDSoC-Development-Environment/Custom-SDSoC-...

--Josh

Thank you for quick reply

Hello, Josh
Thank you for quick reply.
I made simple mistake.
[Wrong] cvReleaseImage(&src_dma); cvRelaseImage(&dst_dma);
[Correct]cvReleaseImageHeader(&src_dma); cvRelaseImageHeader(&dst_dma);
The program Normally run.
Thanks