moby / moby/buildkit

solver: protect field access with lock to avoid potential data race

Open
#3,922 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
50

Description

Description

It seems to be a potential data race. Specifically, there are two confilicting operations on the field "edges", where the read operation at: solver/jobs.go:187, and the write operation at: solver/jobs.go:151. A data race may occurs when the two functions where the two operations are located. This is same with the field "op" in the file.

Reproduce

nil

Expected behavior

data race

docker version
nil
docker info
nil
Additional Info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read solver/jobs.go around lines 151 and 187, then trace the two functions that write and read the edges and op fields. Confirm the concurrent accesses and determine the appropriate synchronization, then use a race-enabled run to verify that the reported data race no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.