{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/26951","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/26951/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/26951/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/26951/events","html_url":"https://github.com/rust-lang/rust/issues/26951","id":94402030,"number":26951,"title":"Abort on some large allocation requests, Panic on other","user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-07-10T21:59:17Z","updated_at":"2015-07-24T23:51:38Z","closed_at":null,"body":"Compare these two:\r\n\r\n```\r\nlet v = vec![0u8; !0];\r\nlet u = vec![0u16; !0];\r\n```\r\n\r\nWe request a vector with 18446744073709551615 elements. \r\n\r\n- For `u8` we receive out of memory (null) from the allocator, and call `alloc::oom`, which aborts the program: `application terminated abnormally with signal 4 (Illegal instruction)`\r\n- For `u16`, we get an assertion: `thread '<main>' panicked at 'capacity overflow', ../src/libcore/option.rs:330`\r\n\r\nThis is inconsistent. Why don't we abort on both of these cases? We abort on too large allocation requests, so those that are even larger could abort too?"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/124769630","html_url":"https://github.com/rust-lang/rust/issues/26951#issuecomment-124769630","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/26951","id":124769630,"user":{"login":"Gankro","id":1136864,"avatar_url":"https://avatars.githubusercontent.com/u/1136864?v=3","gravatar_id":"","url":"https://api.github.com/users/Gankro","html_url":"https://github.com/Gankro","followers_url":"https://api.github.com/users/Gankro/followers","following_url":"https://api.github.com/users/Gankro/following{/other_user}","gists_url":"https://api.github.com/users/Gankro/gists{/gist_id}","starred_url":"https://api.github.com/users/Gankro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gankro/subscriptions","organizations_url":"https://api.github.com/users/Gankro/orgs","repos_url":"https://api.github.com/users/Gankro/repos","events_url":"https://api.github.com/users/Gankro/events{/privacy}","received_events_url":"https://api.github.com/users/Gankro/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T23:51:38Z","updated_at":"2015-07-24T23:51:38Z","body":"@nagisa Today this is simply a hard hardware issue: you only get 48 bits of the address space."}}