motion crashes when using two threads

Bug #604169 reported by Thiago Figueiro
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
motion (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: motion

When running motion with 2 webcams it crashes after a while.
thiago@haoni:~/Desktop/motion$ gdb --args motion -c motion.conf

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7fe3b70 (LWP 17065)]
0x00d3dc1c in ?? () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0x00d3dc1c in ?? () from /lib/tls/i686/cmov/libc.so.6
#1 0x00d40ecd in free () from /lib/tls/i686/cmov/libc.so.6
#2 0x0804cb08 in ?? ()
#3 0x0804f1ea in ?? ()
#4 0x0013396e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#5 0x00d9ea4e in clone () from /lib/tls/i686/cmov/libc.so.6

motion.conf:

$ grep -v ^# motion.conf | egrep -v '^$'
daemon off
width 640
height 480
framerate 2
minimum_frame_time 1
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0
threshold 1500
threshold_tune off
noise_level 32
noise_tune on
pre_capture 0
post_capture 0
max_mpeg_time 0
output_all on
output_normal off
output_motion off
quality 85
ppm off
ffmpeg_cap_new off
ffmpeg_cap_motion off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 0
ffmpeg_video_codec mpeg1
ffmpeg_deinterlace off
snapshot_interval 1
locate off
text_right
text_changes off
text_event
text_double off
webcam_port 0
webcam_quality 50
webcam_motion off
webcam_maxrate 1
webcam_localhost on
webcam_limit 0
control_port 0
control_localhost on
control_html_output on
track_type 0
track_auto off
track_motorx 0
track_motory 0
track_maxx 0
track_maxy 0
track_iomojo_id 0
track_step_angle_x 10
track_step_angle_y 10
track_move_wait 10
track_speed 255
track_stepsize 40
quiet on
thread cam0.conf
thread cam1.conf

cam0.conf

thiago@haoni:~/Desktop/motion$ grep -v ^# cam0.conf | egrep -v '^$'
daemon off
setup_mode off
videodevice /dev/video0
width 640
height 480
framerate 30
minimum_frame_time 0
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0
threshold 1500
threshold_tune off
noise_level 32
noise_tune on
pre_capture 5
post_capture 5
max_mpeg_time 0
output_all off
output_normal on
output_motion off
quality 85
ppm off
ffmpeg_cap_new on
ffmpeg_cap_motion off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 0
ffmpeg_video_codec mpeg1
ffmpeg_deinterlace off
snapshot_interval 0
locate off
text_right
text_changes off
text_event
text_double off
jpeg_filename cam0/%v-%Y%m%d%H%M%S-%q
webcam_port 0
webcam_quality 50
webcam_motion off
webcam_maxrate 1
webcam_localhost on
webcam_limit 0
control_port 0
control_localhost on
control_html_output on
track_type 0
track_auto off
track_motorx 0
track_motory 0
track_maxx 0
track_maxy 0
track_iomojo_id 0
track_step_angle_x 10
track_step_angle_y 10
track_move_wait 10
track_speed 255
track_stepsize 40
quiet on

thiago@haoni:~/Desktop/motion$ grep -v ^# cam1.conf | egrep -v '^$'
daemon off
setup_mode off
videodevice /dev/video1
width 640
height 480
framerate 30
minimum_frame_time 0
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0
threshold 1500
threshold_tune off
noise_level 32
noise_tune on
pre_capture 5
post_capture 5
max_mpeg_time 0
output_all off
output_normal on
output_motion off
quality 85
ppm off
ffmpeg_cap_new on
ffmpeg_cap_motion off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 0
ffmpeg_video_codec mpeg1
ffmpeg_deinterlace off
snapshot_interval 0
locate off
text_right
text_changes off
text_event
text_double off
jpeg_filename cam1/%v-%Y%m%d%H%M%S-%q
webcam_port 0
webcam_quality 50
webcam_motion off
webcam_maxrate 1
webcam_localhost on
webcam_limit 0
control_port 0
control_localhost on
control_html_output on
track_type 0
track_auto off
track_motorx 0
track_motory 0
track_maxx 0
track_maxy 0
track_iomojo_id 0
track_step_angle_x 10
track_step_angle_y 10
track_move_wait 10
track_speed 255
track_stepsize 40
quiet on

Revision history for this message
Thiago Figueiro (thiagocsf) wrote :

I think something in the config above is making motion crash. With the configuration below motion doesn't seem to crash.

thiago@haoni:~/Desktop/motion$ cat motion.conf
quiet on
output_all off
output_normal off
snapshot_interval 0
thread cam0.conf
thread cam1.conf

