bus error when adding a 19th 1080p camera

Forum for questions and support relating to the 1.28.x releases only.
Locked
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

bus error when adding a 19th 1080p camera

Post by marcmerlin »

I seem to be hitting some limit, I'm not sure what. At this point I'm just copying camera 18's settings into a camera 19, and zmc just fails with sigbus
I have
gargamel:~# grep . /proc/sys/kernel/shm*
/proc/sys/kernel/shmall:8000000000
/proc/sys/kernel/shmmax:4096000
Considering it dies just after
open("/dev/shm/zm.mmap.19", O_RDWR|O_CREAT, 0600) = 6
I'm assuming it's still a shared memory problem, but putting stupid high values in the params above doesn't seem to help :-/
The server has 24GB of RAM.

Camera settings: http/simple/user:pwd@wansview-ncm751ga-1/ /mjpeg/snap.cgi?chn=0 / 24bit / 1920/1080

I see zoneminder 1.30 is out, but is there a short version of what's been updated? I see pages and pages and pages of github entries which just don't make sense to read. Are there cliff notes somewhere?

The crash:
gargamel:~# zmc -m 19
Bus error
Program received signal SIGBUS, Bus error.
[Switching to Thread 0xf2e04800 (LWP 7288)]
0xf57595ca in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
(gdb) bt
#0 0xf57595ca in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#1 0x0806a787 in Monitor::Monitor ()

strace:
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 6
connect(6, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.205.3")}, 16) = 0
poll([{fd=6, events=POLLOUT}], 1, 0) = 1 ([{fd=6, revents=POLLOUT}])
sendmmsg(6, {{{msg_name(0)=NULL, msg_iov(1)=[{"\260R\1\0\0\1\0\0\0\0\0\0\23wansview-ncm751ga-1\3svh\7merlins\3org\0\0\1\0\1", 53}], msg_controllen=0, msg_flags=0}, 53}, {{msg_name(0)=NULL, msg_iov(1)=[{"\307\311\1\0\0\1\0\0\0\0\0\0\23wansview-ncm751ga-1\3svh\7merlins\3org\0\0\34\0\1", 53}], msg_controllen=0, msg_flags=0}, 53}}, 2, MSG_NOSIGNAL) = 2
poll([{fd=6, events=POLLIN}], 1, 5000) = 1 ([{fd=6, revents=POLLIN}])
ioctl(6, FIONREAD, [104]) = 0
recvfrom(6, "\307\311\205\200\0\1\0\0\0\1\0\0\23wansview-ncm751ga-1\3svh\7merlins\3org\0\0\34\0\1\300 \0\6\0\1\0\0\0<\0'\3ns1\300$\nhostmaster\300$x+j\305\0\0\16\20\0\0\3\204\0\22u\0\0\0\0<", 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.205.3")}, [16]) = 104
poll([{fd=6, events=POLLIN}], 1, 4999) = 1 ([{fd=6, revents=POLLIN}])
ioctl(6, FIONREAD, [137]) = 0
brk(0xd8d8000) = 0xd8d8000
recvfrom(6, "\260R\205\200\0\1\0\1\0\2\0\2\23wansview-ncm751ga-1\3svh\7merlins\3org\0\0\1\0\1\300\f\0\1\0\1\0\0\16\20\0\4\300\250\315P\300 \0\2\0\1\0\0\16\20\0\6\3ns1\300 \300 \0\2\0\1\0\0\16\20\0\6\3ns2\300 \300Q\0\1\0\1\0\0\16\20\0\4\300\250\315\376\300c\0\1\0\1\0\0\16\20\0\4\300\250\315\3", 65536, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.205.3")}, [16]) = 137
close(6) = 0
brk(0xd8c8000) = 0xd8c8000
mmap2(NULL, 6221824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff1e11000
mmap2(NULL, 2076672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff1c16000
mmap2(NULL, 6221824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff1627000
open("/dev/shm/zm.mmap.19", O_RDWR|O_CREAT, 0600) = 6
fstat64(6, {st_mode=S_IFREG|0600, st_size=311041360, ...}) = 0
mmap2(NULL, 311041360, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, 6, 0) = 0xffffffffded85000
--- SIGBUS {si_signo=SIGBUS, si_code=BUS_ADRERR, si_addr=0xea631000} ---
+++ killed by SIGBUS +++
Bus error
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: bus error when adding a 19th 1080p camera

Post by bbunge »

Looks like you may have hit a shared memory limit. Using settings for shared memory (shmall and shmmax) is old hat and they have not been used for a while now. Check your tmpfs usage with a df. Many Linux OSes (Ubuntu & Debian for two) will use half of the available RAM for tmpfs. Check the ZM Paths settings to see what directory your system is using.

Solutions include lowering the camera resolution/frame rate or increasing the amount of tmpfs (fstab entry).

Going to a newer version of Zoneminder likely will not help.
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: bus error when adding a 19th 1080p camera

Post by marcmerlin »

bbunge wrote:Looks like you may have hit a shared memory limit. Using settings for shared memory (shmall and shmmax) is old hat and they have not been used for a while now. Check your tmpfs usage with a df. Many Linux OSes (Ubuntu & Debian for two) will use half of the available RAM for tmpfs. Check the ZM Paths settings to see what directory your system is using.

Solutions include lowering the camera resolution/frame rate or increasing the amount of tmpfs (fstab entry).

Going to a newer version of Zoneminder likely will not help.
Thanks for your reply. Sadly google still points to old results.
gargamel:~# grep shm /proc/mounts
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=2097152k 0 0
gargamel:~# cd /run/shm/
gargamel:/run/shm# df -h .
Filesystem Size Used Avail Use% Mounted on
tmpfs 2.0G 2.0G 0 100% /run/shm

So now I know how to actually fix it :)

Back to changelogs, is there a way to know what a new zoneminder brings so that I know whether it has new features I care about and whether it's worth the cost of upgrading?

Thanks, Marc
Locked