"gscam image_view image_view image:=/camera/image_raw" gives Illegal instruction [closed]

asked 2014-04-22 04:45:26 -0500

hvn gravatar image

Hi,

I'm trying to get a webcam started on armhf (beagle-xm), Intel Pentium and AMD Athlon, but after starting (hydro) roscore, export GSCAM_CONFIG="v4l2src device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace" , rosrun gscam gscam, it often ends with Illegal instruction which would mean that (part of) "rosrun gscam gscam" can't be executed. It also happens that the stream does get started but after rosrun image_view image_view image:=/camera/image_raw, it always ends with Illegal instruction on all 3 platforms. So I'm clueless on what's happening.

Thanks

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2018-01-30 17:45:40.867901

Comments

On all three CPUs? Do you know the exact model numbers for the CPUs you're using? You may want to run the gscam node in a debugger to start tracking down which part of the code contains illegal instructions.

ahendrix gravatar image ahendrix  ( 2014-04-22 06:29:56 -0500 )edit

For armhf: DM3730, for Intel: Pentium M (dmesg shows no exact model nr), for AMD: AthlonXP 2400+. As far as I know, they're all single-core. Do you have a debugger suggestion? gdb doesn't work on rosrun and valgrind is only showing the time in which it fails.

hvn gravatar image hvn  ( 2014-04-22 09:40:53 -0500 )edit

You should be able to find the gscam binary ( /opt/ros/hydro/lib/gscam/gscam ) and run it by hand through gdb.

ahendrix gravatar image ahendrix  ( 2014-04-22 09:55:04 -0500 )edit

I've tried using gdb, but after "file gscam" it says "no debugging symbols found". So how can I proceed without those ?

hvn gravatar image hvn  ( 2014-04-22 21:23:52 -0500 )edit

You can still learn a bit without debugging symbols; in particular, the backtrace should tell you which file had the offending instructions in it; whether it was the gscam binary itself, or one of the libraries that it depends on.

ahendrix gravatar image ahendrix  ( 2014-04-23 07:08:02 -0500 )edit

Once you know which part is causing problems, you should check that out and build it from source, with debugging enabled.

ahendrix gravatar image ahendrix  ( 2014-04-23 07:08:44 -0500 )edit

Running "strace rosrun gscam gscam" it looks like munmap is (part of) the culprit on beagle-xm. Using "strace rosrun image_view image_view image:=/camera/image_raw" on AMD reveals munmap as latest action before Illegal instruction. Any clue ?

hvn gravatar image hvn  ( 2014-04-23 22:00:54 -0500 )edit

strace only shows system calls; not instructions. It's quite nice for figuring out where your program is blocking on I/O, but it's absolutely useless for the sort of debugging you're trying to do.

ahendrix gravatar image ahendrix  ( 2014-04-24 06:22:33 -0500 )edit