TeamSpeak crashes when I add too many people

If you add too many people, TeamSpeak will crash at some point.

See the logs:

fatal error: concurrent map writes
fatal error: concurrent map writes

goroutine 9277 [running]:
tschat_client_lib/client.(*InMemoryStore).StoreIgnoredUser(0xc000302b60?, 0xc0003b20a0)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/store.go:513 +0x33
tschat_client_lib/client.(*MatrixClient).processAccountData.func1()
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_multi.go:60 +0xdd
created by tschat_client_lib/client.(*MatrixClient).processAccountData
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_multi.go:58 +0x2e5

goroutine 6 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc0002d8840?, 0xc0002d88a0?})
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:38 +0x92

goroutine 7 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc0002d8840?, 0xc0002d88a0?})
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:38 +0x92

goroutine 8 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc0002d8840?, 0xc0002d88a0?})
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:38 +0x92

goroutine 9 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc0002d8840?, 0xc0002d88a0?})
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/blevesearch/[email protected]/analysis.go:38 +0x92

goroutine 11 [select, 22 minutes]:
database/sql.(*DB).connectionOpener(0xc000312000, {0x7ffdfe70eb98, 0xc00007a840})
	C:/Program Files/Go/src/database/sql/sql.go:1224 +0x8d
created by database/sql.OpenDB
	C:/Program Files/Go/src/database/sql/sql.go:792 +0x18d

goroutine 12 [select]:
tschat_client_lib/client.(*SearchLib).writerCoordinatorThread(0xc00007af00)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/search_lib.go:563 +0xb0
created by tschat_client_lib/client.CreateSearchLib
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/search_lib.go:148 +0x3e5

goroutine 95 [IO wait]:
internal/poll.runtime_pollWait(0x2756f720f08, 0x72)
	C:/Program Files/Go/src/runtime/netpoll.go:305 +0x89
internal/poll.(*pollDesc).wait(0xc000024bb0?, 0x2c?, 0x0)
	C:/Program Files/Go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.execIO(0xc000005698, 0x7ffdfe650410)
	C:/Program Files/Go/src/internal/poll/fd_windows.go:175 +0xe5
internal/poll.(*FD).Read(0xc000005680, {0xc000220000, 0xa000, 0xa000})
	C:/Program Files/Go/src/internal/poll/fd_windows.go:441 +0x26b
net.(*netFD).Read(0xc000005680, {0xc000220000?, 0xc000090ba0?, 0xc000220005?})
	C:/Program Files/Go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc00000a078, {0xc000220000?, 0xc0000c7810?, 0x107ffdfdb88f33?})
	C:/Program Files/Go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc000008288, {0xc000220000?, 0x0?, 0xdd?})
	C:/Program Files/Go/src/crypto/tls/conn.go:787 +0x3d
bytes.(*Buffer).ReadFrom(0xc00009acf8, {0x7ffdfe709a20, 0xc000008288})
	C:/Program Files/Go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc00009aa80, {0x2756f720ff8?, 0xc00000a078}, 0xa000?)
	C:/Program Files/Go/src/crypto/tls/conn.go:809 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc00009aa80, 0x0)
	C:/Program Files/Go/src/crypto/tls/conn.go:616 +0x116
crypto/tls.(*Conn).readRecord(...)
	C:/Program Files/Go/src/crypto/tls/conn.go:582
crypto/tls.(*Conn).Read(0xc00009aa80, {0xc0001d2000, 0x1000, 0x7ffdfe1f0780?})
	C:/Program Files/Go/src/crypto/tls/conn.go:1287 +0x16f
bufio.(*Reader).Read(0xc00007d8c0, {0xc0001c49e0, 0x9, 0x7ffdfe1febc5?})
	C:/Program Files/Go/src/bufio/bufio.go:237 +0x1bb
io.ReadAtLeast({0x7ffdfe7098a0, 0xc00007d8c0}, {0xc0001c49e0, 0x9, 0x9}, 0x9)
	C:/Program Files/Go/src/io/io.go:332 +0x9a
io.ReadFull(...)
	C:/Program Files/Go/src/io/io.go:351
net/http.http2readFrameHeader({0xc0001c49e0?, 0x9?, 0xc00099e4b0?}, {0x7ffdfe7098a0?, 0xc00007d8c0?})
	C:/Program Files/Go/src/net/http/h2_bundle.go:1565 +0x6e
net/http.(*http2Framer).ReadFrame(0xc0001c49a0)
	C:/Program Files/Go/src/net/http/h2_bundle.go:1829 +0x95
net/http.(*http2clientConnReadLoop).run(0xc0000c7f98)
	C:/Program Files/Go/src/net/http/h2_bundle.go:8875 +0x130
net/http.(*http2ClientConn).readLoop(0xc000324480)
	C:/Program Files/Go/src/net/http/h2_bundle.go:8771 +0x6f
created by net/http.(*http2Transport).newClientConn
	C:/Program Files/Go/src/net/http/h2_bundle.go:7478 +0xaaa

goroutine 78 [chan send, 22 minutes]:
tschat_client_lib/client.(*DevicesList).CheckExpiredDevices.func1()
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/devices_list.go:65 +0x446
created by tschat_client_lib/client.(*DevicesList).CheckExpiredDevices
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/devices_list.go:28 +0xcc

goroutine 79 [select, 22 minutes]:
tschat_client_lib/client.(*MatrixClient).periodicUploadKeys.func1()
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/client.go:257 +0x7d
created by tschat_client_lib/client.(*MatrixClient).periodicUploadKeys
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/client.go:255 +0xdc

