{"action":"created","issue":{"url":"https://api.github.com/repos/googollee/go-socket.io/issues/47","labels_url":"https://api.github.com/repos/googollee/go-socket.io/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/googollee/go-socket.io/issues/47/comments","events_url":"https://api.github.com/repos/googollee/go-socket.io/issues/47/events","html_url":"https://github.com/googollee/go-socket.io/issues/47","id":49831564,"number":47,"title":"Crashing all the time on windows","user":{"login":"rytutis","id":1536411,"avatar_url":"https://avatars.githubusercontent.com/u/1536411?v=3","gravatar_id":"","url":"https://api.github.com/users/rytutis","html_url":"https://github.com/rytutis","followers_url":"https://api.github.com/users/rytutis/followers","following_url":"https://api.github.com/users/rytutis/following{/other_user}","gists_url":"https://api.github.com/users/rytutis/gists{/gist_id}","starred_url":"https://api.github.com/users/rytutis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rytutis/subscriptions","organizations_url":"https://api.github.com/users/rytutis/orgs","repos_url":"https://api.github.com/users/rytutis/repos","events_url":"https://api.github.com/users/rytutis/events{/privacy}","received_events_url":"https://api.github.com/users/rytutis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-11-23T17:11:05Z","updated_at":"2015-01-16T15:39:40Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to use it on Windows with socket.io 1.2. Crashes within seconds and all the time.\r\nAm I using wrong versions or something?\r\n\r\nMy Go side is example from the read.me and client side is from here: http://socket.io/get-started/chat/\r\n\r\n\r\npanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal 0xc0000005 code=0x0 addr=0x30 pc=0x565638]\r\n\r\ngoroutine 33 [running]:\r\nruntime.panic(0x6bfd00, 0x88cfe2)\r\n        c:/go/src/pkg/runtime/panic.c:279 +0x11f\r\ngithub.com/googollee/go-engine%2eio.(*conn).NextWriter(0xc0820242a0, 0x0, 0x0, 0\r\nx0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/conn.go:129 +0xc8\r\ngithub.com/googollee/go-socket%2eio.(*encoder).encodePacket(0xc08208aa00, 0x2, 0\r\nx0, 0x0, 0xffffffffffffffff, 0x626e20, 0xc08208a9c0, 0x0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/parser.go:93 +0x84\r\ngithub.com/googollee/go-socket%2eio.(*encoder).Encode(0xc08208aa00, 0x2, 0x0, 0x\r\n0, 0xffffffffffffffff, 0x626e20, 0xc08208a9c0, 0x0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/parser.go:81 +0xd7\r\ngithub.com/googollee/go-socket%2eio.(*socket).send(0xc082040a50, 0xc08208a980, 0\r\nx2, 0x2, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/socket.go:78 +0x176\r\n\r\ngithub.com/googollee/go-socket%2eio.(*socketHandler).Emit(0xc082009120, 0x70dc70\r\n, 0xc, 0xc08208a980, 0x2, 0x2, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/handler.go:77 +0x45\r\nd\r\ngithub.com/googollee/go-socket%2eio.(*socket).Emit(0xc082040a50, 0x70dc70, 0xc,\r\n0xc082086b70, 0x1, 0x1, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/socket.go:61 +0x89\r\ngithub.com/googollee/go-socket%2eio.broadcast.Send(0xc082040450, 0x361d98, 0xc08\r\n2040f90, 0xc082086aa7, 0x5, 0x70dc70, 0xc, 0xc082086b70, 0x1, 0x1, ...)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/adapter.go:54 +0x22\r\n9\r\ngithub.com/googollee/go-socket%2eio.(*socketHandler).BroadcastTo(0xc08208a3e0, 0\r\nx6fc770, 0x4, 0x70dc70, 0xc, 0xc082086b70, 0x1, 0x1, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/handler.go:116 +0x1\r\n4a\r\nmain.func┬╖001(0xc082086aa0, 0x5)\r\n        C:/Users/Rytis/Desktop/io/main.go:19 +0x300\r\nreflect.Value.call(0x63b880, 0xc082086590, 0x0, 0x130, 0x6f6570, 0x4, 0xc08208a8\r\na0, 0x1, 0x1, 0x0, ...)\r\n        c:/go/src/pkg/reflect/value.go:563 +0x1217\r\nreflect.Value.Call(0x63b880, 0xc082086590, 0x0, 0x130, 0xc08208a8a0, 0x1, 0x1, 0\r\nx0, 0x0, 0x0)\r\n        c:/go/src/pkg/reflect/value.go:411 +0xde\r\ngithub.com/googollee/go-socket%2eio.(*caller).Call(0xc082096380, 0x361d98, 0xc08\r\n2040f90, 0xc082086a70, 0x1, 0x1, 0x0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/caller.go:71 +0x3bb\r\n\r\ngithub.com/googollee/go-socket%2eio.(*socketHandler).onPacket(0xc08208a3e0, 0xc0\r\n82096440, 0xc0820964c0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/handler.go:149 +0x2\r\na9\r\ngithub.com/googollee/go-socket%2eio.(*socket).loop(0xc082040f90, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/socket.go:125 +0x30\r\nd\r\ngithub.com/googollee/go-socket%2eio.func┬╖003(0xc082040f90)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:74 +0x2e\r\ncreated by github.com/googollee/go-socket%2eio.(*Server).loop\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:75 +0x10c\r\n\r\n\r\ngoroutine 16 [IO wait]:\r\nnet.runtime_pollWait(0x361700, 0x72, 0x0)\r\n        c:/go/src/pkg/runtime/netpoll.goc:146 +0x6d\r\nnet.(*pollDesc).Wait(0xc08205c170, 0x72, 0x0, 0x0)\r\n        c:/go/src/pkg/net/fd_poll_runtime.go:84 +0x4d\r\nnet.(*ioSrv).ExecIO(0xc082028020, 0xc08205c060, 0x7055b0, 0x8, 0xc0820865e0, 0xc\r\n08205c780, 0x0, 0x0)\r\n        c:/go/src/pkg/net/fd_windows.go:188 +0x242\r\nnet.(*netFD).acceptOne(0xc08205c000, 0x78ac80, 0xc08200e380, 0x2, 0x2, 0xc08205c\r\n060, 0xc082016ea0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/fd_windows.go:546 +0x3c7\r\nnet.(*netFD).accept(0xc08205c000, 0x78ac80, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/fd_windows.go:573 +0x187\r\nnet.(*TCPListener).AcceptTCP(0xc082028030, 0x448cda, 0x0, 0x0)\r\n        c:/go/src/pkg/net/tcpsock_posix.go:234 +0x64\r\nnet/http.tcpKeepAliveListener.Accept(0xc082028030, 0x0, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/http/server.go:1947 +0x52\r\nnet/http.(*Server).Serve(0xc0820103c0, 0x3617b0, 0xc082028030, 0x0, 0x0)\r\n        c:/go/src/pkg/net/http/server.go:1698 +0x98\r\nnet/http.(*Server).ListenAndServe(0xc0820103c0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/http/server.go:1688 +0x154\r\nnet/http.ListenAndServe(0x6f5630, 0x5, 0x0, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/http/server.go:1778 +0x80\r\nmain.main()\r\n        C:/Users/Rytis/Desktop/io/main.go:32 +0x3b9\r\n\r\ngoroutine 19 [finalizer wait]:\r\nruntime.park(0x415a30, 0x891c38, 0x88fda9)\r\n        c:/go/src/pkg/runtime/proc.c:1369 +0xac\r\nruntime.parkunlock(0x891c38, 0x88fda9)\r\n        c:/go/src/pkg/runtime/proc.c:1385 +0x42\r\nrunfinq()\r\n        c:/go/src/pkg/runtime/mgc0.c:2644 +0xdd\r\nruntime.goexit()\r\n        c:/go/src/pkg/runtime/proc.c:1445\r\n\r\ngoroutine 20 [chan receive]:\r\ngithub.com/googollee/go-socket%2eio.(*Server).loop(0xc082008ac0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:68 +0x85\r\ncreated by github.com/googollee/go-socket%2eio.NewServer\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:26 +0x176\r\n\r\n\r\ngoroutine 21 [IO wait]:\r\nnet.runtime_pollWait(0x361650, 0x72, 0x0)\r\n        c:/go/src/pkg/runtime/netpoll.goc:146 +0x6d\r\nnet.(*pollDesc).Wait(0xc08205c2f0, 0x72, 0x0, 0x0)\r\n        c:/go/src/pkg/net/fd_poll_runtime.go:84 +0x4d\r\nnet.(*ioSrv).ExecIO(0xc082028020, 0xc08205c1e0, 0x6fb050, 0x7, 0x78ac10, 0x0, 0x\r\n0, 0x0)\r\n        c:/go/src/pkg/net/fd_windows.go:188 +0x242\r\nnet.(*netFD).Read(0xc08205c180, 0xc08205e000, 0x1000, 0x1000, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/fd_windows.go:458 +0x156\r\nnet.(*conn).Read(0xc082028038, 0xc08205e000, 0x1000, 0x1000, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/net.go:122 +0xee\r\nnet/http.(*liveSwitchReader).Read(0xc08204c228, 0xc08205e000, 0x1000, 0x1000, 0x\r\nc08208a800, 0x0, 0x0)\r\n        c:/go/src/pkg/net/http/server.go:206 +0xb6\r\nio.(*LimitedReader).Read(0xc082008d40, 0xc08205e000, 0x1000, 0x1000, 0x569c49, 0\r\nx0, 0x0)\r\n        c:/go/src/pkg/io/io.go:399 +0xd7\r\nbufio.(*Reader).fill(0xc082010480)\r\n        c:/go/src/pkg/bufio/bufio.go:97 +0x1ba\r\nbufio.(*Reader).ReadSlice(0xc082010480, 0xc08205c20a, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/bufio/bufio.go:298 +0x233\r\nbufio.(*Reader).ReadLine(0xc082010480, 0x0, 0x0, 0x0, 0x423800, 0x0, 0x0)\r\n        c:/go/src/pkg/bufio/bufio.go:326 +0x70\r\nnet/textproto.(*Reader).readLineSlice(0xc082040690, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/textproto/reader.go:55 +0xa4\r\nnet/textproto.(*Reader).ReadLine(0xc082040690, 0x0, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/textproto/reader.go:36 +0x55\r\nnet/http.ReadRequest(0xc082010480, 0xc082023110, 0x0, 0x0)\r\n        c:/go/src/pkg/net/http/request.go:556 +0xce\r\nnet/http.(*conn).readRequest(0xc08204c200, 0x0, 0x0, 0x0)\r\n        c:/go/src/pkg/net/http/server.go:577 +0x27d\r\nnet/http.(*conn).serve(0xc08204c200)\r\n        c:/go/src/pkg/net/http/server.go:1132 +0x625\r\ncreated by net/http.(*Server).Serve\r\n        c:/go/src/pkg/net/http/server.go:1721 +0x31a\r\n\r\ngoroutine 31 [select]:\r\ngithub.com/googollee/go-engine%2eio.(*conn).pingLoop(0xc082024770)\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/conn.go:254 +0x1a2\r\ncreated by github.com/googollee/go-engine%2eio.newConn\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/conn.go:85 +0x156\r\n\r\ngoroutine 25 [chan receive]:\r\ngithub.com/googollee/go-engine%2eio.(*conn).NextReader(0xc0820242a0, 0x0, 0x0, 0\r\nx0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/conn.go:119 +0x72\r\ngithub.com/googollee/go-socket%2eio.(*decoder).Decode(0xc0820962c0, 0xc082096300\r\n, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/parser.go:160 +0x76\r\n\r\ngithub.com/googollee/go-socket%2eio.(*socket).loop(0xc082040a50, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/socket.go:122 +0x2a\r\n7\r\ngithub.com/googollee/go-socket%2eio.func┬╖003(0xc082040a50)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:74 +0x2e\r\ncreated by github.com/googollee/go-socket%2eio.(*Server).loop\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:75 +0x10c\r\n\r\n\r\ngoroutine 29 [chan receive]:\r\ngithub.com/googollee/go-engine%2eio.(*conn).NextReader(0xc082025260, 0x892528, 0\r\nx0, 0x0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/conn.go:119 +0x72\r\ngithub.com/googollee/go-socket%2eio.(*decoder).Decode(0xc082096600, 0xc082096640\r\n, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/parser.go:160 +0x76\r\n\r\ngithub.com/googollee/go-socket%2eio.(*socket).loop(0xc082040de0, 0x0, 0x0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/socket.go:122 +0x2a\r\n7\r\ngithub.com/googollee/go-socket%2eio.func┬╖003(0xc082040de0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:74 +0x2e\r\ncreated by github.com/googollee/go-socket%2eio.(*Server).loop\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:75 +0x10c\r\n\r\n\r\ngoroutine 34 [runnable]:\r\ngithub.com/googollee/go-engine%2eio.(*conn).onPacket(0xc082024770, 0xc082096880)\r\n\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/conn.go:238 +0x241\r\ngithub.com/googollee/go-engine%2eio.(*websocket).ServeHTTP(0xc082096780, 0x36194\r\n0, 0xc08203c6e0, 0xc082022ea0)\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/websocket.go:79 +0x\r\n1d6\r\ngithub.com/googollee/go-engine%2eio.(*conn).serveHTTP(0xc082024770, 0x361940, 0x\r\nc08203c6e0, 0xc082022ea0)\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/conn.go:182 +0x1df\r\ngithub.com/googollee/go-engine%2eio.(*Server).ServeHTTP(0xc08200c690, 0x361940,\r\n0xc08203c6e0, 0xc082022ea0)\r\n        c:/go/packages/src/github.com/googollee/go-engine.io/server.go:128 +0x8f\r\n1\r\ngithub.com/googollee/go-socket%2eio.(*Server).ServeHTTP(0xc082008ac0, 0x361940,\r\n0xc08203c6e0, 0xc082022ea0)\r\n        c:/go/packages/src/github.com/googollee/go-socket.io/server.go:63 +0x9d\r\nnet/http.(*ServeMux).ServeHTTP(0xc082040030, 0x361940, 0xc08203c6e0, 0xc082022ea\r\n0)\r\n        c:/go/src/pkg/net/http/server.go:1511 +0x1aa\r\nnet/http.serverHandler.ServeHTTP(0xc0820103c0, 0x361940, 0xc08203c6e0, 0xc082022\r\nea0)\r\n        c:/go/src/pkg/net/http/server.go:1673 +0x1a6\r\nnet/http.(*conn).serve(0xc08204c580)\r\n        c:/go/src/pkg/net/http/server.go:1174 +0xa85\r\ncreated by net/http.(*Server).Serve\r\n        c:/go/src/pkg/net/http/server.go:1721 +0x31a"},"comment":{"url":"https://api.github.com/repos/googollee/go-socket.io/issues/comments/70271135","html_url":"https://github.com/googollee/go-socket.io/issues/47#issuecomment-70271135","issue_url":"https://api.github.com/repos/googollee/go-socket.io/issues/47","id":70271135,"user":{"login":"jsgoecke","id":754,"avatar_url":"https://avatars.githubusercontent.com/u/754?v=3","gravatar_id":"","url":"https://api.github.com/users/jsgoecke","html_url":"https://github.com/jsgoecke","followers_url":"https://api.github.com/users/jsgoecke/followers","following_url":"https://api.github.com/users/jsgoecke/following{/other_user}","gists_url":"https://api.github.com/users/jsgoecke/gists{/gist_id}","starred_url":"https://api.github.com/users/jsgoecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsgoecke/subscriptions","organizations_url":"https://api.github.com/users/jsgoecke/orgs","repos_url":"https://api.github.com/users/jsgoecke/repos","events_url":"https://api.github.com/users/jsgoecke/events{/privacy}","received_events_url":"https://api.github.com/users/jsgoecke/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T15:39:40Z","updated_at":"2015-01-16T15:39:40Z","body":"This is the client code:\r\n\r\nhttps://gist.github.com/harborhoffer/4bc93ca1d3850ab8d7ec\r\n\r\nAnd the server code:\r\n\r\nhttps://gist.github.com/jsgoecke/c7d5c3ccb54cf0b1c9cb"}}