Closed christf closed 4 years ago
VECTOR_GETINDEX is broken. Considering this log:
Initializing socket: 1705
starting loop
clientmgr: creating client: 3869592022
ADDING client 3869592022
hostname of peer: localhost
added client 3869592022(localhost) to stream default
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
clientmgr: creating client: 2
ADDING client 2
hostname of peer: fda0:fc66:c0b6:0:76da:38ff:fe8b:ac08
added client 2(fda0:fc66:c0b6:0:76da:38ff:fe8b:ac08) to stream default
Refreshing Client (2) has IP fda0:fc66:c0b6:0:76da:38ff:fe8b:ac08, port 55940
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
REMOVING client 2, 1 clients left in stream.
Client fda0:fc66:c0b6:0:76da:38ff:fe8b:ac08(2) has IP fda0:fc66:c0b6:0:76da:38ff:fe8b:ac08, port 55940
removing client at vector elemend 0
clientmgr: creating client: 3869592022
ADDING client 3869592022
hostname of peer: localhost
added client 3869592022(localhost) to stream default
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
REMOVING client 3869592022, 1 clients left in stream.
Client localhost(3869592022) has IP ::ffff:127.0.0.1, port 52514
removing client at vector element 0
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
Refreshing Client (3869592022) has IP ::ffff:127.0.0.1, port 52514
the client with id 2 is stored at index 1 instead of index 0. As a result, the wrong client is removed. This explains the symptoms as task queue items are later attempted to be unlinked that have already expired.
Asan says there is a problem when refreshing clients. I am not sure what triggers this but sometimes(TM) the server crashes when built with asan displaying this trace:
before that, sometimes but not always this is in the logs: