sending string via wsdump crashes server
edwindotcom opened this issue · 1 comments
edwindotcom commented
- ./run locally on localhost:8080
- get wsdump.py here: https://github.com/liris/websocket-client/tree/master/bin
- run this cmd:
python wsdump.py localhost:8080
- type
foo
and hit return key
acutal: server crashes
expected: no crash
013/06/04 15:11:41 [3] worker: Socket received foo
panic: invalid character 'o' in literal false (expecting 'a')
goroutine 24 [running]:
mozilla.org/simplepush.(*Worker).sniffer(0xc2000001b8, 0x2b0d80, 0x0, 0xc20013d1b0, 0xc20013e1e0, ...)
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/worker.go:48 +0x3f0
created by mozilla.org/simplepush.(*Worker).Run
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/worker.go:75 +0xcb
goroutine 1 [IO wait]:
net.runtime_pollWait(0x4fcf00, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/znetpoll_darwin_amd64.c:118 +0x82
net.(*pollDesc).WaitRead(0xc2000c53e0, 0x23, 0xc2000dc3c0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:75 +0x31
net.(*netFD).accept(0xc2000c5360, 0x323f60, 0x0, 0xc2000dc3c0, 0x23, ...)
/usr/local/go/src/pkg/net/fd_unix.go:385 +0x2c1
net.(*TCPListener).AcceptTCP(0xc2000003b8, 0x5bfe6, 0x670d10, 0x5bfe6)
/usr/local/go/src/pkg/net/tcpsock_posix.go:229 +0x45
net.(*TCPListener).Accept(0xc2000003b8, 0xc2000cd480, 0xc200000e60, 0xc20013d120, 0x0, ...)
/usr/local/go/src/pkg/net/tcpsock_posix.go:239 +0x25
net/http.(*Server).Serve(0xc2000af730, 0xc2000d58c0, 0xc2000003b8, 0x0, 0x0, ...)
/usr/local/go/src/pkg/net/http/server.go:1542 +0x85
net/http.(*Server).ListenAndServe(0xc2000af730, 0xc2000af730, 0xc)
/usr/local/go/src/pkg/net/http/server.go:1532 +0x9e
net/http.ListenAndServe(0xc2000df190, 0xc, 0x0, 0x0, 0x2, ...)
/usr/local/go/src/pkg/net/http/server.go:1597 +0x65
main.main()
/Users/Edwin/github/jrconlin/pushgo/main.go:63 +0x618
goroutine 2 [syscall]:
goroutine 6 [chan send]:
mozilla.org/simplepush.PushSocketHandler(0xc2000c5750)
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/handlers.go:111 +0x475
code.google.com/p/go.net/websocket.Server.serveWebSocket(0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/Edwin/github/jrconlin/pushgo/src/code.google.com/p/go.net/websocket/server.go:98 +0x230
code.google.com/p/go.net/websocket.Handler.ServeHTTP(0x323e70, 0xc2000d5bc0, 0xc2000fd150, 0xc2000b5a90)
/Users/Edwin/github/jrconlin/pushgo/src/code.google.com/p/go.net/websocket/server.go:121 +0x9b
net/http.(*ServeMux).ServeHTTP(0xc2000b24b0, 0xc2000d5bc0, 0xc2000fd150, 0xc2000b5a90)
/usr/local/go/src/pkg/net/http/server.go:1416 +0x11d
net/http.serverHandler.ServeHTTP(0xc2000af730, 0xc2000d5bc0, 0xc2000fd150, 0xc2000b5a90)
/usr/local/go/src/pkg/net/http/server.go:1517 +0x16c
net/http.(*conn).serve(0xc2000c56c0)
/usr/local/go/src/pkg/net/http/server.go:1096 +0x765
created by net/http.(*Server).Serve
/usr/local/go/src/pkg/net/http/server.go:1564 +0x266
goroutine 7 [select]:
mozilla.org/simplepush.(*Worker).Run(0xc200000598, 0x2b0d80, 0x0, 0xc2000c5750, 0xc2000cd840, ...)
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/worker.go:77 +0xa32
created by mozilla.org/simplepush.PushSocketHandler
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/handlers.go:103 +0x285
goroutine 22 [chan receive]:
mozilla.org/simplepush.PushSocketHandler(0xc20013d1b0)
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/handlers.go:106 +0x2c2
code.google.com/p/go.net/websocket.Server.serveWebSocket(0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/Edwin/github/jrconlin/pushgo/src/code.google.com/p/go.net/websocket/server.go:98 +0x230
code.google.com/p/go.net/websocket.Handler.ServeHTTP(0x323e70, 0xc2000d5bc0, 0xc2000fd2a0, 0xc200120340)
/Users/Edwin/github/jrconlin/pushgo/src/code.google.com/p/go.net/websocket/server.go:121 +0x9b
net/http.(*ServeMux).ServeHTTP(0xc2000b24b0, 0xc2000d5bc0, 0xc2000fd2a0, 0xc200120340)
/usr/local/go/src/pkg/net/http/server.go:1416 +0x11d
net/http.serverHandler.ServeHTTP(0xc2000af730, 0xc2000d5bc0, 0xc2000fd2a0, 0xc200120340)
/usr/local/go/src/pkg/net/http/server.go:1517 +0x16c
net/http.(*conn).serve(0xc20013d120)
/usr/local/go/src/pkg/net/http/server.go:1096 +0x765
created by net/http.(*Server).Serve
/usr/local/go/src/pkg/net/http/server.go:1564 +0x266
goroutine 21 [finalizer wait]:
goroutine 23 [select]:
mozilla.org/simplepush.(*Worker).Run(0xc2000001b8, 0x2b0d80, 0x0, 0xc20013d1b0, 0xc20013e1e0, ...)
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/worker.go:77 +0xa32
created by mozilla.org/simplepush.PushSocketHandler
/Users/Edwin/github/jrconlin/pushgo/src/mozilla.org/simplepush/handlers.go:103 +0x285
exit status 2