{"action":"closed","issue":{"url":"https://api.github.com/repos/andikleen/mcelog/issues/33","repository_url":"https://api.github.com/repos/andikleen/mcelog","labels_url":"https://api.github.com/repos/andikleen/mcelog/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/andikleen/mcelog/issues/33/comments","events_url":"https://api.github.com/repos/andikleen/mcelog/issues/33/events","html_url":"https://github.com/andikleen/mcelog/issues/33","id":138283799,"number":33,"title":"mcelog hangs in the non-dameon mode when unknown error is encountered ","user":{"login":"srilakshmidj","id":17622701,"avatar_url":"https://avatars.githubusercontent.com/u/17622701?v=3","gravatar_id":"","url":"https://api.github.com/users/srilakshmidj","html_url":"https://github.com/srilakshmidj","followers_url":"https://api.github.com/users/srilakshmidj/followers","following_url":"https://api.github.com/users/srilakshmidj/following{/other_user}","gists_url":"https://api.github.com/users/srilakshmidj/gists{/gist_id}","starred_url":"https://api.github.com/users/srilakshmidj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srilakshmidj/subscriptions","organizations_url":"https://api.github.com/users/srilakshmidj/orgs","repos_url":"https://api.github.com/users/srilakshmidj/repos","events_url":"https://api.github.com/users/srilakshmidj/events{/privacy}","received_events_url":"https://api.github.com/users/srilakshmidj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-03T20:07:03Z","updated_at":"2016-05-01T02:39:06Z","closed_at":"2016-05-01T02:39:06Z","body":"In the non-daemon mode, when the child processes exit the SIGCHLD\r\nis being read off the queue, but the child handler is not called,\r\nand the num_children is not decremented. This leads to the process\r\nhanging in trigger_wait() function in an infinite loop waiting for\r\nSIGCHLD signals that never arrive - (sigwait(&mask, &sig)).\r\n\r\nThis behaviour was discovered when the mcelog tried to process an\r\nunknown error on a machine, and created child processes. The parent\r\nprocess never exited. Since mcelog was run by a cron task every x\r\nminutes, numerous hung-mcelog processes accumulated whenever it hit\r\nthe unknown-error-trigger.\r\n\r\nSample error lines:\r\nmcelog: Running trigger unknown-error-trigger' mcelog: Running triggerunknown-error-trigger'\r\nmcelog: CPU 5 on socket 0 received unknown error\r\nmcelog: CPU 5 on socket 0 received unknown error\r\n\r\nThe fix is to call waitpid() to reap the exit status of all terminating\r\nchildren, calling finish_child() for each. This fix has been tested\r\non the machine the issue was discovered on.\r\n\r\nsrilakshmidj-patch-1 on branch  srilakshmidj/mcelog fixes the problem.\r\n\r\nSigned-off-by: Tim Bingham tbingham@akamai.com\r\nSigned-off-by: Sri Jayaramappa sjayaram@akamai.com\r\n"}}