{"action":"closed","number":7518,"pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/7518","id":231636166,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNjM2MTY2","html_url":"https://github.com/kripken/emscripten/pull/7518","diff_url":"https://github.com/kripken/emscripten/pull/7518.diff","patch_url":"https://github.com/kripken/emscripten/pull/7518.patch","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/7518","number":7518,"state":"closed","locked":false,"title":"ldso: dlopen could allocate a handle that was already in use","user":{"login":"navytux","id":1794248,"node_id":"MDQ6VXNlcjE3OTQyNDg=","avatar_url":"https://avatars1.githubusercontent.com/u/1794248?v=4","gravatar_id":"","url":"https://api.github.com/users/navytux","html_url":"https://github.com/navytux","followers_url":"https://api.github.com/users/navytux/followers","following_url":"https://api.github.com/users/navytux/following{/other_user}","gists_url":"https://api.github.com/users/navytux/gists{/gist_id}","starred_url":"https://api.github.com/users/navytux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navytux/subscriptions","organizations_url":"https://api.github.com/users/navytux/orgs","repos_url":"https://api.github.com/users/navytux/repos","events_url":"https://api.github.com/users/navytux/events{/privacy}","received_events_url":"https://api.github.com/users/navytux/received_events","type":"User","site_admin":false},"body":"Currently dlopen allocates DSO handles by iterating loaded libraries\r\nwhile counting them from 1. This would work if libraries would be never\r\nunloaded, but it breaks in the presense of dlcose, e.g.:\r\n\r\n\tdlopen('A') -> 1\r\n\tdlopen('B') -> 2\r\n\tdlopen('C') -> 3\r\n\tdlclose('A') ; 1 is deleted from loadedLibs\r\n\tdlopen('D') : should be either 1 or 4 but it gives 3, thus erroneously overwriting C.\r\n\r\nFix it by always using simply incrementing integer for next allocated\r\nhandle.\r\n\r\nSuggested-by: @sbc100","created_at":"2018-11-16T19:44:26Z","updated_at":"2018-11-17T17:56:54Z","closed_at":"2018-11-17T17:56:54Z","merged_at":"2018-11-17T17:56:54Z","merge_commit_sha":"b98e4d00d8197a7ab4cf56c6e794555f12a182c6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kripken/emscripten/pulls/7518/commits","review_comments_url":"https://api.github.com/repos/kripken/emscripten/pulls/7518/comments","review_comment_url":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/7518/comments","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/6c8f89615aadac5980cd4cb8e0f8ee0bce6143d5","head":{"label":"navytux:y/ldso-needed.2","ref":"y/ldso-needed.2","sha":"6c8f89615aadac5980cd4cb8e0f8ee0bce6143d5","user":{"login":"navytux","id":1794248,"node_id":"MDQ6VXNlcjE3OTQyNDg=","avatar_url":"https://avatars1.githubusercontent.com/u/1794248?v=4","gravatar_id":"","url":"https://api.github.com/users/navytux","html_url":"https://github.com/navytux","followers_url":"https://api.github.com/users/navytux/followers","following_url":"https://api.github.com/users/navytux/following{/other_user}","gists_url":"https://api.github.com/users/navytux/gists{/gist_id}","starred_url":"https://api.github.com/users/navytux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navytux/subscriptions","organizations_url":"https://api.github.com/users/navytux/orgs","repos_url":"https://api.github.com/users/navytux/repos","events_url":"https://api.github.com/users/navytux/events{/privacy}","received_events_url":"https://api.github.com/users/navytux/received_events","type":"User","site_admin":false},"repo":{"id":157689577,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc2ODk1Nzc=","name":"emscripten","full_name":"navytux/emscripten","private":false,"owner":{"login":"navytux","id":1794248,"node_id":"MDQ6VXNlcjE3OTQyNDg=","avatar_url":"https://avatars1.githubusercontent.com/u/1794248?v=4","gravatar_id":"","url":"https://api.github.com/users/navytux","html_url":"https://github.com/navytux","followers_url":"https://api.github.com/users/navytux/followers","following_url":"https://api.github.com/users/navytux/following{/other_user}","gists_url":"https://api.github.com/users/navytux/gists{/gist_id}","starred_url":"https://api.github.com/users/navytux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navytux/subscriptions","organizations_url":"https://api.github.com/users/navytux/orgs","repos_url":"https://api.github.com/users/navytux/repos","events_url":"https://api.github.com/users/navytux/events{/privacy}","received_events_url":"https://api.github.com/users/navytux/received_events","type":"User","site_admin":false},"html_url":"https://github.com/navytux/emscripten","description":"kirr's emscripten tree","fork":true,"url":"https://api.github.com/repos/navytux/emscripten","forks_url":"https://api.github.com/repos/navytux/emscripten/forks","keys_url":"https://api.github.com/repos/navytux/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/navytux/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/navytux/emscripten/teams","hooks_url":"https://api.github.com/repos/navytux/emscripten/hooks","issue_events_url":"https://api.github.com/repos/navytux/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/navytux/emscripten/events","assignees_url":"https://api.github.com/repos/navytux/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/navytux/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/navytux/emscripten/tags","blobs_url":"https://api.github.com/repos/navytux/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/navytux/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/navytux/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/navytux/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/navytux/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/navytux/emscripten/languages","stargazers_url":"https://api.github.com/repos/navytux/emscripten/stargazers","contributors_url":"https://api.github.com/repos/navytux/emscripten/contributors","subscribers_url":"https://api.github.com/repos/navytux/emscripten/subscribers","subscription_url":"https://api.github.com/repos/navytux/emscripten/subscription","commits_url":"https://api.github.com/repos/navytux/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/navytux/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/navytux/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/navytux/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/navytux/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/navytux/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/navytux/emscripten/merges","archive_url":"https://api.github.com/repos/navytux/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/navytux/emscripten/downloads","issues_url":"https://api.github.com/repos/navytux/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/navytux/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/navytux/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/navytux/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/navytux/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/navytux/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/navytux/emscripten/deployments","created_at":"2018-11-15T09:58:00Z","updated_at":"2018-11-16T16:59:41Z","pushed_at":"2018-11-16T19:46:42Z","git_url":"git://github.com/navytux/emscripten.git","ssh_url":"git@github.com:navytux/emscripten.git","clone_url":"https://github.com/navytux/emscripten.git","svn_url":"https://github.com/navytux/emscripten","homepage":"https://lab.nexedi.com/kirr/emscripten","size":161898,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"incoming"}},"base":{"label":"kripken:incoming","ref":"incoming","sha":"9646b6b28c180c40659bf9ddd0781fd9b018b555","user":{"login":"kripken","id":173661,"node_id":"MDQ6VXNlcjE3MzY2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"repo":{"id":1357796,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU3Nzk2","name":"emscripten","full_name":"kripken/emscripten","private":false,"owner":{"login":"kripken","id":173661,"node_id":"MDQ6VXNlcjE3MzY2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"html_url":"https://github.com/kripken/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":false,"url":"https://api.github.com/repos/kripken/emscripten","forks_url":"https://api.github.com/repos/kripken/emscripten/forks","keys_url":"https://api.github.com/repos/kripken/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kripken/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kripken/emscripten/teams","hooks_url":"https://api.github.com/repos/kripken/emscripten/hooks","issue_events_url":"https://api.github.com/repos/kripken/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/kripken/emscripten/events","assignees_url":"https://api.github.com/repos/kripken/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/kripken/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/kripken/emscripten/tags","blobs_url":"https://api.github.com/repos/kripken/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kripken/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kripken/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/kripken/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/kripken/emscripten/languages","stargazers_url":"https://api.github.com/repos/kripken/emscripten/stargazers","contributors_url":"https://api.github.com/repos/kripken/emscripten/contributors","subscribers_url":"https://api.github.com/repos/kripken/emscripten/subscribers","subscription_url":"https://api.github.com/repos/kripken/emscripten/subscription","commits_url":"https://api.github.com/repos/kripken/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/kripken/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/kripken/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/kripken/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/kripken/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/kripken/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kripken/emscripten/merges","archive_url":"https://api.github.com/repos/kripken/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kripken/emscripten/downloads","issues_url":"https://api.github.com/repos/kripken/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/kripken/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/kripken/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/kripken/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kripken/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/kripken/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/kripken/emscripten/deployments","created_at":"2011-02-12T05:23:30Z","updated_at":"2018-11-17T17:48:16Z","pushed_at":"2018-11-17T17:56:54Z","git_url":"git://github.com/kripken/emscripten.git","ssh_url":"git@github.com:kripken/emscripten.git","clone_url":"https://github.com/kripken/emscripten.git","svn_url":"https://github.com/kripken/emscripten","homepage":"","size":168587,"stargazers_count":15930,"watchers_count":15930,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1866,"mirror_url":null,"archived":false,"open_issues_count":1599,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1866,"open_issues":1599,"watchers":15930,"default_branch":"incoming"}},"_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/7518"},"html":{"href":"https://github.com/kripken/emscripten/pull/7518"},"issue":{"href":"https://api.github.com/repos/kripken/emscripten/issues/7518"},"comments":{"href":"https://api.github.com/repos/kripken/emscripten/issues/7518/comments"},"review_comments":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/7518/comments"},"review_comment":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/7518/commits"},"statuses":{"href":"https://api.github.com/repos/kripken/emscripten/statuses/6c8f89615aadac5980cd4cb8e0f8ee0bce6143d5"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"sbc100","id":515813,"node_id":"MDQ6VXNlcjUxNTgxMw==","avatar_url":"https://avatars2.githubusercontent.com/u/515813?v=4","gravatar_id":"","url":"https://api.github.com/users/sbc100","html_url":"https://github.com/sbc100","followers_url":"https://api.github.com/users/sbc100/followers","following_url":"https://api.github.com/users/sbc100/following{/other_user}","gists_url":"https://api.github.com/users/sbc100/gists{/gist_id}","starred_url":"https://api.github.com/users/sbc100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbc100/subscriptions","organizations_url":"https://api.github.com/users/sbc100/orgs","repos_url":"https://api.github.com/users/sbc100/repos","events_url":"https://api.github.com/users/sbc100/events{/privacy}","received_events_url":"https://api.github.com/users/sbc100/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":63,"deletions":5,"changed_files":2}}
{"actor":{"display_login":"sbc100"}}