miningmeter/stratum-proxy

Data Race: worker.Disconnect()

Opened this issue · 0 comments

Motivation:

Investigating a suspicious malfunctionality with NiceHash. We have observed an asic miner, antminer s9, stops submitting on nicehash after roughly 10 minutes. and even after the time nicehash closes our connection, the worker goes to the stall mode. so I guessed that might be a deadlock situation.

Platform:

OS:
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
Kernel: 4.15.0-23-generic

Go version: go1.14 linux/amd64

Hardware: Antminer S9

Pool: stratum+tcp://sha256.eu.nicehash.com:3334

Details:

==================
WARNING: DATA RACE
Read at 0x00c000020f90 by goroutine 61:
runtime.mapaccess2_faststr()
/usr/local/go/src/runtime/map_faststr.go:107 +0x0
main.(*Workers).get()
/home/max/go/src/github.com/miningmeter/stratum-proxy/workers.go:29 +0x262
main.(*Workers).remove()
/home/max/go/src/github.com/miningmeter/stratum-proxy/workers.go:38 +0x28e
main.(*Worker).Death()
/home/max/go/src/github.com/miningmeter/stratum-proxy/worker.go:690 +0x21f

Previous write at 0x00c000020f90 by goroutine 45:
runtime.mapdelete_faststr()
/usr/local/go/src/runtime/map_faststr.go:297 +0x0
main.(*Workers).remove()
/home/max/go/src/github.com/miningmeter/stratum-proxy/workers.go:39 +0x14f8
main.(*Worker).Death()
/home/max/go/src/github.com/miningmeter/stratum-proxy/worker.go:690 +0x21f

Goroutine 61 (running) created at:
main.(*Worker).Disconnect()
/home/max/go/src/github.com/miningmeter/stratum-proxy/worker.go:666 +0x1c5
main.Disconnect()
/home/max/go/src/github.com/miningmeter/stratum-proxy/server.go:177 +0x88

Goroutine 45 (finished) created at:
main.(*Worker).Disconnect()
/home/max/go/src/github.com/miningmeter/stratum-proxy/worker.go:666 +0x1c5
main.Disconnect()
/home/max/go/src/github.com/miningmeter/stratum-proxy/server.go:177 +0x88