{"action":"created","issue":{"url":"https://api.github.com/repos/genodelabs/genode/issues/2118","repository_url":"https://api.github.com/repos/genodelabs/genode","labels_url":"https://api.github.com/repos/genodelabs/genode/issues/2118/labels{/name}","comments_url":"https://api.github.com/repos/genodelabs/genode/issues/2118/comments","events_url":"https://api.github.com/repos/genodelabs/genode/issues/2118/events","html_url":"https://github.com/genodelabs/genode/issues/2118","id":181401283,"number":2118,"title":"Enforce allocation sizes to be larger than 0","user":{"login":"nfeske","id":1268399,"avatar_url":"https://avatars.githubusercontent.com/u/1268399?v=3","gravatar_id":"","url":"https://api.github.com/users/nfeske","html_url":"https://github.com/nfeske","followers_url":"https://api.github.com/users/nfeske/followers","following_url":"https://api.github.com/users/nfeske/following{/other_user}","gists_url":"https://api.github.com/users/nfeske/gists{/gist_id}","starred_url":"https://api.github.com/users/nfeske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfeske/subscriptions","organizations_url":"https://api.github.com/users/nfeske/orgs","repos_url":"https://api.github.com/users/nfeske/repos","events_url":"https://api.github.com/users/nfeske/events{/privacy}","received_events_url":"https://api.github.com/users/nfeske/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/genodelabs/genode/labels/cleanup","name":"cleanup","color":"1b7921"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-06T12:29:47Z","updated_at":"2016-10-06T13:16:56Z","closed_at":null,"body":"We have repeatedly stumbled over bugs that were indirectly caused supplying 0 as a size argument to an allocator such as `Allocator_avl`. Depending on the allocator implementation, this damages invariants that are expected to hold by the implementation, i.e. that each address belongs to not more than one block.\r\n\r\nInstead of changing all allocator implementations to be more defensive, I suggest to introduce a dedicated type `Allocation_size` that wraps a `size_t` and checks its range in the constructor. If the supplied value is 0, it throws an exception. The approach is transparent to the current users of the `Allocator` interface. However, all existing allocator implementations must be adapted to use the new type in the method signatures.\r\n"},"comment":{"url":"https://api.github.com/repos/genodelabs/genode/issues/comments/251958350","html_url":"https://github.com/genodelabs/genode/issues/2118#issuecomment-251958350","issue_url":"https://api.github.com/repos/genodelabs/genode/issues/2118","id":251958350,"user":{"login":"nfeske","id":1268399,"avatar_url":"https://avatars.githubusercontent.com/u/1268399?v=3","gravatar_id":"","url":"https://api.github.com/users/nfeske","html_url":"https://github.com/nfeske","followers_url":"https://api.github.com/users/nfeske/followers","following_url":"https://api.github.com/users/nfeske/following{/other_user}","gists_url":"https://api.github.com/users/nfeske/gists{/gist_id}","starred_url":"https://api.github.com/users/nfeske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfeske/subscriptions","organizations_url":"https://api.github.com/users/nfeske/orgs","repos_url":"https://api.github.com/users/nfeske/repos","events_url":"https://api.github.com/users/nfeske/events{/privacy}","received_events_url":"https://api.github.com/users/nfeske/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T13:16:56Z","updated_at":"2016-10-06T13:16:56Z","body":"Commit https://github.com/nfeske/genode/commit/a13ad161ca394f768e7cc88fee7cf1d381e3791f implements the idea."}}
{"actor":{"display_login":"nfeske"}}