{"action":"created","issue":{"url":"https://api.github.com/repos/iron/iron/issues/463","repository_url":"https://api.github.com/repos/iron/iron","labels_url":"https://api.github.com/repos/iron/iron/issues/463/labels{/name}","comments_url":"https://api.github.com/repos/iron/iron/issues/463/comments","events_url":"https://api.github.com/repos/iron/iron/issues/463/events","html_url":"https://github.com/iron/iron/issues/463","id":159813854,"number":463,"title":"https / malloc: *** error for object ... pointer being freed was not allocated","user":{"login":"xpe","id":4576329,"avatar_url":"https://avatars.githubusercontent.com/u/4576329?v=3","gravatar_id":"","url":"https://api.github.com/users/xpe","html_url":"https://github.com/xpe","followers_url":"https://api.github.com/users/xpe/followers","following_url":"https://api.github.com/users/xpe/following{/other_user}","gists_url":"https://api.github.com/users/xpe/gists{/gist_id}","starred_url":"https://api.github.com/users/xpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xpe/subscriptions","organizations_url":"https://api.github.com/users/xpe/orgs","repos_url":"https://api.github.com/users/xpe/repos","events_url":"https://api.github.com/users/xpe/events{/privacy}","received_events_url":"https://api.github.com/users/xpe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-12T07:51:54Z","updated_at":"2016-09-30T11:26:25Z","closed_at":"2016-09-30T11:26:25Z","body":"I don't know for sure if this is caused by Iron, but I'll share what I know about my error.\r\n\r\nMy \"Cargo.toml\" file:\r\n\r\n```toml\r\n[package]\r\nname = \"my-server\"\r\nversion = \"0.1.0\"\r\nauthors = [\"me\"]\r\n\r\n[dependencies]\r\nrouter = \"0.1.1\"\r\n\r\n[dependencies.iron]\r\nversion = \"0.3.0\"\r\nfeatures = [\"ssl\"]\r\n```\r\n\r\nMy \"main.rs\" file:\r\n\r\n```rs\r\nextern crate iron;\r\nextern crate router;\r\n\r\nuse iron::status;\r\nuse iron::{Iron, IronResult, Request, Response};\r\nuse router::{Router};\r\nuse std::path::{Path};\r\nuse std::result::{Result};\r\n\r\nfn handler(_: &mut Request) -> IronResult<Response> {\r\n    Ok(Response::with((status::Ok, \"Hello World!\")))\r\n}\r\n\r\nfn main() {\r\n    let mut router = Router::new();\r\n    router.get(\"/foo\", handler);\r\n    let cert = Path::new(\"/Users/myusername/certs/localhost.crt\").to_path_buf();\r\n    let key = Path::new(\"/Users/myusername/certs/localhost.key\").to_path_buf();\r\n    match Iron::new(router).https(\"localhost:3000\", cert, key) {\r\n        Result::Ok(listening) => println!(\"{:?}\", listening),\r\n        Result::Err(err) => println!(\"{:?}\", err),\r\n    }\r\n}\r\n```\r\n\r\n```\r\n❯ cargo run\r\n     Running `target/debug/my-server`\r\nListening { socket: V6([::1]:3000) }\r\n```\r\n\r\nbut at some point, this happens:\r\n\r\n```\r\nmy-server(19003,0x700000607000) malloc: *** error for object 0x7f80f84044a0: pointer being freed was not allocated\r\n*** set a breakpoint in malloc_error_break to debug\r\nerror: Process didn't exit successfully: `target/debug/my-server` (signal: 6, SIGABRT: process abort signal)\r\n```\r\n\r\nHere is how I reproduce the crash... I refresh about five to fifteen times in my web browser pointing to \"https://localhost:3000/foo\".\r\n\r\nI'm not sure what the cause is. It is not obviously the number of requests or a particular length of time, best I can tell.\r\n\r\nFWIW, I'm using Homebrew's OpenSSL:\r\n\r\n```\r\n❯ brew info openssl\r\nopenssl: stable 1.0.2h (bottled) [keg-only]\r\nSSL/TLS cryptography library\r\nhttps://openssl.org/\r\n/usr/local/Cellar/openssl/1.0.2h_1 (1,691 files, 12M)\r\n  Built from source on 2016-05-16 at 09:55:16\r\n```\r\n\r\nAnyone else seeing this?"},"comment":{"url":"https://api.github.com/repos/iron/iron/issues/comments/250721569","html_url":"https://github.com/iron/iron/issues/463#issuecomment-250721569","issue_url":"https://api.github.com/repos/iron/iron/issues/463","id":250721569,"user":{"login":"Hoverbear","id":130903,"avatar_url":"https://avatars.githubusercontent.com/u/130903?v=3","gravatar_id":"","url":"https://api.github.com/users/Hoverbear","html_url":"https://github.com/Hoverbear","followers_url":"https://api.github.com/users/Hoverbear/followers","following_url":"https://api.github.com/users/Hoverbear/following{/other_user}","gists_url":"https://api.github.com/users/Hoverbear/gists{/gist_id}","starred_url":"https://api.github.com/users/Hoverbear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hoverbear/subscriptions","organizations_url":"https://api.github.com/users/Hoverbear/orgs","repos_url":"https://api.github.com/users/Hoverbear/repos","events_url":"https://api.github.com/users/Hoverbear/events{/privacy}","received_events_url":"https://api.github.com/users/Hoverbear/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T11:26:25Z","updated_at":"2016-09-30T11:26:25Z","body":"I was unable to repo this with the latest versions.\r\n\r\n`Cargo.toml`:\r\n```toml\r\n[package]\r\nname = \"my-server\"\r\nversion = \"0.1.0\"\r\nauthors = [\"me\"]\r\n\r\n[dependencies]\r\nrouter = \"0.4.0\"\r\n\r\n[dependencies.iron]\r\nversion = \"0.4.0\"\r\nfeatures = [\"ssl\"]\r\n```\r\n\r\n`src/main.rs`:\r\n```rust\r\nextern crate iron;\r\nextern crate router;\r\n\r\nuse iron::status;\r\nuse iron::{Iron, IronResult, Request, Response};\r\nuse router::{Router};\r\nuse std::path::{Path};\r\nuse std::result::{Result};\r\n\r\nfn handler(_: &mut Request) -> IronResult<Response> {\r\n    println!(\"Got a request\");\r\n    Ok(Response::with((status::Ok, \"Hello World!\")))\r\n}\r\n\r\nfn main() {\r\n    let mut router = Router::new();\r\n    router.get(\"/foo\", handler, \"foo\");\r\n    // openssl genrsa -out localhost.key 4096\r\n    let key = Path::new(\"localhost.key\").to_path_buf();\r\n    // openssl req -key localhost.key -x509 -new -days 3650 -out cacert.crt\r\n    let cert = Path::new(\"localhost.crt\").to_path_buf();\r\n\r\n    match Iron::new(router).https(\"127.0.0.1:3000\", cert, key) {\r\n        Result::Ok(listening) => println!(\"{:?}\", listening),\r\n        Result::Err(err) => println!(\"{:?}\", err),\r\n    }\r\n    // curl -vvvv https://127.0.0.1:3000/foo -k\r\n}\r\n```\r\n\r\nRunning:\r\n\r\n```bash\r\ncurl -vvvv https://127.0.0.1:3000/foo -k\r\n```\r\n\r\nA bunch as well as loading the URL in my browser many times resulted in no errors:\r\n\r\n![screen shot 2016-09-30 at 13 24 49](https://cloud.githubusercontent.com/assets/130903/18990346/761cca4a-8711-11e6-93d2-4ed45ffc006f.png)\r\n\r\n\r\nClosing since this seems to no longer be an issue."}}
{"actor":{"display_login":"Hoverbear"}}