SIGILL detected with valgrind in cv::addWeighted8u (Bug #2334)


Added by Luis Díaz Más over 12 years ago. Updated over 12 years ago.


Status:Cancelled Start date:2012-09-06
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Hi,

I use to always run valgrind in order to detect memory leaks in my programs. In a very simple algorithm for deinterlacing images, valgrind crash in the following OpenCV operation:

cv::Mat dst = (_evenRes + _oddRes)/2; /// \bug valgrind detects an error here

Where _evenRes and _oddRes are matrices of the same size (640x480) and type (cv_8UC3)

This is the error message that valgrind throws:

vex amd64->IR: unhandled instruction bytes: 0x66 0x48 0xF 0x3A 0x22 0x4D
==10095== valgrind: Unrecognised instruction at address 0x70a608d.
==10095== Your program just tried to execute an instruction that Valgrind
==10095== did not recognise.  There are two possible reasons for this.
==10095== 1. Your program has a bug and erroneously jumped to a non-code
==10095==    location.  If you are running Memcheck and you just saw a
==10095==    warning about a bad jump, it's probably your program's fault.
==10095== 2. The instruction is legitimate but Valgrind doesn't handle it,
==10095==    i.e. it's Valgrind's fault.  If you think this is the case or
==10095==    you are not sure, please let us know and we'll try to fix it.
==10095== Either way, Valgrind will now raise a SIGILL signal which will
==10095== probably kill your program.
==10095== 
==10095== Process terminating with default action of signal 4 (SIGILL)
==10095==  Illegal opcode at address 0x70A608D
==10095==    at 0x70A608D: cv::addWeighted8u(unsigned char const*, unsigned long, unsigned char const*, unsigned long, unsigned char*, unsigned long, cv::Size_<int>, void*) (in /usr/local/lib/libopencv_core.so.2.4.2)
==10095==    by 0x70B67BA: cv::arithm_op(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, int, void (**)(unsigned char const*, unsigned long, unsigned char const*, unsigned long, unsigned char*, unsigned long, cv::Size_<int>, void*), bool, void*) (in /usr/local/lib/libopencv_core.so.2.4.2)
==10095==    by 0x70B7CA6: cv::addWeighted(cv::_InputArray const&, double, cv::_InputArray const&, double, double, cv::_OutputArray const&, int) (in /usr/local/lib/libopencv_core.so.2.4.2)
==10095==    by 0x71EC6F6: cv::MatOp_AddEx::assign(cv::MatExpr const&, cv::Mat&, int) const (in /usr/local/lib/libopencv_core.so.2.4.2)
==10095==    by 0x507F050: cv::Mat::operator=(cv::MatExpr const&) (mat.hpp:1417)
==10095==    by 0x52A720F: catec::DeinterlacerBlend::deinterlace(cv::Mat const&, cv::Mat&) (deinterlacer_blend.cpp:46)
==10095==    by 0x4095C6: main (complete_app_fi.cpp:137

I'm running this code in a x86_64 machine with Ubuntu 10.04 (gcc version 4.4.3)


Associated revisions

Revision aeeb9f9e
Added by Andrey Pavlenko about 11 years ago

Merge pull request #2334 from alalek:umat_usage_flags_2

History

Updated by Luis Díaz Más over 12 years ago

I forget to say that the code runs correctly, but when I try to find memory leaks with Valgrind, it always show this error. It also happen with CV_8UC1 images.

Updated by Vadim Pisarevsky over 12 years ago

Hi! We have had a few problems with 64-bit compiler in Ubuntu 10.04, in particular with its code generator. It's recommended to upgrade.

  • Status changed from Open to Cancelled

Also available in: Atom PDF