Motion - Bug Report 2008x 05x 29x 082232

BUG: Crash on reconect webcam

When I lost the connection on my webcam Logitech, unplug and plug the usb, then Motion detect the camera again and is going down.

Webcam Logitech Quickcam express with module quickcam

Output message log

15:53:30 motion: [2] Retrying until successful connection with camera
15:53:30 motion: [2] Failed to open video device /dev/video0: No such device
15:53:40 motion: [2] Retrying until successful connection with camera
15:53:40 motion: [2] Failed to open video device /dev/video0: No such device
15:53:50 motion: [2] Retrying until successful connection with camera
15:53:50 motion: [2] Failed to open video device /dev/video0: No such device
15:53:58 kernel: usb 1-8: new full speed USB device using ohci_hcd and address
12
15:53:59 kernel: usb 1-8: new device found, idVendor=046d, idProduct=0870
15:53:59 kernel: usb 1-8: new device strings: Mfr=0, Product=1, SerialNumber=0
15:53:59 kernel: usb 1-8: Product: Camera
15:53:59 kernel: usb 1-8: configuration #1 chosen from 1 choice
15:53:59 kernel: quickcam: QuickCam USB camera found (driver version QuickCam
USB 0.6.6 $Date: 2006/11/04 08:38:14 $)
15:53:59 kernel: quickcam: bus:1 class:FF subclass:FF vendor:046D product:0870
15:53:59 kernel: quickcam: Sensor HDCS-1020 detected
15:53:59 kernel: motion[15923]: segfault at ffffffff0958d0c8 rip
000000000041da22 rsp 00000000407fe970 error 4

Environment

Motion version: 3.2.10
ffmpeg version: FFmpeg version SVN-r12823
Shared libraries: ffmpeg, mysql, postgresql
Server OS: Opensuse 10.3 64bits, kernel 2.6.22.17-0.1-default

-- TrebolA - 29 May 2008

Follow up

Hi Alberto,

I run motion in no daemon mode in a x86 and i cannot reproduce your issue :

motion
[1] mcapture error in proc 17341: No such device
[1] Video device fatal error - Closing video device
[1] Closing video device /dev/video3
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video3: No such file or directory
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video3: No such file or directory
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video3: No such file or directory
[1] Video signal lost - Adding grey image
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video3: No such file or directory
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video3: No such file or directory
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video3: No such file or directory
[1] Retrying until successful connection with camera
[1] Not a V4L2 device?
[1] Failed with YUV420P, trying YUV422 palette: Invalid argument
[1] Using VIDEO_PALETTE_YUV422 palette
[1] Using V4L1
[1] Video signal re-acquired

syslog
May 29 14:36:55 develop4 kernel: [389191.024603] usb 2-4: USB disconnect, address 3
May 29 14:36:55 develop4 NetworkManager: <debug> [1212064615.134103] nm_hal_device_removed(): Device removed 
(hal udi is '/org/freedesktop/ Hal/devices/usb_device_46d_870_noserial_if0').
May 29 14:36:55 develop4 NetworkManager: <debug> [1212064615.139509] nm_hal_device_removed(): Device removed 
(hal udi is '/org/freedesktop/ Hal/devices/usb_device_46d_870_noserial').
May 29 14:36:55 develop4 motion: [1] mcapture error in proc 17341: No such device
May 29 14:36:55 develop4 motion: [1] Video device fatal error - Closing video device
May 29 14:36:55 develop4 motion: [1] Closing video device /dev/video3
May 29 14:37:00 develop4 motion: [1] Retrying until successful connection with camera
May 29 14:37:00 develop4 motion: [1] Failed to open video device /dev/video3: No such file or directory
May 29 14:37:10 develop4 motion: [1] Retrying until successful connection with camera
May 29 14:37:10 develop4 motion: [1] Failed to open video device /dev/video3: No such file or directory
May 29 14:37:20 develop4 motion: [1] Retrying until successful connection with camera
May 29 14:37:20 develop4 motion: [1] Failed to open video device /dev/video3: No such file or directory
May 29 14:37:25 develop4 motion: [1] Video signal lost - Adding grey image
May 29 14:37:30 develop4 motion: [1] Retrying until successful connection with camera
May 29 14:37:30 develop4 motion: [1] Failed to open video device /dev/video3: No such file or directory
May 29 14:37:40 develop4 motion: [1] Retrying until successful connection with camera
May 29 14:37:40 develop4 motion: [1] Failed to open video device /dev/video3: No such file or directory
May 29 14:37:50 develop4 motion: [1] Retrying until successful connection with camera
May 29 14:37:50 develop4 motion: [1] Failed to open video device /dev/video3: No such file or directory
May 29 14:37:59 develop4 kernel: [389254.834838] usb 2-4: new full speed USB device using ohci_hcd and address 4
May 29 14:37:59 develop4 kernel: [389255.043677] usb 2-4: configuration #1 chosen from 1 choice
May 29 14:37:59 develop4 NetworkManager: <debug> [1212064679.248975] nm_hal_device_added(): 
New device added (hal udi is '/org/freedesktop/ Hal/devices/usb_device_46d_870_noserial').
May 29 14:37:59 develop4 kernel: [389255.051485] quickcam: QuickCam USB camera found 
(driver version QuickCam USB 0.6.6 $Date: 2006/11/04   08:38:14 $)
May 29 14:37:59 develop4 kernel: [389255.051495] quickcam: Kernel:2.6.24-16-generic bus:2 
class:FF subclass:FF vendor:046D product:0870
May 29 14:37:59 develop4 kernel: [389255.074468] quickcam: Sensor HDCS-1020 detected
May 29 14:37:59 develop4 kernel: [389255.080516] quickcam: Registered device: /dev/video3
May 29 14:37:59 develop4 NetworkManager: <debug> [1212064679.385791] nm_hal_device_added():
 New device added (hal udi is '/org/freedesktop/ Hal/devices/usb_device_46d_870_noserial_if0').