goroutine 83 [sleep]:
time.Sleep(0x1dcd6500)
	C:/Program Files/Go/src/runtime/time.go:195 +0x13c
tschat_client_lib/client.(*MatrixClient).run(0xc000302b60)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/client.go:1976 +0xda
created by tschat_client_lib/client.(*MatrixClient).Start
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/client.go:354 +0x185

goroutine 9278 [running]:
	goroutine running on other thread; stack unavailable
created by tschat_client_lib/client.(*MatrixClient).processAccountData
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_multi.go:58 +0x2e5

goroutine 9244 [runnable]:
github.com/mattn/go-sqlite3._Cfunc_sqlite3_reset(0x2756f1811f8)
	_cgo_gotypes.go:1001 +0x5a
github.com/mattn/go-sqlite3.(*SQLiteStmt).bind.func1(0xc00010b610?)
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/mattn/[email protected]/sqlite3.go:1914 +0x46
github.com/mattn/go-sqlite3.(*SQLiteStmt).bind(0xc000314240, {0xc00023e240, 0x1, 0x28?})
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/mattn/[email protected]/sqlite3.go:1914 +0x46
github.com/mattn/go-sqlite3.(*SQLiteStmt).query(0xc000314240, {0x7ffdfe70ebd0?, 0xc00001a0a8}, {0xc00023e240?, 0x0?, 0x7ffdfe548fe0?})
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/mattn/[email protected]/sqlite3.go:1994 +0x3f
github.com/mattn/go-sqlite3.(*SQLiteStmt).QueryContext(0x0?, {0x7ffdfe70ebd0, 0xc00001a0a8}, {0xc0002823f0, 0x1, 0x7ffdfe2d9e97?})
	C:/Windows/system32/config/systemprofile/go/pkg/mod/github.com/mattn/[email protected]/sqlite3_go18.go:60 +0x8d
database/sql.ctxDriverStmtQuery({0x7ffdfe70ebd0, 0xc00001a0a8}, {0x7ffdfe70f228, 0xc000314240}, {0xc0002823f0?, 0x1, 0x1})
	C:/Program Files/Go/src/database/sql/ctxutil.go:82 +0xcc
database/sql.rowsiFromStatement({0x7ffdfe70ebd0, 0xc00001a0a8}, {0x7ffdfe70e208, 0xc00007c6c0}, 0xc00007ab00, {0xc00010ba58, 0x1, 0x1})
	C:/Program Files/Go/src/database/sql/sql.go:2835 +0x17e
database/sql.(*Stmt).QueryContext(0xc00017c990, {0x7ffdfe70ebd0, 0xc00001a0a8}, {0xc00010ba58, 0x1, 0x1})
	C:/Program Files/Go/src/database/sql/sql.go:2784 +0x205
database/sql.(*Stmt).Query(...)
	C:/Program Files/Go/src/database/sql/sql.go:2825
tschat_client_lib/db.(*persistentCache).GetNotExportedGroupSessions(0xc00002dee0)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/db/persistent_cache.go:290 +0xc5
tschat_client_lib/matrix.(*CryptoStorage).CheckForExportableGroupSessions(0xc00017d320, 0xc000388010)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/matrix/crypto_storage.go:412 +0xe6
tschat_client_lib/client.(*MatrixClient).processSyncData(0xc000302b60, {{{0xc00036c000, 0x2, 0x4}}, {0xc0003f63c0, 0x0, 0x0}, {{0xc00036c2c0, 0x1, 0x4}}, ...}, ...)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_sync.go:169 +0x418
tschat_client_lib/client.(*MatrixClient).syncLoop.func1({0x0?, 0x0?}, {{{0xc00036c000, 0x2, 0x4}}, {0xc0003f63c0, 0x0, 0x0}, {{0xc00036c2c0, 0x1, ...}}, ...}, ...)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/client.go:2032 +0x165
tschat_client_lib/client.(*MatrixClient).doSync(0xc000302b60, 0xc000250080)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/client.go:2062 +0x2a8
created by tschat_client_lib/client.(*MatrixClient).syncLoop
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/client.go:1987 +0xbc

goroutine 9280 [runnable]:
tschat_client_lib/client.(*SearchLib).scheduleBatch.func1()
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/search_lib.go:476 +0xc5
created by tschat_client_lib/client.(*SearchLib).scheduleBatch
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/search_lib.go:474 +0x16b

goroutine 9284 [runnable]:
tschat_client_lib/client.(*MatrixClient).tryDecryptStoredMessages.func2()
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_crypto.go:632
runtime.goexit()
	C:/Program Files/Go/src/runtime/asm_amd64.s:1594 +0x1
created by tschat_client_lib/client.(*MatrixClient).tryDecryptStoredMessages
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_crypto.go:632 +0xe5

goroutine 9278 [running]:
tschat_client_lib/client.(*InMemoryStore).StoreIgnoredUser(0xc000302b60?, 0xc000b40bc0)
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/store.go:513 +0x33
tschat_client_lib/client.(*MatrixClient).processAccountData.func1()
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_multi.go:60 +0xdd
created by tschat_client_lib/client.(*MatrixClient).processAccountData
	C:/builds/hxz19fiJ/0/teamspeak/teamspeak_client_ui_v2/deps/tschat_client_lib/lib/tschat_client_lib/client/process_multi.go:58 +0x2e5

The problem is the ignore list. Adding or removing can randomly cause a crash.

We will fix that.

4 Likes