Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

qt and imread -> realloc(): invalid old size: 0x0000000000611a20

Hi,

I am using Qt 4.8.4 and opencv-2.4.6.1 and get an odd error when running the application.

The offending line in the code is

        Mat img1 = imread(name, CV_LOAD_IMAGE_GRAYSCALE);

When I compile a simple test program without Qt libraries then OpenCV works just fine and loads the image. However when built with the Qt libraries the build works just fine but when the program is run I get

$ ./opencvnqt
*** Error in `./opencvnqt': realloc(): invalid old size: 0x00000000006119e0 ***

Does anyone know why this run time error is occuring and how to avoid it or how to debug it? FYI the build and link lines look like this:

g++ -c -m64 -pipe -g -Wall -W -D_REENTRANT -DVERSION=1.0 -DPD_NOT_SERIAL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I../OpenCVNQt -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/local/include/opencv -I. -I. -I../OpenCVNQt -I. -o MainWindow.o MainWindow.cpp

g++ -m64 -o opencvnqt main.o MainWindow.o moc_MainWindow.o  -L/usr/lib/x86_64-linux-gnu -L /usr/local/lib -lopencv_core -lopencv_highgui -lQtGui -lQtCore -lpthread