Motion - Bug Report 2005x 08x 15x 150416

BUG: segfault after start with WCS2003(same as wvc54g from Linksys) netcam and motion-3.2.2

after changing to 3.2.2 i noticed that motion simply stops working when i enable the netcam no error messages or any other hints the netcam is a wcs2003 from levelone what is the same as linksys wvc54g a stream snapshot for wvc54g i found in the wiki and its the same compared to the wcs2003 output

syslog:

 

Aug 14 21:20:44 flashlight motion: [0] Processing thread 0 - config file /etc/motion/motion.conf  
Aug 14 21:20:44 flashlight motion: [0] Processing config file /etc/motion/thread1.conf  
Aug 14 21:20:44 flashlight motion: [0] Processing config file /etc/motion/thread6.conf  
Aug 14 21:20:44 flashlight motion: [1] Thread is from /etc/motion/thread1.conf  
Aug 14 21:20:44 flashlight motion: [2] Thread is from /etc/motion/thread6.conf  
Aug 14 21:20:44 flashlight motion: [1] Thread started  
Aug 14 21:20:44 flashlight motion: [2] Thread started  
Aug 14 21:20:45 flashlight kernel: pwc decode_size = 5.  
Aug 14 21:20:45 flashlight kernel: pwc Using alternate setting 9.  
Aug 14 21:20:45 flashlight kernel: pwc frame_size=94560, vframes=10, vsize=5, vsnapshot=0, vbandlength=788  
Aug 14 21:20:45 flashlight motion: [1] Started stream webcam server in port 2011  
Aug 14 21:20:59 flashlight CROND[17980]: (root) CMD (   /usr/share/msec/promisc_check.sh)   
Aug 14 21:21:58 flashlight kernel: pwc decode_size = 5.  
Aug 14 21:21:58 flashlight kernel: pwc Using alternate setting 9.  
Aug 14 21:21:58 flashlight kernel: pwc frame_size=94560, vframes=10, vsize=5, vsnapshot=0, vbandlength=788  
Aug 14 21:21:58 flashlight kernel: pwc decode_size = 5.  
Aug 14 21:21:58 flashlight kernel: pwc Using alternate setting 9.  
Aug 14 21:21:58 flashlight kernel: pwc frame_size=94560, vframes=10, vsize=5, vsnapshot=0, vbandlength=788  
Aug 14 21:21:59 flashlight motion: [0] Processing thread 0 - config file /etc/motion/motion.conf  
Aug 14 21:21:59 flashlight motion: [0] Processing config file /etc/motion/thread1.conf  
Aug 14 21:21:59 flashlight motion: [0] Processing config file /etc/motion/thread6.conf  
Aug 14 21:21:59 flashlight motion: [0] Motion running as daemon process  
Aug 14 21:21:59 flashlight motion: [0] Capturing 5 frames/s when idle  
Aug 14 21:21:59 flashlight motion: [1] Thread is from /etc/motion/thread1.conf  
Aug 14 21:21:59 flashlight motion: [2] Thread is from /etc/motion/thread6.conf  
Aug 14 21:21:59 flashlight motion: [1] Thread started  
Aug 14 21:21:59 flashlight motion: [2] Thread started  
Aug 14 21:21:59 flashlight kernel: pwc decode_size = 5.  
Aug 14 21:21:59 flashlight kernel: pwc Using alternate setting 9.  
Aug 14 21:21:59 flashlight kernel: pwc frame_size=94560, vframes=10, vsize=5, vsnapshot=0, vbandlength=788  
Aug 14 21:22:00 flashlight motion: [1] Started stream webcam server in port 2011 

debug output enabled says following:

[0] Processing thread 0 - config file /etc/motion/motion.conf 
[0] Processing config file /etc/motion/thread1.conf 
[0] Processing config file /etc/motion/thread6.conf 
[1] Thread is from /etc/motion/thread1.conf 
[2] Thread is from /etc/motion/thread6.conf 
[1] Thread started 
[2] Thread started 
[2] entered netcam_start() 
[2] Camera thread starting... 
[2] Received first header 
[2] Streaming camera 
[2] Boundary string [--ServerPush] 
[2] Found image header record 
[2] expanding buffer from 0 to 4096 bytes 
[2] expanding buffer from 4096 to 8192 bytes 
[2] expanding buffer from 8192 to 12288 bytes 
[2] expanding buffer from 12288 to 16384 bytes 
[1] Started stream webcam server in port 2011 
[2] Camera handler thread [3]  started 
[2] Found image header record 
[2] expanding buffer from 0 to 4096 bytes 
[2] expanding buffer from 4096 to 8192 bytes 
[2] expanding buffer from 8192 to 12288 bytes 
[2] expanding buffer from 12288 to 16384 bytes 
[2] Found image header record 
[2] expanding buffer from 0 to 4096 bytes 
[1] File of type 32 saved to: /home/motion/webcam1/timelaps/2005/08/15/11-timelapse.mpg 
Segmentation fault

