Skip to content

Concurrent map read/write in hci.go #21

@moogle19

Description

@moogle19
fatal error: concurrent map read and map write

goroutine 67 [running]:
runtime.throw(0x4a5701, 0x21)
	/usr/local/Cellar/go/1.10.2/libexec/src/runtime/panic.go:616 +0x60 fp=0x10e8ae3c sp=0x10e8ae30 pc=0x3b364
runtime.mapaccess2_fast32(0x426160, 0x10d5c0c0, 0x2009, 0x10e22900, 0x40)
	/usr/local/Cellar/go/1.10.2/libexec/src/runtime/hashmap_fast.go:61 +0x1b0 fp=0x10e8ae4c sp=0x10e8ae3c pc=0x19f4c
github.com/go-ble/ble/linux/hci.(*HCI).handleCommandComplete(0x10ddc000, 0x10c1cdf3, 0x4, 0x4, 0x2, 0x3ea8c)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:415 +0x13c fp=0x10e8ae9c sp=0x10e8ae4c pc=0x2e9eec
github.com/go-ble/ble/linux/hci.(*HCI).(github.com/go-ble/ble/linux/hci.handleCommandComplete)-fm(0x10c1cdf3, 0x4, 0x4, 0x10c7c11c, 0x43754)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:121 +0x34 fp=0x10e8aeb8 sp=0x10e8ae9c pc=0x2ed7e8
github.com/go-ble/ble/linux/hci.(*HCI).handleEvt(0x10ddc000, 0x10c1cdf1, 0x6, 0x6, 0x10c2393c, 0x10d800f0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:334 +0x1f0 fp=0x10e8af10 sp=0x10e8aeb8 pc=0x2e96c4
github.com/go-ble/ble/linux/hci.(*HCI).handlePkt(0x10ddc000, 0x10c1cdf0, 0x7, 0x7, 0x7, 0x7)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:306 +0x238 fp=0x10e8af88 sp=0x10e8af10 pc=0x2e91f8
github.com/go-ble/ble/linux/hci.(*HCI).sktLoop(0x10ddc000)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:277 +0x124 fp=0x10e8afe4 sp=0x10e8af88 pc=0x2e8cc0
runtime.goexit()
	/usr/local/Cellar/go/1.10.2/libexec/src/runtime/asm_arm.s:1015 +0x4 fp=0x10e8afe4 sp=0x10e8afe4 pc=0x6575c
created by github.com/go-ble/ble/linux/hci.(*HCI).Init
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:147 +0x4d0

goroutine 1 [select]:
main.mainLoop(0x10e22200, 0x10e4e3c0, 0x10e4e400, 0x10e4e440, 0x10e74600, 0x4, 0x0, 0x0)
	/Users/kevin/go/src/zahlz.com/core/zahlzbox/cmd/indoor/main.go:133 +0x188
main.main()
	/Users/kevin/go/src/zahlz.com/core/zahlzbox/cmd/indoor/main.go:115 +0x3f0

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/runtime/sigqueue.go:139 +0x130
os/signal.loop()
	/usr/local/Cellar/go/1.10.2/libexec/src/os/signal/signal_unix.go:22 +0x14
created by os/signal.init.0
	/usr/local/Cellar/go/1.10.2/libexec/src/os/signal/signal_unix.go:28 +0x30

goroutine 26 [select]:
github.com/go-ble/ble/linux/hci.(*HCI).Accept(0x10ddc000, 0x0, 0x0, 0x0, 0x0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/gap.go:185 +0x108
github.com/go-ble/ble/linux.loop(0x10ddc000, 0x10d18460, 0x203)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/device.go:52 +0x1c
created by github.com/go-ble/ble/linux.NewDeviceWithNameAndHandler
	/Users/kevin/go/src/github.com/go-ble/ble/linux/device.go:45 +0xbc

goroutine 50 [IO wait]:
internal/poll.runtime_pollWait(0xf7eecec0, 0x72, 0x10ee2400)
	/usr/local/Cellar/go/1.10.2/libexec/src/runtime/netpoll.go:173 +0x44
internal/poll.(*pollDesc).wait(0x10de0154, 0x72, 0xffffff00, 0x4faf28, 0x6d00f0)
	/usr/local/Cellar/go/1.10.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0x8c
internal/poll.(*pollDesc).waitRead(0x10de0154, 0x10ee2400, 0x400, 0x400)
	/usr/local/Cellar/go/1.10.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x2c
internal/poll.(*FD).Read(0x10de0140, 0x10ee2400, 0x400, 0x400, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/internal/poll/fd_unix.go:157 +0x148
net.(*netFD).Read(0x10de0140, 0x10ee2400, 0x400, 0x400, 0x93e04, 0x10ef8288, 0xeb768)
	/usr/local/Cellar/go/1.10.2/libexec/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x10d94388, 0x10ee2400, 0x400, 0x400, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/net/net.go:176 +0x58
crypto/tls.(*block).readFromUntil(0x10d747e0, 0xf7e6c050, 0x10d94388, 0x5, 0x10d94388, 0x10ef8288)
	/usr/local/Cellar/go/1.10.2/libexec/src/crypto/tls/conn.go:493 +0x78
crypto/tls.(*Conn).readRecord(0x10ede000, 0x4b8317, 0x10ede0a0, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/crypto/tls/conn.go:595 +0x9c
crypto/tls.(*Conn).Read(0x10ede000, 0x10e4d000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/crypto/tls/conn.go:1156 +0xcc
bufio.(*Reader).fill(0x10c7e1e0)
	/usr/local/Cellar/go/1.10.2/libexec/src/bufio/bufio.go:100 +0x104
bufio.(*Reader).Peek(0x10c7e1e0, 0x2, 0xea468, 0xea48c, 0x5d, 0x8, 0xe7e14)
	/usr/local/Cellar/go/1.10.2/libexec/src/bufio/bufio.go:132 +0x28
github.com/gorilla/websocket.(*Conn).read(0x10ea0210, 0x2, 0x2, 0xe8584, 0x10c781b0, 0x4207a8, 0x10ef8290)
	/Users/kevin/go/src/github.com/gorilla/websocket/conn_read.go:12 +0x28
github.com/gorilla/websocket.(*Conn).advanceFrame(0x10ea0210, 0x10e860e0, 0x8, 0x10e4e42c)
	/Users/kevin/go/src/github.com/gorilla/websocket/conn.go:689 +0x60
github.com/gorilla/websocket.(*Conn).NextReader(0x10ea0210, 0x10d66030, 0x4, 0x10e4e400, 0x10e6df98, 0x1)
	/Users/kevin/go/src/github.com/gorilla/websocket/conn.go:844 +0x68
github.com/gorilla/websocket.(*Conn).ReadMessage(0x10ea0210, 0x4a2509, 0x1c, 0x0, 0x0, 0x0, 0x0)
	/Users/kevin/go/src/github.com/gorilla/websocket/conn.go:921 +0x1c
zahlz.com/core/boxmgmt/client.readUpdates(0x10ea0210, 0x10e4e3c0, 0x10e4e400, 0x0, 0x0)
	/Users/kevin/go/src/zahlz.com/core/boxmgmt/client/client.go:66 +0x50
zahlz.com/core/boxmgmt/client.(*Client).Run(0x10d94330, 0x10e4e3c0, 0x10e4e400, 0x10e4e440)
	/Users/kevin/go/src/zahlz.com/core/boxmgmt/client/client.go:55 +0x104
created by main.main
	/Users/kevin/go/src/zahlz.com/core/zahlzbox/cmd/indoor/main.go:90 +0x2c8

goroutine 25 [IO wait]:
internal/poll.runtime_pollWait(0xf7eecf40, 0x72, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/runtime/netpoll.go:173 +0x44
internal/poll.(*pollDesc).wait(0x10c7c064, 0x72, 0xc3d00, 0x0, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0x8c
internal/poll.(*pollDesc).waitRead(0x10c7c064, 0xffffff00, 0x0, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x2c
internal/poll.(*FD).Accept(0x10c7c050, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.10.2/libexec/src/internal/poll/fd_unix.go:372 +0x174
net.(*netFD).accept(0x10c7c050, 0x10d92038, 0x1, 0x1)
	/usr/local/Cellar/go/1.10.2/libexec/src/net/fd_unix.go:238 +0x20
net.(*TCPListener).accept(0x10d92040, 0x4fb678, 0x10d5c020, 0xc)
	/usr/local/Cellar/go/1.10.2/libexec/src/net/tcpsock_posix.go:136 +0x20
net.(*TCPListener).Accept(0x10d92040, 0x3, 0x10d1c040, 0xc, 0x4fc3d8)
	/usr/local/Cellar/go/1.10.2/libexec/src/net/tcpsock.go:259 +0x3c
zahlz.com/core/opi/server.(*Server).ListenAndServe(0x10d18140, 0x4a13b5, 0x1b)
	/Users/kevin/go/src/zahlz.com/core/opi/server/server.go:42 +0x118
main.applyConfig.func1(0x10c1c150, 0xc)
	/Users/kevin/go/src/zahlz.com/core/zahlzbox/cmd/indoor/config.go:95 +0x94
created by main.applyConfig
	/Users/kevin/go/src/zahlz.com/core/zahlzbox/cmd/indoor/config.go:93 +0x370

goroutine 68 [chan receive]:
github.com/go-ble/ble/linux/hci.(*HCI).send(0x10ddc000, 0x4fc038, 0x10ddc020, 0x1514b8, 0x10d5c1c8, 0xffffffff, 0x0, 0x1)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:242 +0xb4
github.com/go-ble/ble/linux/hci.(*HCI).Send(0x10ddc000, 0x4fc038, 0x10ddc020, 0x0, 0x0, 0x10d22701, 0x10d50001)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:224 +0x2c
github.com/go-ble/ble/linux/hci.(*HCI).StopAdvertising(0x10ddc000, 0x0, 0x10de00a0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/gap.go:176 +0x40
github.com/go-ble/ble/linux.(*Device).Advertise(0x10c0c7e8, 0x4fceb8, 0x10d5c1c0, 0x4fe1a8, 0x10de00a0, 0x10d227c0, 0x0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/device.go:110 +0x84
zahlz.com/core/zable.(*Server).advertise(0x10c7c0a0, 0x4fceb8, 0x10d5c1c0)
	/Users/kevin/go/src/zahlz.com/core/zable/server.go:306 +0x1f0
created by zahlz.com/core/zable.(*Server).Advertise
	/Users/kevin/go/src/zahlz.com/core/zable/server.go:287 +0x134

goroutine 70 [select]:
github.com/go-ble/ble/linux/hci.(*HCI).send(0x10ddc000, 0x4fc1b8, 0x10ddc043, 0x10c1cdcd, 0x1, 0x1, 0x2e752c, 0x10ddc04c)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:258 +0x350
github.com/go-ble/ble/linux/hci.(*HCI).Send(0x10ddc000, 0x4fc1b8, 0x10ddc043, 0x0, 0x0, 0x0, 0x0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:224 +0x2c
github.com/go-ble/ble/linux/hci.(*HCI).SetAdvertisement(0x10ddc000, 0x10e1c540, 0x1f, 0x1f, 0x10e1c560, 0x8, 0x1f, 0xf7f486c8, 0x48)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/gap.go:261 +0x100
github.com/go-ble/ble/linux/hci.(*HCI).AdvertiseAdv(0x10ddc000, 0x4fe1a8, 0x10dde140, 0x10fc4601, 0x10dde140)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/gap.go:80 +0x260
github.com/go-ble/ble/linux.(*Device).Advertise(0x10c0c7e8, 0x4fceb8, 0x10d5c5a0, 0x4fe1a8, 0x10dde140, 0x10fc4620, 0x0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/device.go:106 +0x30
zahlz.com/core/zable.(*Server).advertise(0x10c7c0a0, 0x4fceb8, 0x10d5c5a0)
	/Users/kevin/go/src/zahlz.com/core/zable/server.go:306 +0x1f0
created by zahlz.com/core/zable.(*Server).SetManufacturerData
	/Users/kevin/go/src/zahlz.com/core/zable/server.go:201 +0x1dc

goroutine 71 [select]:
github.com/go-ble/ble/linux/hci.(*HCI).send(0x10ddc000, 0x4fc1b8, 0x10ddc043, 0x10c1cde6, 0x1, 0x1, 0x2e752c, 0x10ddc04c)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:258 +0x350
github.com/go-ble/ble/linux/hci.(*HCI).Send(0x10ddc000, 0x4fc1b8, 0x10ddc043, 0x0, 0x0, 0x0, 0x0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/hci.go:224 +0x2c
github.com/go-ble/ble/linux/hci.(*HCI).SetAdvertisement(0x10ddc000, 0x10ed0f00, 0x1f, 0x1f, 0x10ed0f20, 0x8, 0x1f, 0xf7f48000, 0x48)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/gap.go:261 +0x100
github.com/go-ble/ble/linux/hci.(*HCI).AdvertiseAdv(0x10ddc000, 0x4fe1a8, 0x10dc8190, 0x10d61c01, 0x10dc8190)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/hci/gap.go:80 +0x260
github.com/go-ble/ble/linux.(*Device).Advertise(0x10c0c7e8, 0x4fceb8, 0x10d5c5e0, 0x4fe1a8, 0x10dc8190, 0x10d61cd0, 0x0)
	/Users/kevin/go/src/github.com/go-ble/ble/linux/device.go:106 +0x30
zahlz.com/core/zable.(*Server).advertise(0x10c7c0a0, 0x4fceb8, 0x10d5c5e0)
	/Users/kevin/go/src/zahlz.com/core/zable/server.go:306 +0x1f0
created by zahlz.com/core/zable.(*Server).SetManufacturerData
	/Users/kevin/go/src/zahlz.com/core/zable/server.go:201 +0x1dc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions