"gscam image_view image_view image:=/camera/image_raw" gives Illegal instruction [closed]
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
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.
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.
You should be able to find the gscam binary ( /opt/ros/hydro/lib/gscam/gscam ) and run it by hand through gdb.
I've tried using gdb, but after "file gscam" it says "no debugging symbols found". So how can I proceed without those ?
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.
Once you know which part is causing problems, you should check that out and build it from source, with debugging enabled.
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 ?
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.