{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/52609","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/52609/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/52609/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/52609/events","html_url":"https://github.com/rust-lang/rust/issues/52609","id":343390402,"node_id":"MDU6SXNzdWUzNDMzOTA0MDI=","number":52609,"title":"Unexpected getrandom error on linux kernel 3.10","user":{"login":"glebpom","id":52258,"node_id":"MDQ6VXNlcjUyMjU4","avatar_url":"https://avatars3.githubusercontent.com/u/52258?v=4","gravatar_id":"","url":"https://api.github.com/users/glebpom","html_url":"https://github.com/glebpom","followers_url":"https://api.github.com/users/glebpom/followers","following_url":"https://api.github.com/users/glebpom/following{/other_user}","gists_url":"https://api.github.com/users/glebpom/gists{/gist_id}","starred_url":"https://api.github.com/users/glebpom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebpom/subscriptions","organizations_url":"https://api.github.com/users/glebpom/orgs","repos_url":"https://api.github.com/users/glebpom/repos","events_url":"https://api.github.com/users/glebpom/events{/privacy}","received_events_url":"https://api.github.com/users/glebpom/received_events","type":"User","site_admin":false},"labels":[{"id":650731663,"node_id":"MDU6TGFiZWw2NTA3MzE2NjM=","url":"https://api.github.com/repos/rust-lang/rust/labels/C-bug","name":"C-bug","color":"f5f1fd","default":false},{"id":123110,"node_id":"MDU6TGFiZWwxMjMxMTA=","url":"https://api.github.com/repos/rust-lang/rust/labels/O-linux","name":"O-linux","color":"6e6ec0","default":false},{"id":211668062,"node_id":"MDU6TGFiZWwyMTE2NjgwNjI=","url":"https://api.github.com/repos/rust-lang/rust/labels/T-libs","name":"T-libs","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-07-22T09:07:59Z","updated_at":"2018-07-22T12:48:24Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nRust code panics on linux 3.10:\r\n```\r\n[admin@lcstr-qnap lanlord]# uname -a\r\nLinux lcstr-qnap 3.10.20-al-2.5.3 #39 SMP PREEMPT Tue Jul 10 04:05:13 CST 2018 armv7l unknown\r\n```\r\n\r\nPanic message:\r\n```\r\nthread 'main' panicked at 'unexpected getrandom error: 14', libstd/sys/unix/rand.rs:56:21\r\n```\r\n\r\nRustc from rustup, version `1.27.0`\r\nThe code is running on Qnap NAS\r\n\r\nRust core library [relies on `SYS_getrandom`](https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/rand.rs#L38) which was [introduced only in kernel version `3.4.17`](https://gitlab.com/gnutls/gnutls/issues/121). \r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/406864168","html_url":"https://github.com/rust-lang/rust/issues/52609#issuecomment-406864168","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/52609","id":406864168,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjg2NDE2OA==","user":{"login":"glebpom","id":52258,"node_id":"MDQ6VXNlcjUyMjU4","avatar_url":"https://avatars3.githubusercontent.com/u/52258?v=4","gravatar_id":"","url":"https://api.github.com/users/glebpom","html_url":"https://github.com/glebpom","followers_url":"https://api.github.com/users/glebpom/followers","following_url":"https://api.github.com/users/glebpom/following{/other_user}","gists_url":"https://api.github.com/users/glebpom/gists{/gist_id}","starred_url":"https://api.github.com/users/glebpom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebpom/subscriptions","organizations_url":"https://api.github.com/users/glebpom/orgs","repos_url":"https://api.github.com/users/glebpom/repos","events_url":"https://api.github.com/users/glebpom/events{/privacy}","received_events_url":"https://api.github.com/users/glebpom/received_events","type":"User","site_admin":false},"created_at":"2018-07-22T12:48:24Z","updated_at":"2018-07-22T12:48:24Z","author_association":"NONE","body":"It's very common in embedded software to have this type of bugs, which exist for many years without having a chance to fix it someday (including the fact, that some devices' firmware cannot be upgraded at all). If rust targets embedded development, there should always be a clear way on how to deal with it. Rebuilding rustc works, but it's very distracting and unsustainable from the development side.\r\n\r\nAs of this QNAP bug, I fully agree, that `EFAULT` means completely different, and using it in auto-detection is a wrong and harmful way. \r\n\r\nI would suggest to refactor this code a bit and implement \"random backends\" with a clear strategy on how to deal with them. The default should be the same - auto-detect. But in addition to that, the developer would have a chance to select which particular random implementation to use (or even provide own?).\r\n\r\nI can image many cases where it may be useful, besides this horrible QNAP bug. "}}
{"actor":{"display_login":"glebpom"}}