Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash from unknown cause #8

Open
jhchabran opened this issue Jun 29, 2015 · 2 comments
Open

Crash from unknown cause #8

jhchabran opened this issue Jun 29, 2015 · 2 comments
Labels

Comments

@jhchabran
Copy link
Member

I got this crash while toying with graph libraries. On client-side the only thing I added was a handler which supposedly don't do anything that could crash it. I refreshed the page really often while editing code, which opens the websocket, if that can help.

Trace:

 (master) ~/go/src/github.com/openflylab/bridge$ sudo ./bridge -port 3000 uavobjectdefinition/
2015/06/29 12:29:24 Websocket server started on port 3000
2015/06/29 12:29:26 Connection received
2015/06/29 12:29:26 Treating messages
2015/06/29 12:29:26 Starting HID
2015/06/29 12:30:53 EOF
2015/06/29 12:30:53 websocket: close sent
2015/06/29 12:30:53 Closing <- HID goroutine
2015/06/29 12:30:53 Closing HID
2015/06/29 12:30:53 Closing -> HID goroutine
2015/06/29 12:30:53 Connection received
2015/06/29 12:30:53 Treating messages
2015/06/29 12:30:53 Starting HID
2015/06/29 12:31:38 EOF
2015/06/29 12:31:38 websocket: close sent
2015/06/29 12:31:38 Closing <- HID goroutine
2015/06/29 12:31:38 Closing HID
2015/06/29 12:31:38 Closing -> HID goroutine
2015/06/29 12:31:38 Connection received
2015/06/29 12:31:38 Treating messages
2015/06/29 12:31:38 Starting HID
2015/06/29 12:31:59 EOF
2015/06/29 12:31:59 Connection received
2015/06/29 12:31:59 Treating messages
2015/06/29 12:31:59 websocket: close sent
2015/06/29 12:31:59 Closing <- HID goroutine
2015/06/29 12:31:59 Closing HID
2015/06/29 12:31:59 Closing -> HID goroutine
^C (master) ~/go/src/github.com/openflylab/bridge$ sudo ./bridge -port 3000 uavobjectdefinition/
2015/06/29 12:32:22 Websocket server started on port 3000
2015/06/29 12:32:29 Connection received
2015/06/29 12:32:29 Treating messages
2015/06/29 12:32:39 EOF
2015/06/29 12:32:39 Connection received
2015/06/29 12:32:39 Treating messages
2015/06/29 12:32:40 Starting HID
panic:

goroutine 16 [running]:
runtime.panic(0x658620, 0xc210168740)
        /usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6
main.func·002()
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:235 +0x416
created by main.startHID
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:240 +0x3db

goroutine 1 [select (no cases)]:
main.main()
        /home/tech/go/src/github.com/openflylab/bridge/main.go:25 +0x28e

goroutine 3 [syscall]:
runtime.goexit()
        /usr/lib/go/src/pkg/runtime/proc.c:1394

goroutine 4 [finalizer wait]:
runtime.park(0x416210, 0xb9a1c0, 0xb85fa8)
        /usr/lib/go/src/pkg/runtime/proc.c:1342 +0x66
runfinq()
        /usr/lib/go/src/pkg/runtime/mgc0.c:2279 +0x84
runtime.goexit()
        /usr/lib/go/src/pkg/runtime/proc.c:1394

goroutine 5 [chan receive]:
main.func·003()
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:261 +0x74
created by main.startUAVTalk
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:274 +0x8b

goroutine 6 [IO wait]:
net.runtime_pollWait(0x7ff868d24678, 0x72, 0x0)
        /usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(*pollDesc).Wait(0xc210174ed0, 0x72, 0x7ff868d1d0e8, 0xb)
        /usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(*pollDesc).WaitRead(0xc210174ed0, 0xb, 0x7ff868d1d0e8)
        /usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(*netFD).accept(0xc210174e70, 0x744480, 0x0, 0x7ff868d1d0e8, 0xb)
        /usr/lib/go/src/pkg/net/fd_unix.go:382 +0x2c2
net.(*TCPListener).AcceptTCP(0xc2101463b0, 0x4a981b, 0x7ff868ba5e78, 0x4a981b)
        /usr/lib/go/src/pkg/net/tcpsock_posix.go:233 +0x47
net.(*TCPListener).Accept(0xc2101463b0, 0x7ff868d24720, 0xc210146ad0, 0xc21015b100, 0x0)
        /usr/lib/go/src/pkg/net/tcpsock_posix.go:243 +0x27
net/http.(*Server).Serve(0xc21014fd20, 0x7ff868d236d8, 0xc2101463b0, 0x0, 0x0)
        /usr/lib/go/src/pkg/net/http/server.go:1622 +0x91
net/http.(*Server).ListenAndServe(0xc21014fd20, 0xc21014fd20, 0x0)
        /usr/lib/go/src/pkg/net/http/server.go:1612 +0xa0
net/http.ListenAndServe(0xc2101462e0, 0x5, 0x0, 0x0, 0x1, ...)
        /usr/lib/go/src/pkg/net/http/server.go:1677 +0x6d
created by main.startAsServer
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:124 +0x1c1

goroutine 7 [semacquire]:
sync.runtime_Semacquire(0xc210146988)
        /usr/lib/go/src/pkg/runtime/sema.goc:199 +0x30
sync.(*WaitGroup).Wait(0xc210147b80)
        /usr/lib/go/src/pkg/sync/waitgroup.go:127 +0x14b
main.func·007(0x7ff868d24878, 0xc21000f0a0, 0xc2100590d0)
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:121 +0x423
net/http.HandlerFunc.ServeHTTP(0xc210147300, 0x7ff868d24878, 0xc21000f0a0, 0xc2100590d0)
        /usr/lib/go/src/pkg/net/http/server.go:1220 +0x40
