{"action":"created","issue":{"url":"https://api.github.com/repos/Snaipe/Criterion/issues/161","repository_url":"https://api.github.com/repos/Snaipe/Criterion","labels_url":"https://api.github.com/repos/Snaipe/Criterion/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/Snaipe/Criterion/issues/161/comments","events_url":"https://api.github.com/repos/Snaipe/Criterion/issues/161/events","html_url":"https://github.com/Snaipe/Criterion/pull/161","id":176539867,"number":161,"title":"section: Fix \"Aborted\" due to too many open files","user":{"login":"kevinoid","id":336433,"avatar_url":"https://avatars.githubusercontent.com/u/336433?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinoid","html_url":"https://github.com/kevinoid","followers_url":"https://api.github.com/users/kevinoid/followers","following_url":"https://api.github.com/users/kevinoid/following{/other_user}","gists_url":"https://api.github.com/users/kevinoid/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinoid/subscriptions","organizations_url":"https://api.github.com/users/kevinoid/orgs","repos_url":"https://api.github.com/users/kevinoid/repos","events_url":"https://api.github.com/users/kevinoid/events{/privacy}","received_events_url":"https://api.github.com/users/kevinoid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-13T03:30:41Z","updated_at":"2016-09-13T04:46:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Snaipe/Criterion/pulls/161","html_url":"https://github.com/Snaipe/Criterion/pull/161","diff_url":"https://github.com/Snaipe/Criterion/pull/161.diff","patch_url":"https://github.com/Snaipe/Criterion/pull/161.patch"},"body":"Running a test binary with many tests and/or assertions, such as the following example:\r\n\r\n```C\r\n#include <criterion/criterion.h>\r\n\r\nTest(suite, test) {\r\n    /* Note:  2000 needs to be above current RLIMIT_NOFILE */\r\n    for (unsigned int i = 0; i < 2000; ++i) {\r\n        cr_assert(1);\r\n    }\r\n}\r\n```\r\n\r\non systems with ELF binaries causes the program to abort, usually in `call_report_hooks_*` due to `open_module_self` returning `0` due to `EMFILE` from [`open`](https://github.com/Snaipe/Criterion/blob/c5bfe03/src/compat/section-elf.c#L71).\r\n\r\nThis PR fixes the issue by calling `close_module` for every successful `open_module_self` call and ensuring that `open_module_self` closes any file descriptors it opens when returning a failure code.\r\n\r\nThanks for considering,\r\nKevin"},"comment":{"url":"https://api.github.com/repos/Snaipe/Criterion/issues/comments/246572534","html_url":"https://github.com/Snaipe/Criterion/pull/161#issuecomment-246572534","issue_url":"https://api.github.com/repos/Snaipe/Criterion/issues/161","id":246572534,"user":{"login":"Snaipe","id":977973,"avatar_url":"https://avatars.githubusercontent.com/u/977973?v=3","gravatar_id":"","url":"https://api.github.com/users/Snaipe","html_url":"https://github.com/Snaipe","followers_url":"https://api.github.com/users/Snaipe/followers","following_url":"https://api.github.com/users/Snaipe/following{/other_user}","gists_url":"https://api.github.com/users/Snaipe/gists{/gist_id}","starred_url":"https://api.github.com/users/Snaipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snaipe/subscriptions","organizations_url":"https://api.github.com/users/Snaipe/orgs","repos_url":"https://api.github.com/users/Snaipe/repos","events_url":"https://api.github.com/users/Snaipe/events{/privacy}","received_events_url":"https://api.github.com/users/Snaipe/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T04:46:37Z","updated_at":"2016-09-13T04:46:37Z","body":"Nice catch! I can't believe I missed that."}}
{"actor":{"display_login":"Snaipe"}}