BUG: Segmentationfault when using V4L2_PIX_FMT_SPCA561
When using the "v4l2_palette 3" in motion.conf, motion crashes with an segmentationfault
# Setting v4l2_palette to 2 forces motion to use V4L2_PIX_FMT_SBGGR8
# instead.
#
# Values :
# V4L2_PIX_FMT_SN9C10X : 0 'S910'
# V4L2_PIX_FMT_SBGGR16 : 1 'BYR2'
# V4L2_PIX_FMT_SBGGR8 : 2 'BA81'
# V4L2_PIX_FMT_SPCA561 : 3 'S561'
# V4L2_PIX_FMT_SGBRG8 : 4 'GBRG'
# V4L2_PIX_FMT_SGRBG8 : 5 'GRBG'
# V4L2_PIX_FMT_PAC207 : 6 'P207'
# V4L2_PIX_FMT_PJPG : 7 'PJPG'
# V4L2_PIX_FMT_MJPEG : 8 'MJPEG'
# V4L2_PIX_FMT_JPEG : 9 'JPEG'
# V4L2_PIX_FMT_RGB24 : 10 'RGB3'
# V4L2_PIX_FMT_SPCA501 : 11 'S501'
# V4L2_PIX_FMT_SPCA505 : 12 'S505'
# V4L2_PIX_FMT_SPCA508 : 13 'S508'
# V4L2_PIX_FMT_UYVY : 14 'UYVY'
# V4L2_PIX_FMT_YUYV : 15 'YUYV'
# V4L2_PIX_FMT_YUV422P : 16 '422P'
# V4L2_PIX_FMT_YUV420 : 17 'YU12'
#
v4l2_palette 3
# motion -d 9 -n -c motion-logitech.conf
[0] conf_load: Processing thread 0 - config file motion-logitech.conf
Segmentatiefout
Attached in the archive logs.tar.bz2 there are 3 logs.
motion-initial-run.log: motion with v4l2_palette set to 17.
problem here is that the resolution is adjusted from 640x480 to 176x144
motion-segmentationfault.log, strace.log: motion output when segfaulting
Camera is a logitech. Using (the same) motion with a trust webcam works fine.
This is with: motion-20100123
Environment
Motion version: |
3.2.11.1 |
ffmpeg version: |
|
Shared libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
openSUSE-11.2 |
--
RichardB - 31 Jan 2010
Follow up
I tried to get any clue from your attached files , but i couldn't . Can you attach your config file and also try to get a core dump :
http://www.lavrsen.dk/foswiki/bin/view/Motion/CoreDumpInMotion
Cheers,
--
AngelCarpintero - 05 Feb 2010
Follow up
@AngelCarpintero: Core dump and configuration file attached
--
RichardB - 14 Feb 2010
Follow up
Try to attach all info from run the following :
gdb ./motion core.motion.17230
bt full
frame 1
l
frame 0
l
--
AngelCarpintero - 15 Feb 2010
Follow up
This is all i got (and that includes, installing debug packages):
Core was generated by `motion -d 9 -n -c motion-logitech.conf'.
Program terminated with signal 11, Segmentation fault.
(gdb) bt full
#0 0x0000000000415278 in bayer2rgb24 ()
No symbol table info available.
#1 0x0000000000414b1f in v4l2_next ()
No symbol table info available.
#2 0x0000000000416b73 in vid_next ()
No symbol table info available.
#3 0x0000000000405c80 in motion_init ()
No symbol table info available.
#4 0x0000000000406adb in motion_loop ()
No symbol table info available.
#5 0x00007f9c571aa65d in start_thread (arg=<value optimized out>) at pthread_create.c:297
__res = <value optimized out>
pd = 0x7f9c54493910
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140309405710608, -5897970188293240169, 140735225318176, 140309405710608, 140309457395776, 3, 5845280678376114839,
5845282442863577751}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <value optimized out>
robust = <value optimized out>
#6 0x00007f9c56764e1d in clone () from /lib64/libc.so.6
No symbol table info available.
#7 0x0000000000000000 in ?? ()
No symbol table info available.
(gdb) frame 1
#1 0x0000000000414b1f in v4l2_next ()
(gdb) l
1 allocatestack.c: Bestand of map bestaat niet.
in allocatestack.c
(gdb) frame 0
#0 0x0000000000415278 in bayer2rgb24 ()
(gdb) l
1 in allocatestack.c
I hope that it is sufficient. Looks like that motion is without debugging enabled, though.
--
RichardB - 14 Feb 2010
Sorry you can compile motion with debug runnnig :
make current
sed -i 's/-O2//g' Makefile
make clean ;make
Cheers
--
AngelCarpintero - 20 Feb 2010
Added a better stack trace this time. I hope it is sufficient....
--
RichardB - 21 Feb 2010
Please use latest svn revision and add the patch attached in :
http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2010x02x22x070840
--
AngelCarpintero - 26 Feb 2010
Added file with debug information
--
RichardB - 26 Feb 2010
Richard , please try latest svn ...
however to make it work in the meantime i can get a better fix, can you run motion with libv4l ?
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so motion
--
AngelCarpintero - 28 Feb 2010.
AngelCarpintero With the recent svn version I had no crash
With the LD_PRELOAD=/usr/lib64/libv4l/v4l2convert.so instruction I had even a nice image
but with an incorrect size. The config file contains width 640 and height 480, but the picture is 352x288. The latter is just for your information. I'm looking forward to the better fix!
Richard , size is not incorrect because motion , it's a driver limitation when it detects that USB bandwith is not enough for current resolution, so probably using a dedicated USB 2.0 Host controller for your webcam will fix this limitation.
--
AngelCarpintero - 02 Mar 2010
Fix record
Closed , not feedback !
--
AngelCarpintero - 10 Jun 2012