net/http.(*ServeMux).ServeHTTP(0xc21001e660, 0x7ff868d24878, 0xc21000f0a0, 0xc2100590d0)
        /usr/lib/go/src/pkg/net/http/server.go:1496 +0x163
net/http.serverHandler.ServeHTTP(0xc21014fd20, 0x7ff868d24878, 0xc21000f0a0, 0xc2100590d0)
        /usr/lib/go/src/pkg/net/http/server.go:1597 +0x16e
net/http.(*conn).serve(0xc21015bd80)
        /usr/lib/go/src/pkg/net/http/server.go:1167 +0x7b7
created by net/http.(*Server).Serve
        /usr/lib/go/src/pkg/net/http/server.go:1644 +0x28b

goroutine 8 [chan receive]:
main.startHID(0xc210038f60, 0xc21017cc00, 0xc21017c000)
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:242 +0x3f7
created by main.func·003
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:264 +0xcd

goroutine 9 [chan receive]:
main.func·005()
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:48 +0x76
created by main.func·007
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:75 +0x311

goroutine 12 [semacquire]:
sync.runtime_Semacquire(0xc210146b70)
        /usr/lib/go/src/pkg/runtime/sema.goc:199 +0x30
sync.(*WaitGroup).Wait(0xc210147e60)
        /usr/lib/go/src/pkg/sync/waitgroup.go:127 +0x14b
main.func·007(0x7ff868d24878, 0xc21011e1e0, 0xc210059340)
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:121 +0x423
net/http.HandlerFunc.ServeHTTP(0xc210147300, 0x7ff868d24878, 0xc21011e1e0, 0xc210059340)
        /usr/lib/go/src/pkg/net/http/server.go:1220 +0x40
net/http.(*ServeMux).ServeHTTP(0xc21001e660, 0x7ff868d24878, 0xc21011e1e0, 0xc210059340)
        /usr/lib/go/src/pkg/net/http/server.go:1496 +0x163
net/http.serverHandler.ServeHTTP(0xc21014fd20, 0x7ff868d24878, 0xc21011e1e0, 0xc210059340)
        /usr/lib/go/src/pkg/net/http/server.go:1597 +0x16e
net/http.(*conn).serve(0xc21015b100)
        /usr/lib/go/src/pkg/net/http/server.go:1167 +0x7b7
created by net/http.(*Server).Serve
        /usr/lib/go/src/pkg/net/http/server.go:1644 +0x28b

goroutine 13 [chan receive]:
main.func·005()
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:48 +0x76
created by main.func·007
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:75 +0x311

goroutine 14 [IO wait]:
net.runtime_pollWait(0x7ff868d24528, 0x72, 0x0)
        /usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(*pollDesc).Wait(0xc2101674c0, 0x72, 0x7ff868d1d0e8, 0xb)
        /usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(*pollDesc).WaitRead(0xc2101674c0, 0xb, 0x7ff868d1d0e8)
        /usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(*netFD).Read(0xc210167460, 0xc21016f000, 0x800, 0x800, 0x0, ...)
        /usr/lib/go/src/pkg/net/fd_unix.go:204 +0x2a0
net.(*conn).Read(0xc210146ad0, 0xc21016f000, 0x800, 0x800, 0x604c40, ...)
        /usr/lib/go/src/pkg/net/net.go:122 +0xc5
bufio.(*Reader).fill(0xc21015fd20)
        /usr/lib/go/src/pkg/bufio/bufio.go:91 +0x110
bufio.(*Reader).Read(0xc21015fd20, 0xc210146c58, 0x2, 0x8, 0x2, ...)
        /usr/lib/go/src/pkg/bufio/bufio.go:159 +0x1a4
github.com/gorilla/websocket.(*Conn).readFull(0xc21014e1e0, 0xc210146c58, 0x2, 0x8, 0x0, ...)
        /home/tech/go/src/github.com/gorilla/websocket/conn.go:542 +0xac
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc21014e1e0, 0x41034c, 0x5f8b20, 0xc21017c000)
        /home/tech/go/src/github.com/gorilla/websocket/conn.go:566 +0x12b
github.com/gorilla/websocket.(*Conn).NextReader(0xc21014e1e0, 0xc21017c000, 0x0, 0x0, 0x0, ...)
        /home/tech/go/src/github.com/gorilla/websocket/conn.go:706 +0x67
main.func·006()
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:82 +0x66
created by main.func·007
        /home/tech/go/src/github.com/openflylab/bridge/uavwebsocket.go:118 +0x367

goroutine 15 [syscall]:
github.com/GeertJohan/go%2ehid._Cfunc_hid_read(0x1b11a40, 0xc21014cf00, 0x40, 0x0)
        github.com/GeertJohan/go.hid/_obj/_cgo_defun.c:169 +0x31
github.com/GeertJohan/go%2ehid.(*Device).Read(0xc210146c60, 0xc21014cf00, 0x40, 0x40, 0x0, ...)
        /home/tech/go/src/github.com/GeertJohan/go.hid/hid.go:440 +0x81
main.func·001()
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:189 +0x22a
created by main.startHID
        /home/tech/go/src/github.com/openflylab/bridge/uavtalk.go:214 +0x361
@jhchabran jhchabran added the bug label Jun 29, 2015
@vitaminwater
Copy link
Contributor

Stinks like a race condition... the thing is that it tried to write on the USB connection after it had been closed.

Are you sure you weren't sending anything ?

vitaminwater added a commit that referenced this issue Jun 29, 2015
@jhchabran
Copy link
Member Author

You're right, I was sending GcsTelemetryStats UAV as it's always done when connecting. Makes more sense now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants