Linux + QT + opencv camera debugging experience (3) -- glibc detected *** free (): Invalid Pointer: 0xafeff000

Source: Internet
Author: User

Camera preview is normal. After you click "exit" or close the running form, a bunch of warnings will pop up in the compiler output column below, as shown below:

* ** Glibc detected ***/home/Yan/QT/Camera_Read_OpenCv_V1-build-desktop-Desktop_Qt_4_8_0_for_GCC _ qt_sdk ____/camera_read_opencv_v1: Free (): Invalid Pointer: 0xafeff000 ***
======= Backtrace: ============
/Lib/i386-linux-gnu/libc. so.6 (+ 0x6ebc2) [0x908bc2]
/Lib/i386-linux-gnu/libc. so.6 (+ 0x6f862) [0x909862]
/Lib/i386-linux-gnu/libc. so.6 (cfree + 0x6d) [0x90c94d]
/Usr/lib/libcxcore. so.2.1 (_ zn2cv8fastfreeepv + 0x23) [0xe236a3]
/Usr/lib/libcxcore. so.2.1 (cvfree _ + 0x1c) [0xe23c2c]
/Usr/lib/libcxcore. so.2.1 (cvreleaseimageheader + 0x6a) [0xe5b7ba]
/Usr/lib/libcxcore. so.2.1 (cvreleaseimage + 0x3f) [0xe5b8ff]
/Home/Yan/QT/Camera_Read_OpenCv_V1-build-desktop-Desktop_Qt_4_8_0_for_GCC _ qt_sdk ____/camera_read_opencv_v1 [0x804a679]
/Home/Yan/QT/Camera_Read_OpenCv_V1-build-desktop-Desktop_Qt_4_8_0_for_GCC _ qt_sdk ____/camera_read_opencv_v1 [0x804a1f3]
/Lib/i386-linux-gnu/libc. so.6 (_ libc_start_main + 0xf3) [0x8b3113]
/Home/Yan/QT/Camera_Read_OpenCv_V1-build-desktop-Desktop_Qt_4_8_0_for_GCC _ qt_sdk ____/camera_read_opencv_v1 [0x804a249]
======= Memory map: ========
0011316-003f1000 R-XP 00000000 557615/home/Yan/qtsdk/desktop/QT/4.8.0/GCC/lib/libqtcore. so.4.8.0
003f1000-003f8000 r -- p 002e0000 08:01 557615/home/Yan/qtsdk/desktop/QT/4.8.0/GCC/lib/libqtcore. so.4.8.0
003f8000-003fb000 RW-P 002e7000 08:01 557615/home/Yan/qtsdk/desktop/QT/4.8.0/GCC/lib/libqtcore. so.4.8.0
003fb000-000000000 R-XP 00000000 394171/lib/i386-linux-gnu/libgcc_s.so.1
00417000-00418000 r -- p 0001b000 08:01 394171/lib/i386-linux-gnu/libgcc_s.so.1 ............... And so on

Cause: In the camerawidget destructor, the sequence of release pointers is incorrect. It should be cvreleasecapture (& capture), and then cvreleaseimage (& IMG );

Note: IMG = cvqueryframe (capture ). If the memory release order is reversed, the above warning will appear!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.