{"action":"opened","issue":{"url":"https://api.github.com/repos/collectd/collectd/issues/2032","repository_url":"https://api.github.com/repos/collectd/collectd","labels_url":"https://api.github.com/repos/collectd/collectd/issues/2032/labels{/name}","comments_url":"https://api.github.com/repos/collectd/collectd/issues/2032/comments","events_url":"https://api.github.com/repos/collectd/collectd/issues/2032/events","html_url":"https://github.com/collectd/collectd/issues/2032","id":188071872,"number":2032,"title":"Deadlock at startup with Exec","user":{"login":"craigmiskell","id":6476019,"avatar_url":"https://avatars.githubusercontent.com/u/6476019?v=3","gravatar_id":"","url":"https://api.github.com/users/craigmiskell","html_url":"https://github.com/craigmiskell","followers_url":"https://api.github.com/users/craigmiskell/followers","following_url":"https://api.github.com/users/craigmiskell/following{/other_user}","gists_url":"https://api.github.com/users/craigmiskell/gists{/gist_id}","starred_url":"https://api.github.com/users/craigmiskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigmiskell/subscriptions","organizations_url":"https://api.github.com/users/craigmiskell/orgs","repos_url":"https://api.github.com/users/craigmiskell/repos","events_url":"https://api.github.com/users/craigmiskell/events{/privacy}","received_events_url":"https://api.github.com/users/craigmiskell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-08T18:46:12Z","updated_at":"2016-11-08T18:46:12Z","closed_at":null,"body":"*   Version of collectd: 5.4.0-3ubuntu2.2\r\n*   Operating system / distribution: Ubuntu, Trusty (14.04)\r\n\r\n## Expected behavior\r\nAt startup, all exec plugins begin executing\r\n\r\n## Actual behavior\r\nIntermittently, some will *not* startup; in addition to the main process there will be one or more \"collectd -C /etc/collectd/collectd.conf -f\" child processes running, still as root, stalled.  Attaching with gdb and getting a backtrace from the stuck to-be-exec's gives:\r\n#0  0x00007f1611faff1c in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0\r\n#1  0x00007f1611fab649 in _L_lock_909 () from /lib/x86_64-linux-gnu/libpthread.so.0\r\n#2  0x00007f1611fab470 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0\r\n#3  0x00007f160e6b0e23 in ?? () from /usr/lib/x86_64-linux-gnu/libp11-kit.so.0\r\n#4  0x00007f1611a92fff in fork () from /lib/x86_64-linux-gnu/libc.so.6\r\n#5  0x00007f160b81b7a9 in ?? () from /usr/lib/collectd/exec.so\r\n#6  0x00007f160b81c048 in ?? () from /usr/lib/collectd/exec.so\r\n#7  0x00007f1611fa9184 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0\r\n#8  0x00007f1611acc37d in clone () from /lib/x86_64-linux-gnu/libc.so.6\r\n\r\nindicating a deadlock in the fork, caused by whatever libp11-kit is locking on.  Killing (-9) the child process has always (so far) resulted in the exec plugin promptly starting correctly.  \r\n\r\n## Steps to reproduce\r\n\r\n*   Have at least two Exec plugins (not observed anywhere with only one, but that may be irrelevant)\r\n*   Restart collectd (a few times)\r\n*   Observe stuck processes.\r\n\r\nI'm working through the code but nothing is jumping out at me yet.  I'm also at a loss to know why libp11-kit is getting involved at all except as some implicit dependency of libgnutls.  I rather suspect if I could convince libp11 not to be involved the problem would go away.\r\n"}}
{"actor":{"display_login":"craigmiskell"}}