[packman] Fwd: Illegal instruction with x86_64 OpenCV

Ralph Smithen rys at aber.ac.uk
Mon Jan 4 11:47:24 CET 2010


I just realised I should have CC'd this message originally, so I'll
forward it now instead.

-------- Original Message --------
Subject: Illegal instruction with x86_64 OpenCV
Date: Mon, 4 Jan 2010 10:27:25 +0000
From: Ralph Smithen <rys at aber.ac.uk>
To: andrea at links2linux.de <andrea at links2linux.de>

Hi,

sorry to bother you, but I've been having some trouble with the version
of OpenCV for x86_64 in packman. It seems it's been built with some
compilation options which my processor doesn't support. Here is the
debugging output generated last year, though note I've tried with
several other versions, including OpenCV 2.0.0-0.pm.5.35 with the same
result...

***

Using OpenCV 2.0.0-0.pm.5.21 on OpenSuSE via python wrappers.
Calling FindChessboardCorners is reported as "Illegal instruction" on
command line.

gdb output:
---------------------------------------------------------------------------
---
Program received signal SIGILL, Illegal instruction.
0x00007ffff6259cf6 in meanDist (_n=<value optimized out>, this=<value
optimized out>) at
/usr/src/packages/BUILD/OpenCV-2.0.0/src/cv/cvcalibinit.cpp:115
115 sum += sqrt(dx*dx + dy*dy);


Current language: auto


The current source language is "auto; currently c++".


(gdb) where
#0 0x00007ffff6259cf6 in meanDist (_n=<value optimized out>, this=<value
optimized out>) at
/usr/src/packages/BUILD/OpenCV-2.0.0/src/cv/cvcalibinit.cpp:115
#1 cvFindChessboardCorners(const void *, <anonymous struct>, CvPoint2D32f
*, int *, int) (_n=<value optimized out>, this=<value optimized out>)

at /usr/src/packages/BUILD/OpenCV-2.0.0/src/cv/cvcalibinit.cpp:454


#2 0x00007ffff6b25e75 in pycvFindChessboardCorners(_object*, _object*,
_object*) () from /usr/lib64/python2.6/site-packages/cv.so

#3 0x00007ffff7b1abf9 in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0

#4 0x00007ffff7b1f735 in PyEval_EvalCodeEx () from
/usr/lib64/libpython2.6.so.1.0

#5 0x00007ffff7b18642 in PyEval_EvalCode () from
/usr/lib64/libpython2.6.so.1.0

#6 0x00007ffff7b37971 in ?? () from /usr/lib64/libpython2.6.so.1.0


#7 0x00007ffff7b37a24 in PyRun_FileExFlags () from
/usr/lib64/libpython2.6.so.1.0

#8 0x00007ffff7b38388 in PyRun_SimpleFileExFlags () from
/usr/lib64/libpython2.6.so.1.0

#9 0x00007ffff7b42e6e in Py_Main () from /usr/lib64/libpython2.6.so.1.0


#10 0x00007ffff6ea1a7d in __libc_start_main () from /lib64/libc.so.6


#11 0x00000000004006e9 in _start ()


(gdb) disassemble /m
Dump of assembler code for function meanDist:
111 if( neighbors[i] )
0x00007ffff6259cb3 <meanDist+14>: mov $0x1,%edi
0x00007ffff6259cb8 <meanDist+19>: xorps %xmm1,%xmm1
0x00007ffff6259cbb <meanDist+22>: mov 0x10(%rax),%rdx
0x00007ffff6259cbf <meanDist+26>: test %rdx,%rdx
0x00007ffff6259cc2 <meanDist+29>: je 0x7ffff6259cfe
<meanDist+89>
0x00007ffff6259cfe <meanDist+89>: mov 0x18(%rax),%rbx
0x00007ffff6259d02 <meanDist+93>: test %rbx,%rbx
0x00007ffff6259d05 <meanDist+96>: je 0x7ffff6259d43
<meanDist+158>
0x00007ffff6259d43 <meanDist+158>: mov 0x20(%rax),%rbx
0x00007ffff6259d47 <meanDist+162>: test %rbx,%rbx
0x00007ffff6259d4a <meanDist+165>: je 0x7ffff6259d89
<meanDist+228>
0x00007ffff6259d89 <meanDist+228>: mov 0x28(%rax),%rbx
0x00007ffff6259d8d <meanDist+232>: test %rbx,%rbx
0x00007ffff6259d90 <meanDist+235>: je 0x7ffff6259dcf
<cvFindChessboardCorners(const void *, <anonymous struct>, CvPoint2D32f *,
int *, int)+6447>

112 {
113 float dx = neighbors[i]->pt.x - pt.x;
114 float dy = neighbors[i]->pt.y - pt.y;
115 sum += sqrt(dx*dx + dy*dy);
0x00007ffff6259ca5 <meanDist+0>: mov $0x1,%r9d
0x00007ffff6259cc4 <meanDist+31>: movss (%rdx),%xmm1
0x00007ffff6259cc8 <meanDist+35>: mov $0x2,%edi
0x00007ffff6259ccd <meanDist+40>: movss 0x4(%rdx),%xmm0
0x00007ffff6259cd2 <meanDist+45>: subss (%rax),%xmm1
0x00007ffff6259cd6 <meanDist+49>: subss 0x4(%rax),%xmm0
0x00007ffff6259cdb <meanDist+54>: mov $0x1,%edx
0x00007ffff6259ce0 <meanDist+59>: mulss %xmm1,%xmm1
0x00007ffff6259ce4 <meanDist+63>: mulss %xmm0,%xmm0
0x00007ffff6259ce8 <meanDist+67>: addss %xmm1,%xmm0
0x00007ffff6259cec <meanDist+71>: unpcklps %xmm0,%xmm0
0x00007ffff6259cef <meanDist+74>: cvtps2pd %xmm0,%xmm0
0x00007ffff6259cf2 <meanDist+77>: sqrtsd %xmm0,%xmm1
0x00007ffff6259cf6 <meanDist+81>: movddup %xmm1,%xmm1
0x00007ffff6259cfa <meanDist+85>: cvtpd2ps %xmm1,%xmm1
0x00007ffff6259d07 <meanDist+98>: movss (%rbx),%xmm2
0x00007ffff6259d0b <meanDist+102>: mov %edi,%edx
0x00007ffff6259d0d <meanDist+104>: movss 0x4(%rbx),%xmm0
0x00007ffff6259d12 <meanDist+109>: subss (%rax),%xmm2
0x00007ffff6259d16 <meanDist+113>: subss 0x4(%rax),%xmm0
0x00007ffff6259d1b <meanDist+118>: unpcklps %xmm1,%xmm1
0x00007ffff6259d1e <meanDist+121>: cvtps2pd %xmm1,%xmm1
0x00007ffff6259d21 <meanDist+124>: mulss %xmm2,%xmm2
0x00007ffff6259d25 <meanDist+128>: mulss %xmm0,%xmm0
--------------------------------------------- end gdb

movddup to blame?

***

You can see the bug report I submitted to the project on SourceForge here:
http://sourceforge.net/tracker/?func=detail&aid=2910144&group_id=22870&atid=376677

I do hope you can help. It'd be great to be able to use this software
from the repository :)

Kind regards,
Ralph.

-- 
-------------------------------------
Ralph Smithen,
Research Assistant in Space Robotics,
Aberystwyth University,
Computer Science Department,
Penglais, Aberystwyth, Ceredigion,
SY23 3DB, Wales, UK.
Tel: +44 01970 628452 (PAT lab)
-------------------------------------




More information about the Packman mailing list