Ask Your Question

Revision history [back]

Illegal instruction vmovss on running openCV program

Hello, I'm running a centos7 machine and I have installed opencv3 by compiling the source. I have a test C++ program to run openCV but it gives the error: Illegal Instruction. I extracted the core dump and ran it with gdb to get the following output:

 [atmohan@intern01-fm akaze_simp_latest]$ gdb akaze_simple core.16668 

[New LWP 16668]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./akaze_simple'.
Program terminated with signal 4, Illegal instruction.
#0  0x00007fcb81fe09a8 in cv::initInterTab2D(int, bool) () from ./libopencv/lib/libopencv_imgproc.so.3.0
Missing separate debuginfos, use: debuginfo-install glibc-2.17-55.el7.x86_64 libgcc-4.8.2-16.el7.x86_64 libjpeg-turbo-1.2.90-5.el7.x86_64 libstdc++-4.8.2-16.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) bt
#0  0x00007fcb81fe09a8 in cv::initInterTab2D(int, bool) () from ./libopencv/lib/libopencv_imgproc.so.3.0
#1  0x00007fcb81fe0a1d in global constructors keyed to imgwarp.cpp ()
   from ./libopencv/lib/libopencv_imgproc.so.3.0
#2  0x00007fcb82a25106 in __do_global_ctors_aux () from ./libopencv/lib/libopencv_imgproc.so.3.0
#3  0x00007fcb81faf1f3 in _init () from ./libopencv/lib/libopencv_imgproc.so.3.0
#4  0x00007ffff2ca4f28 in ?? ()
#5  0x00007fcb845e34bf in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#6  0x00007fcb845d545a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#7  0x0000000000000001 in ?? ()
#8  0x00007ffff2ca666e in ?? ()
#9  0x0000000000000000 in ?? ()
(gdb) x/i 0x00007fcb81fe09a8
=> 0x7fcb81fe09a8 <_ZN2cvL14initInterTab2DEib+2344>:    
    vmovss 0xa45af8(%rip),%xmm0        # 0x7fcb82a264a8

As it can be seen, the vmovss instruction is found to be illegal and I'm not sure why. My cpu/procinfo is as follows:

processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 44 model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz stepping : 2 microcode : 0x13 cpu MHz : 2394.000 cache size : 12288 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 11 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat dtherm tsc_adjust bogomips : 4788.00 clflush size : 64 cache_alignment : 64 address sizes : 42 bits physical, 48 bits virtual power management:

processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 44 model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz stepping : 2 microcode : 0x13 cpu MHz : 2394.000 cache size : 12288 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 11 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat dtherm tsc_adjust bogomips : 4788.00 clflush size : 64 cache_alignment : 64 address sizes : 42 bits physical, 48 bits virtual power management:

processor : 2 vendor_id : GenuineIntel cpu family : 6 model : 44 model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz stepping : 2 microcode : 0x13 cpu MHz : 2394.000 cache size : 12288 KB physical id : 1 siblings : 2 core id : 0 cpu cores : 2 apicid : 2 initial apicid : 2 fpu : yes fpu_exception : yes cpuid level : 11 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat dtherm tsc_adjust bogomips : 4788.00 clflush size : 64 cache_alignment : 64 address sizes : 42 bits physical, 48 bits virtual power management:

processor : 3 vendor_id : GenuineIntel cpu family : 6 model : 44 model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz stepping : 2 microcode : 0x13 cpu MHz : 2394.000 cache size : 12288 KB physical id : 1 siblings : 2 core id : 1 cpu cores : 2 apicid : 3 initial apicid : 3 fpu : yes fpu_exception : yes cpuid level : 11 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat dtherm tsc_adjust bogomips : 4788.00 clflush size : 64 cache_alignment : 64 address sizes : 42 bits physical, 48 bits virtual power management:

Could you help me out in identifying the issue here?