Page 1 of 1

ZMS crashes when trying to view events

Posted: Wed Nov 07, 2007 7:51 pm
by ammaross
I just noticed a problem with my event history. Around event 246107 on Oct 24 (which, for complete diagnostic information, happens to be around the time my system had to be recovered from a max folders in a folder issue that 1.23.x thankfully will fix), the event naming changes from the standard Event-<id> to "New Event" with seconds length of 0.0 with no frames or alarm frames information, scores, etc. But it has the proper time stamp, monitor, event type, and id. Upon inspection of the <installpath>/events/<monitorid>/<eventid> folder, it exists, and it has the capture.jpgs in it. The jpgs are the actual captured frames even, complete with timestamps. However, I can not view them through the web interface. (no thumbnails are shown and trying to view the event mjpeg shows a broken image logo. Switching streaming to mpeg shows a black image (as if it failed to receive source jpgs).
Any events prior to this works fine, generates thumbnails, etc, etc.

Examination of /var/log/messages shows my two sequential attempts to view the streaming mjpeg video.

Code: Select all

Nov  7 11:30:41 camserver zms[14226]: ERR [Got signal (Segmentation fault), crashing]
Nov  7 11:30:41 camserver zms[14226]: ERR [Signal address is (nil), from 0x8055584 ]
Nov  7 11:30:41 camserver zms[14226]: ERR [Backtrace: /var/www/cgi-bin/zms [0x8055584]]
Nov  7 11:30:41 camserver zms[14226]: ERR [Backtrace: /var/www/cgi-bin/zms [0x8055584]]
Nov  7 11:30:41 camserver zms[14226]: ERR [Backtrace: /var/www/cgi-bin/zms [0x804ab48]]
Nov  7 11:30:41 camserver zms[14226]: ERR [Backtrace: /lib/libc.so.6(__libc_start_main+0xe0) [0xc03f70]]
Nov  7 11:30:41 camserver zms[14226]: ERR [Backtrace: /var/www/cgi-bin/zms(__gxx_personality_v0+0x1e5) [0x804a0f1]]
Nov  7 11:31:16 camserver zms[14235]: ERR [Got signal (Segmentation fault), crashing]
Nov  7 11:31:16 camserver zms[14235]: ERR [Signal address is (nil), from 0x8055584 ]
Nov  7 11:31:16 camserver zms[14235]: ERR [Backtrace: /var/www/cgi-bin/zms [0x8055584]]
Nov  7 11:31:16 camserver zms[14235]: ERR [Backtrace: /var/www/cgi-bin/zms [0x8055584]]
Nov  7 11:31:16 camserver zms[14235]: ERR [Backtrace: /var/www/cgi-bin/zms [0x804ab48]]
Nov  7 11:31:16 camserver zms[14235]: ERR [Backtrace: /lib/libc.so.6(__libc_start_main+0xe0) [0xc03f70]]
Nov  7 11:31:16 camserver zms[14235]: ERR [Backtrace: /var/www/cgi-bin/zms(__gxx_personality_v0+0x1e5) [0x804a0f1]]
Debug file shows

Code: Select all

11/07/07 12:37:48.864013 zms[14508].INF-zm_debug.c/304 [New Debug Level = 9, New Debug Log = /tmp/zm_debug.log.14508]
11/07/07 12:37:48.864094 zms[14508].DB1-zms.cpp/84 [Query: mode=jpeg&event=246107&frame=1&scale=100&rate=100&maxfps=10&rand=1194464268]
11/07/07 12:37:48.864461 zms[14508].ERR-zm_signal.cpp/77 [Got signal (Segmentation fault), crashing]
11/07/07 12:37:48.864496 zms[14508].ERR-zm_signal.cpp/89 [Signal address is (nil), from 0x8055584
]
11/07/07 12:37:48.864592 zms[14508].ERR-zm_signal.cpp/116 [Backtrace: /var/www/cgi-bin/zms [0x8055584]]
11/07/07 12:37:48.864613 zms[14508].ERR-zm_signal.cpp/116 [Backtrace: /var/www/cgi-bin/zms [0x8055584]]
11/07/07 12:37:48.864631 zms[14508].ERR-zm_signal.cpp/116 [Backtrace: /var/www/cgi-bin/zms [0x804ab48]]
11/07/07 12:37:48.864649 zms[14508].ERR-zm_signal.cpp/116 [Backtrace: /lib/libc.so.6(__libc_start_main+0xe0) [0xc03f70]]
11/07/07 12:37:48.864667 zms[14508].ERR-zm_signal.cpp/116 [Backtrace: /var/www/cgi-bin/zms(__gxx_personality_v0+0x1e5) [0x804a0f1]]
11/07/07 12:37:48.864685 zms[14508].INF-zm_signal.cpp/117 [Backtrace complete]

Then addr2line for more info

Code: Select all

[root@camserver log]# addr2line -e /var/www/cgi-bin/zms 0x8055584 0x804ab48 0x804a0f1
/usr/include/stdlib.h:336
/root/ZoneMinder-1.22.3/src/zms.cpp:256
??:0
Which shows an inline function for strtol in the stdlib.h and this line in zms.cpp:

Code: Select all

Event::StreamEvent( event, frame, scale, rate, maxfps );
Here's a line from the event viewer:

Code: Select all

Id 	Name 	Monitor 	Cause 	Time 	Duration 	Frames 	Alarm 	Total 	Avg. 	Max.
246107 	New Event 	FrontDesk 	Motion 	10/24 10:55:13 	0.00 			0 	0 	0
Any ideas?
There are other incidents of this happening, but none were resolved or the solution didn't work in this case. (probably because of the empty database event info).

Posted: Wed Nov 07, 2007 8:03 pm
by cordel
Have you tried checking the database for errors:
http://www.zoneminder.com/wiki/index.ph ... atabase.3F

Posted: Mon Nov 12, 2007 8:58 pm
by ammaross
I didn't get a chance to check the DB. I rebuilt the system on Fedora 8 and put RC1 (now 2) on it.

Thanks for the suggestion though.

Re: ZMS crashes when trying to view events

Posted: Wed Dec 07, 2011 11:43 pm
by Briago
I had the same problem as described above, and found this thread.

I did perform the database repair per the linked site above.

Specifically I tried (as root):
mysqlcheck --all-databases --auto-repair

This found an error in one of the ZM tables, repaired it (apparently removing some entries) and now all new events are reporting properly. It doesn't fix the bad entries as the data itself is wrong (all entries had been "New Event").

Thank you for the link.

To help searches, the errors I received in the messages log were:
Dec 7 18:28:39 <Machine> zma_m5[28370]: ERR [Can't insert frames: Duplicate entry 'Normal' for key 'Type']
Dec 7 18:28:39 <Machine> zmdc[26811]: ERR ['zma -m 5' exited abnormally, exit status 38]