{"action":"opened","number":4469,"pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/4469","id":80381651,"html_url":"https://github.com/kripken/emscripten/pull/4469","diff_url":"https://github.com/kripken/emscripten/pull/4469.diff","patch_url":"https://github.com/kripken/emscripten/pull/4469.patch","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/4469","number":4469,"state":"open","locked":false,"title":"Fix sbrk bug","user":{"login":"aheejin","id":8726997,"avatar_url":"https://avatars.githubusercontent.com/u/8726997?v=3","gravatar_id":"","url":"https://api.github.com/users/aheejin","html_url":"https://github.com/aheejin","followers_url":"https://api.github.com/users/aheejin/followers","following_url":"https://api.github.com/users/aheejin/following{/other_user}","gists_url":"https://api.github.com/users/aheejin/gists{/gist_id}","starred_url":"https://api.github.com/users/aheejin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aheejin/subscriptions","organizations_url":"https://api.github.com/users/aheejin/orgs","repos_url":"https://api.github.com/users/aheejin/repos","events_url":"https://api.github.com/users/aheejin/events{/privacy}","received_events_url":"https://api.github.com/users/aheejin/received_events","type":"User","site_admin":false},"body":"In function _sbrk, it sets Runtime.dynamicAlloc function to some error\r\nfunction to prevent reentrance. But it does not set Runtime.dynamicAlloc\r\nto the original dynamicAlloc function anywhere. So, effectively, once\r\n_sbrk is called, we cannot call _malloc ever again, because _malloc\r\ncalls Runtime.dynamicAlloc.\r\n\r\nIn asm.js, this problem did not appear because there are two _malloc\r\nfunctions in the resulting js code, where one is _malloc from library.js\r\nand the other is _malloc compiled from libc. And all calls to _malloc\r\ncalled the version in libc, which does not call Runtime.dynamicAlloc.\r\n\r\nBut in WebAssembly, some functions in js code (like\r\n___cxa_find_matching_catch) calls _malloc and this calls _malloc in\r\nlibrary.js, because there is no other _malloc in this case.\r\nSo this fails:\r\n_sbrk(N);\r\n_malloc(M);\r\nwhere N and M is any number.","created_at":"2016-08-07T23:41:26Z","updated_at":"2016-08-07T23:41:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kripken/emscripten/pulls/4469/commits","review_comments_url":"https://api.github.com/repos/kripken/emscripten/pulls/4469/comments","review_comment_url":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/4469/comments","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/ce91a2864b5c554f9235e92924e00b11218215e6","head":{"label":"aheejin:sbrk-bugfix","ref":"sbrk-bugfix","sha":"ce91a2864b5c554f9235e92924e00b11218215e6","user":{"login":"aheejin","id":8726997,"avatar_url":"https://avatars.githubusercontent.com/u/8726997?v=3","gravatar_id":"","url":"https://api.github.com/users/aheejin","html_url":"https://github.com/aheejin","followers_url":"https://api.github.com/users/aheejin/followers","following_url":"https://api.github.com/users/aheejin/following{/other_user}","gists_url":"https://api.github.com/users/aheejin/gists{/gist_id}","starred_url":"https://api.github.com/users/aheejin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aheejin/subscriptions","organizations_url":"https://api.github.com/users/aheejin/orgs","repos_url":"https://api.github.com/users/aheejin/repos","events_url":"https://api.github.com/users/aheejin/events{/privacy}","received_events_url":"https://api.github.com/users/aheejin/received_events","type":"User","site_admin":false},"repo":{"id":64959959,"name":"emscripten","full_name":"aheejin/emscripten","owner":{"login":"aheejin","id":8726997,"avatar_url":"https://avatars.githubusercontent.com/u/8726997?v=3","gravatar_id":"","url":"https://api.github.com/users/aheejin","html_url":"https://github.com/aheejin","followers_url":"https://api.github.com/users/aheejin/followers","following_url":"https://api.github.com/users/aheejin/following{/other_user}","gists_url":"https://api.github.com/users/aheejin/gists{/gist_id}","starred_url":"https://api.github.com/users/aheejin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aheejin/subscriptions","organizations_url":"https://api.github.com/users/aheejin/orgs","repos_url":"https://api.github.com/users/aheejin/repos","events_url":"https://api.github.com/users/aheejin/events{/privacy}","received_events_url":"https://api.github.com/users/aheejin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aheejin/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":true,"url":"https://api.github.com/repos/aheejin/emscripten","forks_url":"https://api.github.com/repos/aheejin/emscripten/forks","keys_url":"https://api.github.com/repos/aheejin/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aheejin/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aheejin/emscripten/teams","hooks_url":"https://api.github.com/repos/aheejin/emscripten/hooks","issue_events_url":"https://api.github.com/repos/aheejin/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/aheejin/emscripten/events","assignees_url":"https://api.github.com/repos/aheejin/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/aheejin/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/aheejin/emscripten/tags","blobs_url":"https://api.github.com/repos/aheejin/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aheejin/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aheejin/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/aheejin/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aheejin/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/aheejin/emscripten/languages","stargazers_url":"https://api.github.com/repos/aheejin/emscripten/stargazers","contributors_url":"https://api.github.com/repos/aheejin/emscripten/contributors","subscribers_url":"https://api.github.com/repos/aheejin/emscripten/subscribers","subscription_url":"https://api.github.com/repos/aheejin/emscripten/subscription","commits_url":"https://api.github.com/repos/aheejin/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/aheejin/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/aheejin/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/aheejin/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/aheejin/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/aheejin/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aheejin/emscripten/merges","archive_url":"https://api.github.com/repos/aheejin/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aheejin/emscripten/downloads","issues_url":"https://api.github.com/repos/aheejin/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/aheejin/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/aheejin/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/aheejin/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aheejin/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/aheejin/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/aheejin/emscripten/deployments","created_at":"2016-08-04T18:59:46Z","updated_at":"2016-08-04T19:00:08Z","pushed_at":"2016-08-07T23:35:39Z","git_url":"git://github.com/aheejin/emscripten.git","ssh_url":"git@github.com:aheejin/emscripten.git","clone_url":"https://github.com/aheejin/emscripten.git","svn_url":"https://github.com/aheejin/emscripten","homepage":"","size":171221,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"incoming"}},"base":{"label":"kripken:incoming","ref":"incoming","sha":"a3cb6ee64c79eb0bbccb1611dab6ee029389b41d","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","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,"name":"emscripten","full_name":"kripken/emscripten","owner":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","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},"private":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":"2016-08-07T17:02:26Z","pushed_at":"2016-08-07T23:37:21Z","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":172851,"stargazers_count":10477,"watchers_count":10477,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1293,"mirror_url":null,"open_issues_count":833,"forks":1293,"open_issues":833,"watchers":10477,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/4469"},"html":{"href":"https://github.com/kripken/emscripten/pull/4469"},"issue":{"href":"https://api.github.com/repos/kripken/emscripten/issues/4469"},"comments":{"href":"https://api.github.com/repos/kripken/emscripten/issues/4469/comments"},"review_comments":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/4469/comments"},"review_comment":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/4469/commits"},"statuses":{"href":"https://api.github.com/repos/kripken/emscripten/statuses/ce91a2864b5c554f9235e92924e00b11218215e6"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":13,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"aheejin"}}