{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/25638","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/25638/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/25638/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/25638/events","html_url":"https://github.com/rust-lang/rust/issues/25638","id":78371454,"number":25638,"title":"thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os(1455) }'","user":{"login":"jeroldhaas","id":835976,"avatar_url":"https://avatars.githubusercontent.com/u/835976?v=3","gravatar_id":"","url":"https://api.github.com/users/jeroldhaas","html_url":"https://github.com/jeroldhaas","followers_url":"https://api.github.com/users/jeroldhaas/followers","following_url":"https://api.github.com/users/jeroldhaas/following{/other_user}","gists_url":"https://api.github.com/users/jeroldhaas/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroldhaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroldhaas/subscriptions","organizations_url":"https://api.github.com/users/jeroldhaas/orgs","repos_url":"https://api.github.com/users/jeroldhaas/repos","events_url":"https://api.github.com/users/jeroldhaas/events{/privacy}","received_events_url":"https://api.github.com/users/jeroldhaas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-libs","name":"A-libs","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-20T04:57:22Z","updated_at":"2015-06-09T19:36:16Z","closed_at":null,"body":"## Error: ##\r\n```\r\nthread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os(1455) }'\r\n```\r\n\r\nCode found (& system-torture enhanced) from online Rust book Ch 3.3 (embed project example).\r\n\r\nI'd modified the thread count from original 11 threads to 10,000,001 threads to see how / if a thread limit would be reached. I'm assuming this may be the initial cause for the panic, however `Os(1455)` doesn't really describe an `Error`'s repr very well.\r\n\r\n***As I'm not completely familiar with Rust, I was advised to submit this as an issue by someone more familiar with the language.***\r\n\r\nSee (modified) code example below for repro:\r\n```\r\nuse std::thread;\r\n\r\nfn main() {\r\n   let handles: Vec<_> = (0..10_000_000).map(|_| {\r\n       thread::spawn(|| {\r\n           let mut _x = 0;\r\n           for _ in (0..5_000_001) {\r\n               _x += 1\r\n           }\r\n       })\r\n    }).collect();\r\n\r\n    for h in handles {\r\n       h.join().ok().expect(\"Could not join a thread\");\r\n    }\r\n}\r\n```\r\nPlatform:\r\n* Rust 1.0 Stable 64bit Windows Build\r\n* Windows 8 x64"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/110479375","html_url":"https://github.com/rust-lang/rust/issues/25638#issuecomment-110479375","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/25638","id":110479375,"user":{"login":"sfackler","id":1455697,"avatar_url":"https://avatars.githubusercontent.com/u/1455697?v=3","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T19:36:16Z","updated_at":"2015-06-09T19:36:16Z","body":"This came up in the `Result::expect` RFC as well: https://github.com/rust-lang/rfcs/pull/1119#issuecomment-108693552. We may want to update the `Debug` impl in the short term, but specializing `unwrap` and `expect` when `E: Display` might be a better long term solution when specialization is added."}}