May 29 14:38:00 develop4 motion: [1] Retrying until successful connection with camera
May 29 14:38:00 develop4 motion: [1] Not a V4L2 device?
May 29 14:38:00 develop4 motion: [1] Failed with YUV420P, trying YUV422 palette: Invalid argument
May 29 14:38:00 develop4 motion: [1] Using VIDEO_PALETTE_YUV422 palette
May 29 14:38:00 develop4 motion: [1] Video signal re-acquired

I'll try to reproduce in x84_64 .

-- AngelCarpintero - 29 May 2008

Hi Angel,

Note: When motion lost the connection with webcam, the device is not dissapear, the /dev/video0 still exists. (I think i have problem with the usb cable (5 mts) or the humidity on webcam)

I have launch Motion on mode no-daemon and this is the console messages:
[0] Thread 2 - Watchdog timeout, did NOT restart graceful,killing it!
[0] Calling vid_close() from motion_cleanup
[0] Closing video device /dev/video0
[0] Motion thread 2 restart
[2] Thread 2 started
[2] Not a V4L2 device?
[2] Failed with YUV420P, trying YUV422 palette: Invalid argument
[2] Using VIDEO_PALETTE_YUV422 palette
[2] Using V4L1
[2] Resizing pre_capture buffer to 1 items
[0] Thread 2 - Watchdog timeout, trying to do a graceful restart
[0] Thread 2 - Watchdog timeout, did NOT restart graceful,killing it!
[0] Calling vid_close() from motion_cleanup
[0] Closing video device /dev/video0
[0] Motion thread 2 restart
[2] Thread 2 started
[2] Not a V4L2 device?
[2] Failed with YUV420P, trying YUV422 palette: Invalid argument
[2] Using VIDEO_PALETTE_YUV422 palette
[2] Using V4L1
[2] Resizing pre_capture buffer to 1 items
[0] Thread 2 - Watchdog timeout, trying to do a graceful restart
[2] Started stream webcam server in port 8891
[2] Thread exiting
[2] Calling vid_close() from motion_cleanup
[2] Closing video device /dev/video0
ViolaciÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’¢â€žÂ¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¾ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’‚ ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’‚žÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’¢â€žÂ¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’…ÃÆ’‚¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’…ÃÆ’‚¾ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’¢â€žÂ¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¾ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’…ÃÆ’‚¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’¢â€žÂ¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â¦ÃÆ’Ãâ€Â ’‚ÃÆ’‚¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’…ÃÆ’‚¾ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’¢â€žÂ¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¾ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’‚ ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’‚žÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’¢â€žÂ¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’‚ÃÆ’‚¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Â¦ÃÆ’Ãâ€Â ’‚ÃÆ’‚¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’Æ’ÃÆ’¢â‚¬Å¡ÃÆ’Ãâ€Â ’‚ÃÆ’‚¬ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’†ÃÆ’¢â‚¬â„¢ÃÆ’Ãâ€Â ’Æ’ÃÆ’‚¢ÃÆ’Ãâ€Â ’¢ÃÆ’¢â‚¬Å¡ÃÆ’‚¬ÃÆ’Ãâ€Â ’‚ÃÆ’‚¦ÃÆ’Ãâ€Â ’Æ’ÃÆ’â€Â ’ÃÆ’Ãâ€Â ’¢ÃÆ’¢â€šÂ¬ÃÆ’…¡ÃÆ’Ãâ€Â ’ÃÃÃ