{"action":"closed","number":266,"pull_request":{"url":"https://api.github.com/repos/USCiLab/cereal/pulls/266","id":62085601,"html_url":"https://github.com/USCiLab/cereal/pull/266","diff_url":"https://github.com/USCiLab/cereal/pull/266.diff","patch_url":"https://github.com/USCiLab/cereal/pull/266.patch","issue_url":"https://api.github.com/repos/USCiLab/cereal/issues/266","number":266,"state":"closed","locked":false,"title":"Fix memory leak due to alloc-free size mismatch","user":{"login":"tdudziak","id":458600,"avatar_url":"https://avatars.githubusercontent.com/u/458600?v=3","gravatar_id":"","url":"https://api.github.com/users/tdudziak","html_url":"https://github.com/tdudziak","followers_url":"https://api.github.com/users/tdudziak/followers","following_url":"https://api.github.com/users/tdudziak/following{/other_user}","gists_url":"https://api.github.com/users/tdudziak/gists{/gist_id}","starred_url":"https://api.github.com/users/tdudziak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdudziak/subscriptions","organizations_url":"https://api.github.com/users/tdudziak/orgs","repos_url":"https://api.github.com/users/tdudziak/repos","events_url":"https://api.github.com/users/tdudziak/events{/privacy}","received_events_url":"https://api.github.com/users/tdudziak/received_events","type":"User","site_admin":false},"body":"That fixes a memory bug I found while running my cereal-using code with [AddressSanitizer](https://github.com/google/sanitizers). I would add a testcase but the error seems to appear only with AddressSanitizer (Valgrind doesn't report it).\r\n\r\n[Here](https://gist.github.com/tdudziak/8694e47444c47a26f516) is a simple program and the output it produces when compiled with clang with `-fsanitize=address`. The problem is basically that `aligned_storage<sizeof(T)>` uses default alignment (which might be different from `T`'s alignment) and thus might add additional padding.\r\n\r\nThis is most likely not a big deal and I don't think it actually leaks this extra memory but technically it relies on undefined behavior (I think) and it might annoy users of the library that test their code with AddressSanitizer.","created_at":"2016-03-08T15:20:57Z","updated_at":"2016-03-09T22:28:25Z","closed_at":"2016-03-09T22:28:25Z","merged_at":"2016-03-09T22:28:25Z","merge_commit_sha":"fc47665974c324ec6aa64dec75c5b06b8ad63472","assignee":null,"milestone":{"url":"https://api.github.com/repos/USCiLab/cereal/milestones/5","html_url":"https://github.com/USCiLab/cereal/milestones/v1.2.0","labels_url":"https://api.github.com/repos/USCiLab/cereal/milestones/5/labels","id":634032,"number":5,"title":"v1.2.0","description":"","creator":{"login":"AzothAmmo","id":1634639,"avatar_url":"https://avatars.githubusercontent.com/u/1634639?v=3","gravatar_id":"","url":"https://api.github.com/users/AzothAmmo","html_url":"https://github.com/AzothAmmo","followers_url":"https://api.github.com/users/AzothAmmo/followers","following_url":"https://api.github.com/users/AzothAmmo/following{/other_user}","gists_url":"https://api.github.com/users/AzothAmmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AzothAmmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzothAmmo/subscriptions","organizations_url":"https://api.github.com/users/AzothAmmo/orgs","repos_url":"https://api.github.com/users/AzothAmmo/repos","events_url":"https://api.github.com/users/AzothAmmo/events{/privacy}","received_events_url":"https://api.github.com/users/AzothAmmo/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":27,"state":"open","created_at":"2014-04-18T17:13:10Z","updated_at":"2016-03-09T22:28:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/USCiLab/cereal/pulls/266/commits","review_comments_url":"https://api.github.com/repos/USCiLab/cereal/pulls/266/comments","review_comment_url":"https://api.github.com/repos/USCiLab/cereal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/USCiLab/cereal/issues/266/comments","statuses_url":"https://api.github.com/repos/USCiLab/cereal/statuses/10b967c74beb2d0f011b1bf509964d42287e0aa9","head":{"label":"tdudziak:develop","ref":"develop","sha":"10b967c74beb2d0f011b1bf509964d42287e0aa9","user":{"login":"tdudziak","id":458600,"avatar_url":"https://avatars.githubusercontent.com/u/458600?v=3","gravatar_id":"","url":"https://api.github.com/users/tdudziak","html_url":"https://github.com/tdudziak","followers_url":"https://api.github.com/users/tdudziak/followers","following_url":"https://api.github.com/users/tdudziak/following{/other_user}","gists_url":"https://api.github.com/users/tdudziak/gists{/gist_id}","starred_url":"https://api.github.com/users/tdudziak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdudziak/subscriptions","organizations_url":"https://api.github.com/users/tdudziak/orgs","repos_url":"https://api.github.com/users/tdudziak/repos","events_url":"https://api.github.com/users/tdudziak/events{/privacy}","received_events_url":"https://api.github.com/users/tdudziak/received_events","type":"User","site_admin":false},"repo":{"id":53419500,"name":"cereal","full_name":"tdudziak/cereal","owner":{"login":"tdudziak","id":458600,"avatar_url":"https://avatars.githubusercontent.com/u/458600?v=3","gravatar_id":"","url":"https://api.github.com/users/tdudziak","html_url":"https://github.com/tdudziak","followers_url":"https://api.github.com/users/tdudziak/followers","following_url":"https://api.github.com/users/tdudziak/following{/other_user}","gists_url":"https://api.github.com/users/tdudziak/gists{/gist_id}","starred_url":"https://api.github.com/users/tdudziak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdudziak/subscriptions","organizations_url":"https://api.github.com/users/tdudziak/orgs","repos_url":"https://api.github.com/users/tdudziak/repos","events_url":"https://api.github.com/users/tdudziak/events{/privacy}","received_events_url":"https://api.github.com/users/tdudziak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tdudziak/cereal","description":"A C++11 library for serialization","fork":true,"url":"https://api.github.com/repos/tdudziak/cereal","forks_url":"https://api.github.com/repos/tdudziak/cereal/forks","keys_url":"https://api.github.com/repos/tdudziak/cereal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tdudziak/cereal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tdudziak/cereal/teams","hooks_url":"https://api.github.com/repos/tdudziak/cereal/hooks","issue_events_url":"https://api.github.com/repos/tdudziak/cereal/issues/events{/number}","events_url":"https://api.github.com/repos/tdudziak/cereal/events","assignees_url":"https://api.github.com/repos/tdudziak/cereal/assignees{/user}","branches_url":"https://api.github.com/repos/tdudziak/cereal/branches{/branch}","tags_url":"https://api.github.com/repos/tdudziak/cereal/tags","blobs_url":"https://api.github.com/repos/tdudziak/cereal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tdudziak/cereal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tdudziak/cereal/git/refs{/sha}","trees_url":"https://api.github.com/repos/tdudziak/cereal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tdudziak/cereal/statuses/{sha}","languages_url":"https://api.github.com/repos/tdudziak/cereal/languages","stargazers_url":"https://api.github.com/repos/tdudziak/cereal/stargazers","contributors_url":"https://api.github.com/repos/tdudziak/cereal/contributors","subscribers_url":"https://api.github.com/repos/tdudziak/cereal/subscribers","subscription_url":"https://api.github.com/repos/tdudziak/cereal/subscription","commits_url":"https://api.github.com/repos/tdudziak/cereal/commits{/sha}","git_commits_url":"https://api.github.com/repos/tdudziak/cereal/git/commits{/sha}","comments_url":"https://api.github.com/repos/tdudziak/cereal/comments{/number}","issue_comment_url":"https://api.github.com/repos/tdudziak/cereal/issues/comments{/number}","contents_url":"https://api.github.com/repos/tdudziak/cereal/contents/{+path}","compare_url":"https://api.github.com/repos/tdudziak/cereal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tdudziak/cereal/merges","archive_url":"https://api.github.com/repos/tdudziak/cereal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tdudziak/cereal/downloads","issues_url":"https://api.github.com/repos/tdudziak/cereal/issues{/number}","pulls_url":"https://api.github.com/repos/tdudziak/cereal/pulls{/number}","milestones_url":"https://api.github.com/repos/tdudziak/cereal/milestones{/number}","notifications_url":"https://api.github.com/repos/tdudziak/cereal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tdudziak/cereal/labels{/name}","releases_url":"https://api.github.com/repos/tdudziak/cereal/releases{/id}","deployments_url":"https://api.github.com/repos/tdudziak/cereal/deployments","created_at":"2016-03-08T14:41:10Z","updated_at":"2016-03-08T14:41:11Z","pushed_at":"2016-03-08T14:48:43Z","git_url":"git://github.com/tdudziak/cereal.git","ssh_url":"git@github.com:tdudziak/cereal.git","clone_url":"https://github.com/tdudziak/cereal.git","svn_url":"https://github.com/tdudziak/cereal","homepage":null,"size":10366,"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":"master"}},"base":{"label":"USCiLab:develop","ref":"develop","sha":"8db68d25bd3e95223f05d5315fa3b7fef0261995","user":{"login":"USCiLab","id":1634585,"avatar_url":"https://avatars.githubusercontent.com/u/1634585?v=3","gravatar_id":"","url":"https://api.github.com/users/USCiLab","html_url":"https://github.com/USCiLab","followers_url":"https://api.github.com/users/USCiLab/followers","following_url":"https://api.github.com/users/USCiLab/following{/other_user}","gists_url":"https://api.github.com/users/USCiLab/gists{/gist_id}","starred_url":"https://api.github.com/users/USCiLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USCiLab/subscriptions","organizations_url":"https://api.github.com/users/USCiLab/orgs","repos_url":"https://api.github.com/users/USCiLab/repos","events_url":"https://api.github.com/users/USCiLab/events{/privacy}","received_events_url":"https://api.github.com/users/USCiLab/received_events","type":"Organization","site_admin":false},"repo":{"id":10952997,"name":"cereal","full_name":"USCiLab/cereal","owner":{"login":"USCiLab","id":1634585,"avatar_url":"https://avatars.githubusercontent.com/u/1634585?v=3","gravatar_id":"","url":"https://api.github.com/users/USCiLab","html_url":"https://github.com/USCiLab","followers_url":"https://api.github.com/users/USCiLab/followers","following_url":"https://api.github.com/users/USCiLab/following{/other_user}","gists_url":"https://api.github.com/users/USCiLab/gists{/gist_id}","starred_url":"https://api.github.com/users/USCiLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USCiLab/subscriptions","organizations_url":"https://api.github.com/users/USCiLab/orgs","repos_url":"https://api.github.com/users/USCiLab/repos","events_url":"https://api.github.com/users/USCiLab/events{/privacy}","received_events_url":"https://api.github.com/users/USCiLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/USCiLab/cereal","description":"A C++11 library for serialization","fork":false,"url":"https://api.github.com/repos/USCiLab/cereal","forks_url":"https://api.github.com/repos/USCiLab/cereal/forks","keys_url":"https://api.github.com/repos/USCiLab/cereal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/USCiLab/cereal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/USCiLab/cereal/teams","hooks_url":"https://api.github.com/repos/USCiLab/cereal/hooks","issue_events_url":"https://api.github.com/repos/USCiLab/cereal/issues/events{/number}","events_url":"https://api.github.com/repos/USCiLab/cereal/events","assignees_url":"https://api.github.com/repos/USCiLab/cereal/assignees{/user}","branches_url":"https://api.github.com/repos/USCiLab/cereal/branches{/branch}","tags_url":"https://api.github.com/repos/USCiLab/cereal/tags","blobs_url":"https://api.github.com/repos/USCiLab/cereal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/USCiLab/cereal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/USCiLab/cereal/git/refs{/sha}","trees_url":"https://api.github.com/repos/USCiLab/cereal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/USCiLab/cereal/statuses/{sha}","languages_url":"https://api.github.com/repos/USCiLab/cereal/languages","stargazers_url":"https://api.github.com/repos/USCiLab/cereal/stargazers","contributors_url":"https://api.github.com/repos/USCiLab/cereal/contributors","subscribers_url":"https://api.github.com/repos/USCiLab/cereal/subscribers","subscription_url":"https://api.github.com/repos/USCiLab/cereal/subscription","commits_url":"https://api.github.com/repos/USCiLab/cereal/commits{/sha}","git_commits_url":"https://api.github.com/repos/USCiLab/cereal/git/commits{/sha}","comments_url":"https://api.github.com/repos/USCiLab/cereal/comments{/number}","issue_comment_url":"https://api.github.com/repos/USCiLab/cereal/issues/comments{/number}","contents_url":"https://api.github.com/repos/USCiLab/cereal/contents/{+path}","compare_url":"https://api.github.com/repos/USCiLab/cereal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/USCiLab/cereal/merges","archive_url":"https://api.github.com/repos/USCiLab/cereal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/USCiLab/cereal/downloads","issues_url":"https://api.github.com/repos/USCiLab/cereal/issues{/number}","pulls_url":"https://api.github.com/repos/USCiLab/cereal/pulls{/number}","milestones_url":"https://api.github.com/repos/USCiLab/cereal/milestones{/number}","notifications_url":"https://api.github.com/repos/USCiLab/cereal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/USCiLab/cereal/labels{/name}","releases_url":"https://api.github.com/repos/USCiLab/cereal/releases{/id}","deployments_url":"https://api.github.com/repos/USCiLab/cereal/deployments","created_at":"2013-06-25T23:18:45Z","updated_at":"2016-03-08T09:25:01Z","pushed_at":"2016-03-09T22:28:24Z","git_url":"git://github.com/USCiLab/cereal.git","ssh_url":"git@github.com:USCiLab/cereal.git","clone_url":"https://github.com/USCiLab/cereal.git","svn_url":"https://github.com/USCiLab/cereal","homepage":null,"size":11372,"stargazers_count":692,"watchers_count":692,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":144,"mirror_url":null,"open_issues_count":65,"forks":144,"open_issues":65,"watchers":692,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/USCiLab/cereal/pulls/266"},"html":{"href":"https://github.com/USCiLab/cereal/pull/266"},"issue":{"href":"https://api.github.com/repos/USCiLab/cereal/issues/266"},"comments":{"href":"https://api.github.com/repos/USCiLab/cereal/issues/266/comments"},"review_comments":{"href":"https://api.github.com/repos/USCiLab/cereal/pulls/266/comments"},"review_comment":{"href":"https://api.github.com/repos/USCiLab/cereal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/USCiLab/cereal/pulls/266/commits"},"statuses":{"href":"https://api.github.com/repos/USCiLab/cereal/statuses/10b967c74beb2d0f011b1bf509964d42287e0aa9"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"AzothAmmo","id":1634639,"avatar_url":"https://avatars.githubusercontent.com/u/1634639?v=3","gravatar_id":"","url":"https://api.github.com/users/AzothAmmo","html_url":"https://github.com/AzothAmmo","followers_url":"https://api.github.com/users/AzothAmmo/followers","following_url":"https://api.github.com/users/AzothAmmo/following{/other_user}","gists_url":"https://api.github.com/users/AzothAmmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AzothAmmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzothAmmo/subscriptions","organizations_url":"https://api.github.com/users/AzothAmmo/orgs","repos_url":"https://api.github.com/users/AzothAmmo/repos","events_url":"https://api.github.com/users/AzothAmmo/events{/privacy}","received_events_url":"https://api.github.com/users/AzothAmmo/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":1,"additions":3,"deletions":3,"changed_files":1}}