Re: [go-nuts] Hard-to-explain race detector report

2023-06-08 Thread Brian Candler
> In this case however, what is reported is a concurrent write-after-read. Is that really a memory race? In general, it would be: if these accesses are not synchronized, there's a risk that the goroutines could slip relative to each other so that the write and read take place at the same time,

Re: [go-nuts] Hard-to-explain race detector report

2023-06-08 Thread burak serdar
On Wed, Jun 7, 2023 at 2:19 PM Sven Anderson wrote: > > > Caleb Spare schrieb am Mi. 7. Juni 2023 um 19:22: > >> On Wed, Jun 7, 2023 at 2:33 AM Sven Anderson wrote: >> > >> > That’s not only a read/write race, it’s also a write/write race. Every >> request to the server creates a new Go routine

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Sven Anderson
Caleb Spare schrieb am Mi. 7. Juni 2023 um 19:22: > On Wed, Jun 7, 2023 at 2:33 AM Sven Anderson wrote: > > > > That’s not only a read/write race, it’s also a write/write race. Every > request to the server creates a new Go routine that might increment > newConns in parallel, so it may get corru

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Caleb Spare
On Wed, Jun 7, 2023 at 2:33 AM Sven Anderson wrote: > > That’s not only a read/write race, it’s also a write/write race. Every > request to the server creates a new Go routine that might increment newConns > in parallel, so it may get corrupted. Same for lines 39/40. > > You might claim, that fo

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Caleb Spare
On Wed, Jun 7, 2023 at 7:05 AM Ian Lance Taylor wrote: > > On Tue, Jun 6, 2023 at 4:31 PM Caleb Spare wrote: > > > > Can someone explain why the following test shows a race between the > > indicated lines? > > > > https://github.com/cespare/misc/blob/b2e201dfbe36504c88e521e02bc5d8fbb04a4532/http

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Ian Lance Taylor
On Tue, Jun 6, 2023 at 4:31 PM Caleb Spare wrote: > > Can someone explain why the following test shows a race between the > indicated lines? > > https://github.com/cespare/misc/blob/b2e201dfbe36504c88e521e02bc5d8fbb04a4532/httprace/httprace_test.go#L12-L43 > > The race seems to be triggered by th

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread burak serdar
On Wed, Jun 7, 2023, 12:33 PM Sven Anderson wrote: > That’s not only a read/write race, it’s also a write/write race. Every > request to the server creates a new Go routine that might increment > newConns in parallel, so it may get corrupted. Same for lines 39/40. > The write/write race will hap

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Sven Anderson
That’s not only a read/write race, it’s also a write/write race. Every request to the server creates a new Go routine that might increment newConns in parallel, so it may get corrupted. Same for lines 39/40. You might claim, that for infrastructural reasons, there can be no concurrent requests to

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread burak serdar
On Tue, Jun 6, 2023 at 5:31 PM Caleb Spare wrote: > Can someone explain why the following test shows a race between the > indicated lines? > > > https://github.com/cespare/misc/blob/b2e201dfbe36504c88e521e02bc5d8fbb04a4532/httprace/httprace_test.go#L12-L43 > > The race seems to be triggered by t

[go-nuts] Hard-to-explain race detector report

2023-06-06 Thread Caleb Spare
Can someone explain why the following test shows a race between the indicated lines? https://github.com/cespare/misc/blob/b2e201dfbe36504c88e521e02bc5d8fbb04a4532/httprace/httprace_test.go#L12-L43 The race seems to be triggered by the very last line of the test: get(client1) If I comment that