{"action":"reopened","issue":{"url":"https://api.github.com/repos/buger/gor/issues/258","repository_url":"https://api.github.com/repos/buger/gor","labels_url":"https://api.github.com/repos/buger/gor/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/buger/gor/issues/258/comments","events_url":"https://api.github.com/repos/buger/gor/issues/258/events","html_url":"https://github.com/buger/gor/issues/258","id":151588743,"number":258,"title":"http: panic - runtime error: invalid memory address or nil pointer dereference","user":{"login":"andrewthecoder","id":757713,"avatar_url":"https://avatars.githubusercontent.com/u/757713?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewthecoder","html_url":"https://github.com/andrewthecoder","followers_url":"https://api.github.com/users/andrewthecoder/followers","following_url":"https://api.github.com/users/andrewthecoder/following{/other_user}","gists_url":"https://api.github.com/users/andrewthecoder/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewthecoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewthecoder/subscriptions","organizations_url":"https://api.github.com/users/andrewthecoder/orgs","repos_url":"https://api.github.com/users/andrewthecoder/repos","events_url":"https://api.github.com/users/andrewthecoder/events{/privacy}","received_events_url":"https://api.github.com/users/andrewthecoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-28T09:19:03Z","updated_at":"2016-05-04T13:58:09Z","closed_at":null,"body":"I've been running a Gor instance for the last few months to forward connections from one server to another, and it's proven very helpful (thanks!).\r\n\r\nHowever stdout regularly shows errors / stack traces like the following, and I'd like to get to the bottom of the cause:\r\n\r\n```\r\n2016/04/26 07:07:51 http: panic serving 127.0.0.1:39467: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 2105 [running]:\r\nnet/http.(*conn).serve.func1(0xc820d54000, 0x7f1602860100, 0xc82002e000)\r\n        /usr/lib/go/src/net/http/server.go:1287 +0xb5\r\nio.(*LimitedReader).Read(0xc8200515c0, 0xc820d50000, 0x2000, 0x2000, 0x2, 0x0, 0x0)\r\n        /usr/lib/go/src/io/io.go:427 +0xb7\r\nio/ioutil.devNull.ReadFrom(0x0, 0x7f16028601d8, 0xc8200515c0, 0x0, 0x0, 0x0)\r\n        /usr/lib/go/src/io/ioutil/ioutil.go:151 +0x9e\r\nio/ioutil.(*devNull).ReadFrom(0xc82000e400, 0x7f16028601d8, 0xc8200515c0, 0xc820699500, 0x0, 0x0)\r\n        <autogenerated>:9 +0xb1\r\nio.copyBuffer(0x7f160568b248, 0xc82000e400, 0x7f16028601d8, 0xc8200515c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        /usr/lib/go/src/io/io.go:375 +0x180\r\nio.Copy(0x7f160568b248, 0xc82000e400, 0x7f16028601d8, 0xc8200515c0, 0x5, 0x0, 0x0)\r\n        /usr/lib/go/src/io/io.go:351 +0x64\r\nio.CopyN(0x7f160568b248, 0xc82000e400, 0x0, 0x0, 0x40001, 0xc820d54366, 0x0, 0x0)\r\n        /usr/lib/go/src/io/io.go:327 +0xf7\r\nnet/http.(*chunkWriter).writeHeader(0xc820d542e0, 0xc820780800, 0x3, 0x800)\r\n        /usr/lib/go/src/net/http/server.go:901 +0xaf9\r\nnet/http.(*chunkWriter).Write(0xc820d542e0, 0xc820780800, 0x3, 0x800, 0x0, 0x0, 0x0)\r\n        /usr/lib/go/src/net/http/server.go:261 +0x92\r\nbufio.(*Writer).flush(0xc8207d0500, 0x0, 0x0)\r\n        /usr/lib/go/src/bufio/bufio.go:562 +0xe0\r\nbufio.(*Writer).Flush(0xc8207d0500, 0x0, 0x0)\r\n        /usr/lib/go/src/bufio/bufio.go:551 +0x2d\r\nnet/http.(*response).finishRequest(0xc820d542c0)\r\n        /usr/lib/go/src/net/http/server.go:1153 +0x57\r\nnet/http.(*conn).serve(0xc820d54000)\r\n        /usr/lib/go/src/net/http/server.go:1365 +0xc28\r\ncreated by net/http.(*Server).Serve\r\n        /usr/lib/go/src/net/http/server.go:1910 +0x3f6\r\n```\r\n\r\nThis has occurred many times, so I have lots of examples of the above if that helps at all.\r\n\r\nUnfortunately due to the nature of the recipient server, I'm not even sure if the network request was successfully forwarded in these cases or if the fact that I'm seeing errors means they've been failing some of the time. Certainly plenty of network requests have been succeeding, so it's only occurring occasionally.\r\n\r\nThis is the command used to start Gor: \r\n`gor --input-http :5999 --output-http=\"http://collector.tracepot.com\"  --output-file crashes-since-26.01.2016.gor`\r\n\r\nI've already looked at #137 which was supposedly resolved a while back, but that may not be relevant.\r\n\r\nAny suggestions would be much appreciated, thanks!"}}