thiago@haoni:~/Desktop/motion$ cat cam0.conf
daemon off
setup_mode off
videodevice /dev/video0
width 640
height 480
framerate 2
minimum_frame_time 1
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0
output_all on
output_normal on
output_motion off
quality 85
snapshot_interval 0
jpeg_filename cam0/%Y%m%d%H%M%S-%q
quiet on

thiago@haoni:~/Desktop/motion$ cat cam1.conf
daemon off
setup_mode off
videodevice /dev/video1
width 640
height 480
framerate 2
minimum_frame_time 1
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0
output_all on
output_normal on
output_motion off
quality 85
snapshot_interval 0
jpeg_filename cam1/%Y%m%d%H%M%S-%q
quiet on

Revision history for this message
Darren Conway (darren-conway) wrote :
Download full text (4.8 KiB)

I have a headless Ubuntu server running v10.10 plus 2 cameras.
Motion runs OK from the command line with 2 cameras. It crashes when started as a daemon process.

When run from the command line, it is run as user <me>. When run as a daemon process it is run as user <motion>.
<me> is a member of<motion> group so it shouldn't matter. Motion also runs OK from the command line with <sudo>. I am just pointing this out because it is the only obvious difference between running from the CLI and running a daemon process.

Output from my syslog is below:

Jan 17 23:10:49 alpha motion: [0] Processing thread 0 - config file /etc/motion/motion.conf
Jan 17 23:10:49 alpha motion: [0] Processing config file /etc/motion/trackcam1.conf
Jan 17 23:10:49 alpha motion: [0] Processing config file /etc/motion/trackcam2.conf
Jan 17 23:10:49 alpha motion: [0] Motion 3.2.12 Started
Jan 17 23:10:49 alpha motion: [0] Created process id file /var/run/motion/motion.pid. Process ID is 5440
Jan 17 23:10:49 alpha motion: [0] Motion running as daemon process
Jan 17 23:10:49 alpha motion: [0] ffmpeg LIBAVCODEC_BUILD 3482112 LIBAVFORMAT_BUILD 3478528
Jan 17 23:10:49 alpha motion: [0] Thread 1 is from /etc/motion/trackcam1.conf
Jan 17 23:10:49 alpha motion: [0] Thread 2 is from /etc/motion/trackcam2.conf
Jan 17 23:10:49 alpha motion: [2] Thread 2 started
Jan 17 23:10:49 alpha motion: [2] cap.driver: "uvcvideo"
Jan 17 23:10:49 alpha motion: [2] cap.card: "UVC Camera (046d:0807)"
Jan 17 23:10:49 alpha motion: [2] cap.bus_info: "usb-0000:01:07.0-1"
Jan 17 23:10:49 alpha motion: [2] cap.capabilities=0x04000001
Jan 17 23:10:49 alpha motion: [1] Thread 1 started
Jan 17 23:10:49 alpha motion: [2] - VIDEO_CAPTURE
Jan 17 23:10:49 alpha motion: [2] - STREAMING
Jan 17 23:10:49 alpha motion: [2] Test palette MJPG (960x720)
Jan 17 23:10:49 alpha motion: [2] Adjusting resolution from 960x720 to 800x600.
Jan 17 23:10:49 alpha motion: [2] Using palette MJPG (800x600) bytesperlines 0 sizeimage 62933 colorspace 00000008
Jan 17 23:10:49 alpha motion: [2] found control 0x00980900, "Brightness", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Brightness", default 128, current 128
Jan 17 23:10:49 alpha motion: [2] found control 0x00980901, "Contrast", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Contrast", default 32, current 32
Jan 17 23:10:49 alpha motion: [2] found control 0x00980902, "Saturation", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Saturation", default 31, current 31
Jan 17 23:10:49 alpha motion: [2] found control 0x00980913, "Gain", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Gain", default 0, current 48
Jan 17 23:10:49 alpha motion: [2] mmap information:
Jan 17 23:10:49 alpha motion: [2] frames=4
Jan 17 23:10:49 alpha motion: [2] 0 length=62933
Jan 17 23:10:49 alpha motion: [2] 1 length=62933
Jan 17 23:10:49 alpha motion: [2] 2 length=62933
Jan 17 23:10:49 alpha motion: [2] 3 length=62933
Jan 17 23:10:49 alpha motion: [1] cap.driver: "uvcvideo"
Jan 17 23:10:49 alpha motion: [1] cap.card: "UVC Camera (046d:0807)"
Jan 17 23:10:49 alpha motion: [1] cap.bus_info: "usb-0000:01:07.3-2"
Jan 17 23:10:49 alpha motion: ...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in motion (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.