gdb output (sorry but mdk has no debug symbols in the libs, any hint for better trace?):

[root@flashlight mirko]# gdb -e motion 
GNU gdb 6.2-2mdk (Mandrakelinux) 
Copyright 2004 Free Software Foundation, Inc. 
GDB is free software, covered by the GNU General Public License, and you are 
welcome to change it and/or distribute copies of it under certain conditions. 
Type "show copying" to see the conditions. 
There is absolutely no warranty for GDB.  Type "show warranty" for details. 
This GDB was configured as "i586-mandrake-linux-gnu". 
(gdb) run 
Starting program: /usr/local/bin/motion 
(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1". 
(no debugging symbols found)...[Thread debugging using libthread_db enabled] 
[New Thread -1214226304 (LWP 24259)] 
(no debugging symbols found)...[0] Processing thread 0 - config file /root/.motion/motion.conf 
[0] Processing config file /etc/motion/thread1.conf 
[0] Processing config file /etc/motion/thread6.conf 
[1] Thread is from /etc/motion/thread1.conf 
[New Thread -1214227536 (LWP 24262)] 
[2] Thread is from /etc/motion/thread6.conf 
[New Thread -1222620240 (LWP 24263)] 
[2] Thread started 
[1] Thread started 
[New Thread -1237496912 (LWP 24264)] 
[1] Started stream webcam server in port 2011 
 
Program received signal SIGSEGV, Segmentation fault. 
[Switching to Thread -1222620240 (LWP 24263)] 
0xb720104f in ?? () 
(gdb) bt 
#0  0xb720104f in ?? () 
#1  0x08073523 in ?? () 
#2  0xb7201150 in ?? () 
#3  0x08142684 in ?? () 
#4  0x080c225c in ?? () 
#5  0x08143354 in ?? () 
#6  0x00000000 in ?? () 
#7  0x0814328c in ?? () 
#8  0x0814326c in ?? () 
#9  0x0814326c in ?? () 
#10 0x000000f0 in ?? () 
#11 0x00000000 in ?? () 
#12 0x0814328c in ?? () 
#13 0x08077cb0 in ?? () 
#14 0x00000000 in ?? () 
#15 0x08143354 in ?? () 
#16 0x00000002 in ?? () 
#17 0x00000000 in ?? () 
#18 0x00000000 in ?? () 
#19 0x00000000 in ?? () 
#20 0x00000000 in ?? () 
#21 0x0000000e in ?? () 
#22 0x00000013 in ?? () 
---Type <return> to continue, or q <return> to quit--- 
#23 0x00000000 in ?? () 
#24 0x0814326c in ?? () 
#25 0x08143334 in ?? () 
#26 0x0814326c in ?? () 
#27 0xb7201150 in ?? () 
#28 0xb72010b8 in ?? () 
#29 0x08072c1d in ?? () 
#30 0xb7201150 in ?? () 
#31 0x08143334 in ?? () 
#32 0xb72010d0 in ?? () 
#33 0xb72010d0 in ?? () 
#34 0x0000001f in ?? () 
#35 0x080bd868 in ?? () 
#36 0x00000048 in ?? () 
#37 0x000003d5 in ?? () 
#38 0xb7ca9b20 in __after_morecore_hook () from /lib/tls/libc.so.6 
#39 0xb7ca9218 in ?? () from /lib/tls/libc.so.6 
#40 0xb7ca9b20 in __after_morecore_hook () from /lib/tls/libc.so.6 
#41 0x000003cc in ?? () 
#42 0xb72010a8 in ?? () 
#43 0xb7befaf9 in malloc () from /lib/tls/libc.so.6 
Previous frame inner to this frame (corrupt stack?) 
(gdb)

with the older 3.1.19 / 3.2.1 versions - i have no problems with that netcam any hints what (and how) i can check to solve this ?

Test case

Environment

Motion version: 3.2.2
ffmpeg version: 0.4.9pre1
Shared libraries: ffmpeg, mysql, postgresql, libjpeg-mmx
Server OS: Mandrake 10.1, kernel 2.6.11-11

-- TWikiGuest - 15 Aug 2005

Follow up

Please use <VERBATIM> </VERBATIM> tags around the logs messages and gdb trace to be more readable in Twiki.

To do a better debuging :

1-. Edit Makefile and remove the flag -O2 , then type make clean ; make ; make install

2-. Enable the core dumped typing in the same console where are you going to run motion ulimit -1000000

3-. So next time motion segfault you'll have a core dumped .

4-. Run gdb with the core dumped gdb ./motion core.xxxx ( where xxxx is the pid of motion ).

5-. Try to switch to the thread that sefgault using info thread to list threads and thread x to switch to the thread where the segfault happened.

6-. GDB trace , usually bt is not enough so just type bt for see the stack frames and try to show the frame inside motion not libs where the segfault happened , usually is frame 1 or 2 so type frame 2.

BTW , what version of ffmpeg are you using ?

-- AngelCarpintero - 15 Aug 2005

Follow up

ok i have tried your hints, but Mandrake won't create a core file frown, sad smile nevertheless i have tried the other hints an get a better info

 
[root@flashlight bin]# gdb ./motion 
GNU gdb 6.2-2mdk (Mandrakelinux) 
Copyright 2004 Free Software Foundation, Inc. 
GDB is free software, covered by the GNU General Public License, and you are 
welcome to change it and/or distribute copies of it under certain conditions. 
Type "show copying" to see the conditions. 
There is absolutely no warranty for GDB.  Type "show warranty" for details. 
This GDB was configured as "i586-mandrake-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". 
 
(gdb) run 
Starting program: /usr/local/bin/motion 
[Thread debugging using libthread_db enabled] 
[New Thread -1214226304 (LWP 18331)] 
[0] Processing thread 0 - config file /root/.motion/motion.conf 
[0] Processing config file /etc/motion/thread1.conf 
[0] Processing config file /etc/motion/thread6.conf 
[1] Thread is from /etc/motion/thread1.conf 
[New Thread -1214227536 (LWP 18334)] 
[2] Thread is from /etc/motion/thread6.conf 
[New Thread -1222620240 (LWP 18335)] 
[2] Thread started 
[1] Thread started 
[New Thread -1237496912 (LWP 18336)] 
[1] Started stream webcam server in port 2011 
[1] File of type 32 saved to: /home/motion/webcam1/timelaps/2005/08/15/22-timelapse.mpg 
 
Program received signal SIGSEGV, Segmentation fault. 
[Switching to Thread -1222620240 (LWP 18335)] 
0xb7200fdd in ?? () 
(gdb) info thread 
  4 Thread -1237496912 (LWP 18336)  0xffffe410 in ?? () 
* 3 Thread -1222620240 (LWP 18335)  0xb7200fdd in ?? () 
  2 Thread -1214227536 (LWP 18334)  0xffffe410 in ?? () 
  1 Thread -1214226304 (LWP 18331)  0xffffe410 in ?? () 
(gdb) thread 3 
[Switching to thread 3 (Thread -1222620240 (LWP 18335))]#0  0xb7200fdd in ?? () 
(gdb) bt 
#0  0xb7200fdd in ?? () 
#1  0x08078a33 in decompress_onepass () 
Previous frame inner to this frame (corrupt stack?) 
(gdb) frame 1 
#1  0x08078a33 in decompress_onepass () 
(gdb) 

after that i have located the function decompress_onepass in the libjpeg-mmx lib. This lib is the actual version from mjpeg.sourceforge.net (v0.1.6, dated 2005-03-25), after removing this lib and recompiling - motion works fine. So it seems to be a non motion related problem. possibly i use the wrong lib - but why it works with the normal philips webcam ?

btw: i'm using ffmpeg 0.4.9pre1 build 4718

Fix record

Thanks for reporting back to us.

I put the bug report in MONITORED mode for a while to see if more get problems. If so we will remove the feature again.

Kenneth

BugReportForm edit

TopicTitle segfault after start with WCS2003(same as wvc54g from Linksys) netcam and motion-3.2.2
BugStatus Monitored
AssignedBugTo
SubmittedBy Mirko Taschenberger
Topic revision: r4 - 16 Aug 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.