Skip to content

Data race in streamImpl: concurrent access to LastByteSent/FirstByteSent #7

@NikoMalik

Description

@NikoMalik

Description:

When running tests with the -race flag, gosec detects data races in streamImpl methods LastByteSent() and FirstByteSent(). The race occurs due to concurrent reads (in sender's multiCB callback) and writes (in StreamsPool.Acquire()) on the shared fields of streamImpl.

Read at 0x00c0006166e0 by goroutine 27:
  ...streamImpl.LastByteSent()
  ...sender.multiCB.Call() at sender.go:308

Previous write at 0x00c0006166e0 by goroutine 22:
  ...StreamsPool.Acquire() at pool.go:51

and similarly for FirstByteSent().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions