{"action":"created","issue":{"url":"https://api.github.com/repos/grobian/carbon-c-relay/issues/188","repository_url":"https://api.github.com/repos/grobian/carbon-c-relay","labels_url":"https://api.github.com/repos/grobian/carbon-c-relay/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/grobian/carbon-c-relay/issues/188/comments","events_url":"https://api.github.com/repos/grobian/carbon-c-relay/issues/188/events","html_url":"https://github.com/grobian/carbon-c-relay/issues/188","id":161656220,"number":188,"title":"SIGHUP leads to SIGSEGV","user":{"login":"redbaron","id":16624,"avatar_url":"https://avatars.githubusercontent.com/u/16624?v=3","gravatar_id":"","url":"https://api.github.com/users/redbaron","html_url":"https://github.com/redbaron","followers_url":"https://api.github.com/users/redbaron/followers","following_url":"https://api.github.com/users/redbaron/following{/other_user}","gists_url":"https://api.github.com/users/redbaron/gists{/gist_id}","starred_url":"https://api.github.com/users/redbaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redbaron/subscriptions","organizations_url":"https://api.github.com/users/redbaron/orgs","repos_url":"https://api.github.com/users/redbaron/repos","events_url":"https://api.github.com/users/redbaron/events{/privacy}","received_events_url":"https://api.github.com/users/redbaron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-06-22T11:22:33Z","updated_at":"2016-06-22T15:13:23Z","closed_at":null,"body":"Idling carbon-c-relay with no incoming traffic crashes with `SIGSEGV`when SIGHUP is sent.\r\n\r\nUsing config:\r\n\r\n```\r\nconfiguration:\r\n    relay hostname = 4b8605089887\r\n    listen port = 2004\r\n    workers = 4\r\n    send batch size = 2500\r\n    server queue size = 25000\r\n    server max stalls = 4\r\n    statistics submission interval = 60s\r\n    listen backlog = 512\r\n    server connection IO timeout = 600ms\r\n    daemon = true\r\n    routes configuration = /etc/carbon-c-relay.conf\r\n\r\nparsed configuration follows:\r\ncluster covalent\r\n    fnv1a_ch replication 1\r\n        4b8605089887:2003\r\n    ;\r\n\r\nmatch *\r\n    send to covalent\r\n    stop\r\n    ;\r\n```\r\n\r\nI noticed that whole handling logic is done right inside in handler. realistically it can never  be done right, ther would always be unexpected race conditions, non-reetrant functions called etc, simply because signal handler can be called in the middle of _any_ function, even deep down in glibc.\r\n\r\nWhat signal handlers should do is set global flag and then exit. main loop in a program should check for flag and invoke actual handling logic.More details on recommended practices of signal handling can be found here: \r\nhttps://www.gnu.org/software/libc/manual/html_node/Nonreentrancy.html#Nonreentrancy"},"comment":{"url":"https://api.github.com/repos/grobian/carbon-c-relay/issues/comments/227776141","html_url":"https://github.com/grobian/carbon-c-relay/issues/188#issuecomment-227776141","issue_url":"https://api.github.com/repos/grobian/carbon-c-relay/issues/188","id":227776141,"user":{"login":"Civil","id":844380,"avatar_url":"https://avatars.githubusercontent.com/u/844380?v=3","gravatar_id":"","url":"https://api.github.com/users/Civil","html_url":"https://github.com/Civil","followers_url":"https://api.github.com/users/Civil/followers","following_url":"https://api.github.com/users/Civil/following{/other_user}","gists_url":"https://api.github.com/users/Civil/gists{/gist_id}","starred_url":"https://api.github.com/users/Civil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Civil/subscriptions","organizations_url":"https://api.github.com/users/Civil/orgs","repos_url":"https://api.github.com/users/Civil/repos","events_url":"https://api.github.com/users/Civil/events{/privacy}","received_events_url":"https://api.github.com/users/Civil/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T15:13:23Z","updated_at":"2016-06-22T15:13:23Z","body":"@redbaron can you check if the same stuff happens if my commit (in my fork) is applied?"}}
{"actor":{"display_login":"Civil"}}