{"action":"created","issue":{"url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/507","labels_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/507/labels{/name}","comments_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/507/comments","events_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/507/events","html_url":"https://github.com/ZoneMinder/ZoneMinder/issues/507","id":40789524,"number":507,"title":"Shared data not initialised by capture daemon","user":{"login":"Konstigt","id":206136,"avatar_url":"https://avatars.githubusercontent.com/u/206136?v=3","gravatar_id":"","url":"https://api.github.com/users/Konstigt","html_url":"https://github.com/Konstigt","followers_url":"https://api.github.com/users/Konstigt/followers","following_url":"https://api.github.com/users/Konstigt/following{/other_user}","gists_url":"https://api.github.com/users/Konstigt/gists{/gist_id}","starred_url":"https://api.github.com/users/Konstigt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Konstigt/subscriptions","organizations_url":"https://api.github.com/users/Konstigt/orgs","repos_url":"https://api.github.com/users/Konstigt/repos","events_url":"https://api.github.com/users/Konstigt/events{/privacy}","received_events_url":"https://api.github.com/users/Konstigt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-08-21T10:02:02Z","updated_at":"2015-08-04T00:35:49Z","closed_at":null,"body":"I get this a lot when using the web gui, not otherwise. If I'm active in the gui, motion detect recording does not work. If I leave the gui, there are no more of these errors and the system functions just fine. I'm 99% certain it works this way.\r\n\r\nAug 20 15:50:43 stik zms[22402]: INF [Authenticated user 'admin']\r\nAug 20 15:50:43 stik zms[22402]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]\r\nAug 20 15:50:47 stik zms[22402]: INF [Got signal 15 (Terminated), exiting]\r\nAug 20 15:50:50 stik zms[22006]: INF [Got signal 15 (Terminated), exiting]\r\nAug 20 15:50:50 stik zms[22006]: ERR [Unable to send stream frame: Broken pipe]\r\n\r\n$ ipcs  -l\r\n\r\n------ Shared Memory Limits --------\r\nmax number of segments = 4096\r\nmax seg size (kbytes) = 1041866\r\nmax total shared memory (kbytes) = 4267483648\r\nmin seg size (bytes) = 1\r\n\r\n------ Semaphore Limits --------\r\nmax number of arrays = 128\r\nmax semaphores per array = 250\r\nmax semaphores system wide = 32000\r\nmax ops per semop call = 32\r\nsemaphore max value = 32767\r\n\r\n------ Messages Limits --------\r\nmax queues system wide = 1652\r\nmax size of message (bytes) = 8192\r\ndefault max size of queue (bytes) = 16384\r\n\r\n$ ls -la /dev/shm/zm.mmap.1 \r\n-rw------- 1 www-data www-data 59444560 aug 21 11:38 /dev/shm/zm.mmap.1\r\n\r\n$ apt-cache policy zoneminder\r\nzoneminder:\r\n  Installed: 1.27.99+1-trusty-SNAPSHOT2014080402\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3960996-shared-data-not-initialised-by-capture-daemon?utm_campaign=plugin&utm_content=tracker%2F188329&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F188329&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/comments/127441623","html_url":"https://github.com/ZoneMinder/ZoneMinder/issues/507#issuecomment-127441623","issue_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/507","id":127441623,"user":{"login":"Linwood-F","id":13143855,"avatar_url":"https://avatars.githubusercontent.com/u/13143855?v=3","gravatar_id":"","url":"https://api.github.com/users/Linwood-F","html_url":"https://github.com/Linwood-F","followers_url":"https://api.github.com/users/Linwood-F/followers","following_url":"https://api.github.com/users/Linwood-F/following{/other_user}","gists_url":"https://api.github.com/users/Linwood-F/gists{/gist_id}","starred_url":"https://api.github.com/users/Linwood-F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Linwood-F/subscriptions","organizations_url":"https://api.github.com/users/Linwood-F/orgs","repos_url":"https://api.github.com/users/Linwood-F/repos","events_url":"https://api.github.com/users/Linwood-F/events{/privacy}","received_events_url":"https://api.github.com/users/Linwood-F/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T00:35:49Z","updated_at":"2015-08-04T00:35:49Z","body":"I did some research on this, specifically on the warning that ends \"some query functions may not be available\", and I think the reason quoted (zmc is not running) may not be correct in this case.\r\n\r\nIn zm_monitor (where this is issued), around line 374, mem_ptr is initialized to NULL.  Immediately following there are sections of code for CAPTURE and ANALYSIS, but nothing for QUERY.  Immediately following the (skipped for QUERY) ANALYSIS section is the test which generates this error, with a flavor for non-QUERY, and one for QUERY.\r\n\r\nThe one for QUERY is the one that says \"some query functions may not be available\".   It appears to be simply impossible to get to this point with anything but a null mem_ptr, which then generates the error.\r\n\r\nI think this message is bogus at this point. After the warning it falls through and continues to run fine, at least when called from ZMS which is where I am mostly getting this specific error.\r\n\r\nI did not research the other flavor (non-QUERY) version which ends at the monitor name, no \"some query functions\". \r\n\r\nI did not research every possible path that might call this to see if some other level of initialization perhaps should (sometimes) occur for a QUERY purpose here, but as written I see no path for purpose=QUERY that can avoid giving this error.  And it appears to work properly (otherwise a SINGLE frame from ZMS would not work.\r\n\r\nI did ensure that ZMC was running in all cases that gave this message.  Perhaps that ZMC not running issue relates to the non-purpose=QUERY function.\r\n\r\nPerhaps I am missing something but I am going to throw a pull request out to make this just go away, and at least perhaps spur discussion."}}