Skip to content

Instantly share code, notes, and snippets.

@marzocchi
Last active March 28, 2021 22:01
Show Gist options
  • Save marzocchi/9e56aedd9f9bd029622b01dcc40f2946 to your computer and use it in GitHub Desktop.
Save marzocchi/9e56aedd9f9bd029622b01dcc40f2946 to your computer and use it in GitHub Desktop.
data races @ hc
==================
WARNING: DATA RACE
Write at 0x00c00062e050 by goroutine 32:
github.com/brutella/hc/hap.(*session).SetCryptographer()
/Users/marzocchi/projects/hc/hap/session.go:100 +0x3e
github.com/brutella/hc/hap/endpoint.(*PairVerify).ServeHTTP()
/Users/marzocchi/projects/hc/hap/endpoint/pair-verify.go:71 +0x7d6
net/http.(*ServeMux).ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2448 +0xaf
net/http.serverHandler.ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2887 +0xca
net/http.(*conn).serve()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:1952 +0x87d
Previous read at 0x00c00062e050 by goroutine 46:
github.com/brutella/hc/hap.(*session).Decrypter()
/Users/marzocchi/projects/hc/hap/session.go:74 +0x47
github.com/brutella/hc/hap.(*Connection).getDecrypter()
/Users/marzocchi/projects/hc/hap/connection.go:159 +0xa7
github.com/brutella/hc/hap.(*Connection).Read()
/Users/marzocchi/projects/hc/hap/connection.go:103 +0x3c
net/http.(*connReader).backgroundRead()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:692 +0x9e
Goroutine 32 (running) created at:
net/http.(*Server).Serve()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:3013 +0x644
github.com/brutella/hc/hap/http.(*Server).listenAndServe()
/Users/marzocchi/projects/hc/hap/http/server.go:106 +0x214
github.com/brutella/hc/hap/http.(*Server).ListenAndServe()
/Users/marzocchi/projects/hc/hap/http/server.go:97 +0xd8
github.com/brutella/hc.(*ipTransport).Start.func2()
/Users/marzocchi/projects/hc/ip_transport.go:190 +0x50
Goroutine 46 (running) created at:
net/http.(*connReader).startBackgroundRead()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:688 +0x18c
net/http.(*connReader).startBackgroundRead-fm()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:677 +0x4a
net/http.(*body).readLocked()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/transfer.go:880 +0x1f9
net/http.(*body).Read()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/transfer.go:834 +0x15c
io.ReadAtLeast()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/io/io.go:328 +0x9c
io.ReadFull()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/io/io.go:347 +0x2e4
encoding/binary.Read()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/encoding/binary/binary.go:256 +0x2ef
github.com/brutella/hc/util.NewTLV8ContainerFromReader()
/Users/marzocchi/projects/hc/util/tlv8.go:40 +0x32a
github.com/brutella/hc/hap/endpoint.(*PairVerify).ServeHTTP()
/Users/marzocchi/projects/hc/hap/endpoint/pair-verify.go:54 +0x3ac
net/http.(*ServeMux).ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2448 +0xaf
net/http.serverHandler.ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2887 +0xca
net/http.(*conn).serve()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:1952 +0x87d
==================
DEBUG 2021/03/28 23:14:19 accessories.go:13: 127.0.0.1:61107 GET /accessories
DEBUG 2021/03/28 23:14:19 pair-verify.go:37: 192.168.88.14:53203 POST /pair-verify
DEBUG 2021/03/28 23:14:19 pair-verify.go:44: Create new pair verify controller
DEBUG 2021/03/28 23:14:19 verify_server_controller.go:93: -> A: 90eb89ae20f360d00801df0358a008f492819e0f252e2a95045bc0cfe48df66f
DEBUG 2021/03/28 23:14:19 verify_server_controller.go:127: K: a589f1d83bcdf95dcf6dfe2cbdd1662e91742823f53008274fe42a3acfb7fd25
DEBUG 2021/03/28 23:14:19 verify_server_controller.go:128: B: 56b9ba75669993fb4959953817232d15e9acd8f4916079715a1a08dba85d9104
DEBUG 2021/03/28 23:14:19 verify_server_controller.go:129: S: 6b9dcd062acd100263c121137e48f895729c2bb3dbe974fde5b6287a1657b5b6
DEBUG 2021/03/28 23:14:19 verify_server_controller.go:130: Shared: 3dc83c3cd014c85efb2420cb64a9256c20d8e7a459ced5939b68db770cf0fb10
DEBUG 2021/03/28 23:14:19 verify_server_controller.go:132: <- B: 56b9ba75669993fb4959953817232d15e9acd8f4916079715a1a08dba85d9104
DEBUG 2021/03/28 23:14:19 characteristics.go:102: 127.0.0.1:61107 PUT /characteristics
DEBUG 2021/03/28 23:14:19 characteristics.go:107: {"characteristics":[{"aid":
==================
WARNING: DATA RACE
Write at 0x00c0001ae5e0 by goroutine 7:
github.com/brutella/hc/characteristic.(*Characteristic).updateValue()
/Users/marzocchi/projects/hc/characteristic/characteristic.go:143 +0x47a
github.com/brutella/hc/characteristic.(*Characteristic).UpdateValue()
/Users/marzocchi/projects/hc/characteristic/characteristic.go:66 +0xed
github.com/brutella/hc/characteristic.(*Bool).SetValue()
/Users/marzocchi/projects/hc/characteristic/bool.go:20 +0x9e
main.main.func2()
/Users/marzocchi/projects/hc/_example/example/main.go:43 +0x4a
Previous read at 0x00c0001ae5e0 by goroutine 51:
github.com/brutella/hc/characteristic.(*Characteristic).getValue()
/Users/marzocchi/projects/hc/characteristic/characteristic.go:113 +0x66
github.com/brutella/hc/characteristic.(*Characteristic).GetValueFromConnection()
/Users/marzocchi/projects/hc/characteristic/characteristic.go:58 +0x48b
github.com/brutella/hc/hap/http.(*Server).Characteristics()
/Users/marzocchi/projects/hc/hap/http/characteristics.go:74 +0x48c
github.com/brutella/hc/hap/http.(*Server).Characteristics-fm()
/Users/marzocchi/projects/hc/hap/http/characteristics.go:52 +0x68
net/http.HandlerFunc.ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2069 +0x51
github.com/brutella/hc/hap/http.(*Server).Authenticate.func1()
/Users/marzocchi/projects/hc/hap/http/characteristics.go:47 +0x1fc
net/http.HandlerFunc.ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2069 +0x51
net/http.(*ServeMux).ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2448 +0xaf
net/http.serverHandler.ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2887 +0xca
net/http.(*conn).serve()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:1952 +0x87d
Goroutine 7 (running) created at:
main.main()
/Users/marzocchi/projects/hc/_example/example/main.go:35 +0x3e4
Goroutine 51 (running) created at:
net/http.(*Server).Serve()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:3013 +0x644
github.com/brutella/hc/hap/http.(*Server).listenAndServe()
/Users/marzocchi/projects/hc/hap/http/server.go:106 +0x214
github.com/brutella/hc/hap/http.(*Server).ListenAndServe()
/Users/marzocchi/projects/hc/hap/http/server.go:97 +0xd8
github.com/brutella/hc.(*ipTransport).Start.func2()
/Users/marzocchi/projects/hc/ip_transport.go:190 +0x50
==================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment