shared memory problem

Forum for questions and support relating to the 1.24.x releases only.
Locked
izghitu
Posts: 5
Joined: Tue Jun 16, 2009 5:28 am

shared memory problem

Post by izghitu »

Hi,

After installing and configuring zone minder, i get the following errors:
zmwatch[2829]: ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
zmwatch[2829]: ERR [Can't get shared memory id '7a6d0003', 3: No such file or directory]

Reading the forums and googling for this tells that I need to increase the shmmax and shmall values. Trying to increase them does not work, I guess they are already at their max values:
[root@secure ~]# sysctl -a | grep shmmax
kernel.shmmax = 4294967294
[root@secure ~]# sysctl -a | grep shmall
kernel.shmall = 4294967294

How do I fix this? Please help
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

turn on more debugging it may not be shared memory also what hardware/drivers. and linux distro are you running
izghitu
Posts: 5
Joined: Tue Jun 16, 2009 5:28 am

Post by izghitu »

Hi,

Thanks for your reply. Here's the whole story:
I have zoneminder-1.24.1-5 running on CentOS 5.3

I have 2 cameras, 1 dlink 5300g and one TrendNet IP-312W
I followed all the docs I could find, changed HTTP to version 1.0, etc

So my problem is that sometimes both cameras show up fine, I close the window and when I re-open it they no longer show anything, just a black screen. The only way to get it back working is to restart zoneminder.

When it's not working I see the following errors:

Code: Select all

zmwatch[2829]: ERR [Can't get shared memory id '7a6d0003', 3: No such file or directory]
zmwatch[2829]: ERR [Can't get shared memory id '7a6d0003', 3: No such file or directory]
zms[29329]: INF [Debug Level = 0, Debug Log = <none>]
zms[29329]: INF [New Debug Level = 4, New Debug Log = /tmp/zm_debug.log.29329]
zms[29329]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
zms[29329]: WAR [Unable to store frame as shared memory invalid]
/tmp/zm_debug.log.29329 says the following:

Code: Select all

06/17/09 01:57:33.978933 zms[29329].INF-zm_debug.c/292 [New Debug Level = 4, New Debug Log = /tmp/zm_debug.log.29329]
06/17/09 01:57:33.979173 zms[29329].DB1-zms.cpp/92 [Query: mode=jpeg&monitor=3&scale=100&maxfps=5&buffer=1000&connkey=806498&rand=1245221851]
06/17/09 01:57:33.980818 zms[29329].DB1-zm_monitor.cpp/2260 [Got 1 monitors]
06/17/09 01:57:33.985275 zms[29329].DB1-zm_monitor.cpp/338 [monitor purpose=0]
06/17/09 01:57:33.985369 zms[29329].DB1-zm_monitor.cpp/345 [mem.size=40551592]
06/17/09 01:57:33.985512 zms[29329].WAR-zm_monitor.cpp/437 [Shared data not initialised by capture daemon, some query functions may not be available or produc
e invalid results]
06/17/09 01:57:33.985782 zms[29329].DB1-zm_zone.cpp/50 [Initialised zone 0/All - 1 - 704x480 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3,
 MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0, OF: 0]
06/17/09 01:57:33.999049 zms[29329].DB1-zm_monitor.cpp/458 [Monitor Dlink5300g has function 2]
06/17/09 01:57:33.999114 zms[29329].DB1-zm_monitor.cpp/459 [Monitor Dlink5300g LBF = '%N - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
06/17/09 01:57:33.999150 zms[29329].DB1-zm_monitor.cpp/460 [Monitor Dlink5300g IBC = 40, WUC = 25, pEC = 10, PEC = 10, EAF = 1, FRI = 1000, RBP = 7, FM = 0]
06/17/09 01:57:33.999221 zms[29329].DB1-zm_monitor.cpp/2457 [Loaded monitor 3(Dlink5300g), 0 zones]
06/17/09 01:57:33.999507 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:57:33.999585 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:57:33.999748 zms[29329].DB2-zm_monitor.cpp/3342 [Checking swap image location]
06/17/09 01:57:33.999802 zms[29329].DB3-zm_monitor.cpp/3343 [Checking swap image path]
06/17/09 01:57:33.999963 zms[29329].DB3-zm_monitor.cpp/2866 [Swap path '/tmp/zmswap-m3/zmswap-q806498' missing, creating]
06/17/09 01:57:34.000124 zms[29329].DB2-zm_monitor.cpp/3364 [Assigning temporary buffer]
06/17/09 01:57:34.023916 zms[29329].DB2-zm_monitor.cpp/3367 [Assigned temporary buffer]
06/17/09 01:57:34.024070 zms[29329].DB3-zm_stream.cpp/115 [Scaling by 100, zooming by 100 = magnifying by 100(100)]
06/17/09 01:57:34.024117 zms[29329].DB3-zm_stream.cpp/119 [Last scaling by 100, zooming by 100 = magnifying by 100(100)]
06/17/09 01:57:34.024150 zms[29329].DB3-zm_stream.cpp/122 [Base image width = 704, height = 480]
06/17/09 01:57:34.024179 zms[29329].DB3-zm_stream.cpp/125 [Virtual image width = 704, height = 480]
06/17/09 01:57:34.024208 zms[29329].DB3-zm_stream.cpp/128 [Last virtual image width = 704, height = 480]
06/17/09 01:57:34.024236 zms[29329].DB3-zm_stream.cpp/131 [Actual image width = 704, height = 480]
06/17/09 01:57:34.024265 zms[29329].DB3-zm_stream.cpp/134 [Last actual image width = 704, height = 480]
06/17/09 01:57:34.024292 zms[29329].DB3-zm_stream.cpp/137 [Display image width = 704, height = 480]
06/17/09 01:57:34.024320 zms[29329].DB3-zm_stream.cpp/140 [Last display image width = 704, height = 480]
06/17/09 01:57:34.024373 zms[29329].DB3-zm_stream.cpp/143 [Send image width = 704, height = 480]
06/17/09 01:57:34.024409 zms[29329].DB3-zm_stream.cpp/146 [Last send image width = 704, height = 480]
06/17/09 01:57:34.024439 zms[29329].DB3-zm_stream.cpp/164 [Real image width = 704, height = 480]
06/17/09 01:57:34.046214 zms[29329].WAR-zm_monitor.cpp/3531 [Unable to store frame as shared memory invalid]
06/17/09 01:57:39.071481 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:57:39.071543 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:57:39.071583 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221859.071, Z:100, E:1 F:0]
06/17/09 01:57:39.071725 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:57:39.071785 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:57:49.609585 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:57:49.609639 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:57:49.609676 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221869.610, Z:100, E:1 F:0]
06/17/09 01:57:49.609854 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:57:49.609926 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:58:00.174740 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:58:00.174809 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:58:00.174847 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221880.175, Z:100, E:1 F:0]
06/17/09 01:58:00.174931 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:58:00.174985 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:58:10.736821 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:58:10.736874 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:58:10.736911 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221890.737, Z:100, E:1 F:0]
06/17/09 01:58:10.736992 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:58:10.737041 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:58:21.304930 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:58:21.304983 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:58:21.305019 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221901.305, Z:100, E:1 F:0]
06/17/09 01:58:21.305100 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:58:21.305149 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:58:31.851048 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:58:31.851102 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:58:31.851138 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221911.851, Z:100, E:1 F:0]
06/17/09 01:58:31.851229 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:58:31.851283 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:58:42.395172 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:58:42.395224 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:58:42.395261 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221922.395, Z:100, E:1 F:0]
06/17/09 01:58:42.395342 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:58:42.395389 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:58:52.952307 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:58:52.952374 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:58:52.952421 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221932.952, Z:100, E:1 F:0]
06/17/09 01:58:52.952498 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:58:52.952545 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:59:03.486406 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:59:03.486462 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:59:03.486500 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221943.486, Z:100, E:1 F:0]
06/17/09 01:59:03.486577 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:59:03.486625 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:59:14.032521 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:59:14.032582 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:59:14.032625 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221954.032, Z:100, E:1 F:0]
06/17/09 01:59:14.032723 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:59:14.032775 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:59:24.588636 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:59:24.588786 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:59:24.588844 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221964.589, Z:100, E:1 F:0]
06/17/09 01:59:24.588926 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:59:24.588975 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:59:35.140754 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:59:35.140808 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:59:35.140846 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221975.141, Z:100, E:1 F:0]
06/17/09 01:59:35.140925 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:59:35.140973 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:59:45.683873 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:59:45.683930 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:59:45.683967 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221985.684, Z:100, E:1 F:0]
06/17/09 01:59:45.684045 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:59:45.684111 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 01:59:56.223995 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 01:59:56.224049 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 01:59:56.224087 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245221996.224, Z:100, E:1 F:0]
06/17/09 01:59:56.224166 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 01:59:56.224220 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 02:00:06.774110 zms[29329].DB2-zm_monitor.cpp/2917 [Got message, type 1, msg 99]
06/17/09 02:00:06.774165 zms[29329].DB1-zm_monitor.cpp/3123 [Got QUERY command, sending STATUS]
06/17/09 02:00:06.774201 zms[29329].DB2-zm_monitor.cpp/3171 [L:0, D:0, P:0, R:100, d:1245222006.774, Z:100, E:1 F:0]
06/17/09 02:00:06.774282 zms[29329].DB3-zm_stream.cpp/58 [FPS:0.00, MXFPS:5, BFPS:0, EFPS:0, FM:1]
06/17/09 02:00:06.774331 zms[29329].DB3-zm_stream.cpp/65 [aEFPS:0, aFM:1]
06/17/09 02:01:34.027992 zms[29329].INF-zm_signal.cpp/43 [Got signal 15 (Terminated), exiting]
06/17/09 02:01:34.028180 zms[29329].DB1-zm_monitor.cpp/3550 [Cleaning swap files from /tmp/zmswap-m3/zmswap-q806498]
06/17/09 02:01:34.028364 zms[29329].DB1-zm_monitor.cpp/3578 [Can't glob '/tmp/zmswap-m3/zmswap-q806498/*.*': 3]
The shmmax and shmall are at their maximum already.

Please help
KeithB
Posts: 77
Joined: Thu Jun 07, 2007 4:23 pm
Location: uk

Re: shared memory problem

Post by KeithB »

izghitu wrote:Hi,


[root@secure ~]# sysctl -a | grep shmmax
kernel.shmmax = 4294967294
[root@secure ~]# sysctl -a | grep shmall
kernel.shmall = 4294967294

How do I fix this? Please help
I dont know whether these values are causing your problem but they are certainly wrong. Assuming you have 4GB try these values:
shmmax = 130000000
shmall = 1048000
KeithB
Posts: 77
Joined: Thu Jun 07, 2007 4:23 pm
Location: uk

Post by KeithB »

Actualy if your linux is 32bit the shmall should probably be something like 786000.
izghitu
Posts: 5
Joined: Tue Jun 16, 2009 5:28 am

Post by izghitu »

it looks like it did the trick

I'll test it for a while and let you know

Thanks a lot
izghitu
Posts: 5
Joined: Tue Jun 16, 2009 5:28 am

Post by izghitu »

ok, after some time it's throwing the errors again and I can see a black screen when trying to view the camera

please help
KeithB
Posts: 77
Joined: Thu Jun 07, 2007 4:23 pm
Location: uk

Post by KeithB »

Can you narrow it down to which camera is causing this? Maybe see what happens with a lower frame rate. The frame rate should be set on the camera not on Zoneminder; Zoneminder should have the fps set at higher value than the fps at which the camera is serving.
izghitu
Posts: 5
Joined: Tue Jun 16, 2009 5:28 am

Post by izghitu »

Ok, after more testing I found out that when both cameras are added, the one that is added the latest does not work and throws the shared memory errors.

If I add the dlink camera 2 times then both work fine.

Another problem is that after running the camera for a while, apache reaches its MaxClients limit and everything freezes until I restart apache.

Please help.
Locked