Page 1 of 1

Limited to 4 network cameras???

Posted: Mon Jan 30, 2012 9:30 pm
by slefevre
I've setup a new ZM 1.25 on CentOS 5.7 i386 in a VM. I have 8 Axis cameras for this system but I can only get four to work at a time.

The syslog show the following error messages.

Code: Select all

Jan 29 13:16:20 sc01 zmdc[3762]: WAR [Can't find process with command of 'zmc -m 6'] 
Jan 29 13:16:20 sc01 zmdc[8197]: INF ['zmc -m 6' started at 12/01/29 13:16:20] 
Jan 29 13:16:20 sc01 zmdc[3762]: INF ['zmc -m 6' starting at 12/01/29 13:16:20, pid = 8197] 
Jan 29 13:16:20 sc01 zmdc[3762]: INF ['zmc -m 6' crashed, signal 6] 
Jan 29 13:16:20 sc01 zmdc[3762]: INF [Starting pending process, zmc -m 6] 
Jan 29 13:16:20 sc01 zmdc[3762]: INF ['zmc -m 6' starting at 12/01/29 13:16:20, pid = 8204] 
Jan 29 13:16:20 sc01 zmdc[8204]: INF ['zmc -m 6' started at 12/01/29 13:16:20] 
Jan 29 13:16:20 sc01 zmdc[3762]: INF ['zmc -m 6' crashed, signal 6] 
Jan 29 13:16:20 sc01 zmdc[3762]: WAR [Can't find process with command of 'zma -m 6'] 
Jan 29 13:16:25 sc01 zmdc[3762]: INF [Starting pending process, zmc -m 6] 
Jan 29 13:16:25 sc01 zmdc[3762]: INF ['zmc -m 6' starting at 12/01/29 13:16:25, pid = 8233] 
Jan 29 13:16:25 sc01 zmdc[8233]: INF ['zmc -m 6' started at 12/01/29 13:16:25] 
Jan 29 13:16:25 sc01 zmdc[3762]: INF ['zmc -m 6' crashed, signal 6] 
Jan 29 13:16:29 sc01 zmdc[3762]: INF ['zmwatch.pl ' crashed, signal 6] 
To troubleshoot this, I've enabled debug logging but each log for the zmc process above is empty (0 bytes).
I try to run zmc from the command line and get the following.

Code: Select all

# zmc -m 6
Bus error
Thinking it may be related to Mmap, I've upgraded it to 0.16 via cpan but nothing changed.

I'm looking for help, suggestions, and pointers on troubleshooting this. Anyone have ideas?

Thanks!
Scott

Re: Limited to 4 network cameras???

Posted: Tue Jan 31, 2012 3:45 pm
by slefevre
To add more detail, I ran an strace on one of the monitors and the results follow.

Code: Select all

#strace zmc -m 4
....
open("/lib/libnss_dns.so.2", O_RDONLY)  = 6
read(6, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\v\0\0004\0\0\0"..., 512) = 512
fstat64(6, {st_mode=S_IFREG|0755, st_size=21948, ...}) = 0
mmap2(NULL, 20612, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 6, 0) = 0x5c4000
mmap2(0x5c8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 6, 0x3) = 0x5c8000
close(6)                                = 0
mprotect(0x5c8000, 4096, PROT_READ)     = 0
munmap(0xb7f9a000, 51724)               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 6
connect(6, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.132.50")}, 28) = 0
fcntl64(6, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(6, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
gettimeofday({1328023371, 871924}, NULL) = 0
poll([{fd=6, events=POLLOUT}], 1, 0)    = 1 ([{fd=6, revents=POLLOUT}])
send(6, "\24\37\1\0\0\1\0\0\0\0\0\0\6cam-sn\10med-care\5loc"..., 39, MSG_NOSIGNAL) = 39
poll([{fd=6, events=POLLIN}], 1, 5000)  = 1 ([{fd=6, revents=POLLIN}])
ioctl(6, FIONREAD, [55])                = 0
recvfrom(6, "\24\37\205\200\0\1\0\1\0\0\0\0\6cam-sn\10med-care\5loc"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.132.50")}, [16]) = 55
close(6)                                = 0
mmap2(NULL, 3076096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7c9e000
mmap2(NULL, 3076096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb79af000
mmap2(NULL, 3076096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76c0000
open("/dev/shm/zm.mmap.4", O_RDWR|O_CREAT, 0600) = 6
fstat64(6, {st_mode=S_IFREG|0600, st_size=122881192, ...}) = 0
mmap2(NULL, 122881192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, 6, 0) = 0xb018f000
--- SIGBUS (Bus error) @ 0 (0) ---
+++ killed by SIGBUS +++
I've done a little googling w/ little result. It looks related to shared memory.
The file /dev/shm/zm.mmap.4 is created.

Any ideas?

Cheers,
Scott

[SOLVED] Re: Limited to 4 network cameras???

Posted: Tue Jan 31, 2012 6:00 pm
by slefevre
I've figured this out and posting here to document the solution for future users.

The short answer is this:
'Bus error' = not enough shared memory

Shared memory is allocated out of the tmpfs file system. If you run

Code: Select all

df -h
it will show you how much memory is allocated to the tmpfs. If you do the math on how much shared memory will be needed ( http://www.zoneminder.com/wiki/index.ph ... solutions.) you can adjust the tmpfs file system in /etc/fstab.

Mine now includes:

Code: Select all

tmpfs                   /dev/shm                tmpfs   size=1024m       0 0
I hope this helps others avoid this issue.

Cheers,
Scott

Re: Limited to 4 network cameras???

Posted: Tue Jan 31, 2012 9:44 pm
by cordel
Good show and thank you for the follow up.