Skip to content

Data race in fakeFS (testing) #9499

Closed

Description

@calmh

What happened?

=== RUN   TestRecvOnlyRemoteUndoChanges
==================
WARNING: DATA RACE
Read at 0x00c0003546b0 by goroutine 360:
  github.com/syncthing/syncthing/lib/fs.(*fakeFile).Stat()
      /home/runner/work/syncthing/syncthing/lib/fs/fakefs.go:952 +0x5d
  github.com/syncthing/syncthing/lib/fs.mtimeFile.Stat()
      /home/runner/work/syncthing/syncthing/lib/fs/mtimefs.go:209 +0x5d
  github.com/syncthing/syncthing/lib/fs.(*mtimeFile).Stat()
      <autogenerated>:1 +0x59
  github.com/syncthing/syncthing/lib/fs.(*metricsFile).Stat()
      /home/runner/work/syncthing/syncthing/lib/fs/metrics.go:304 +0xfa
  github.com/syncthing/syncthing/lib/scanner.HashFile()
      /home/runner/work/syncthing/syncthing/lib/scanner/blockqueue.go:50 +0x776
  github.com/syncthing/syncthing/lib/scanner.(*parallelHasher).hashFiles()
      /home/runner/work/syncthing/syncthing/lib/scanner/blockqueue.go:111 +0x4eb
  github.com/syncthing/syncthing/lib/scanner.newParallelHasher.func1()
      /home/runner/work/syncthing/syncthing/lib/scanner/blockqueue.go:89 +0x4f

Previous write at 0x00c0003546b0 by goroutine 311:
  github.com/syncthing/syncthing/lib/fs.(*fakeFS).Chmod()
      /home/runner/work/syncthing/syncthing/lib/fs/fakefs.go:235 +0x15b
  github.com/syncthing/syncthing/lib/fs.(*caseFilesystem).Chmod()
      /home/runner/work/syncthing/syncthing/lib/fs/casefs.go:153 +0x97
  github.com/syncthing/syncthing/lib/fs.(*metricsFS).Chmod()
      /home/runner/work/syncthing/syncthing/lib/fs/metrics.go:107 +0x107
  github.com/syncthing/syncthing/lib/fs.(*walkFilesystem).Chmod()
      <autogenerated>:1 +0x6a
  github.com/syncthing/syncthing/lib/model.writeFilePerm()
      /home/runner/work/syncthing/syncthing/lib/model/testutils_test.go:436 +0xe1
  github.com/syncthing/syncthing/lib/model.TestRecvOnlyRemoteUndoChanges()
      /home/runner/work/syncthing/syncthing/lib/model/folder_recvonly_test.go:381 +0xaa9
  testing.tRunner()
      /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1648 +0x44

Goroutine 360 (running) created at:
  github.com/syncthing/syncthing/lib/scanner.newParallelHasher()
      /home/runner/work/syncthing/syncthing/lib/scanner/blockqueue.go:89 +0x32f
  github.com/syncthing/syncthing/lib/scanner.(*walker).walk.func1()
      /home/runner/work/syncthing/syncthing/lib/scanner/walk.go:170 +0x33d

Goroutine 311 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1648 +0x845
  testing.runTests.func1()
      /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:2054 +0x84
  testing.tRunner()
      /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1595 +0x261
  testing.runTests()
      /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:2052 +0x8ad
  testing.(*M).Run()
      /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1925 +0xcd7
  main.main()
      _testmain.go:369 +0x2bd
==================
    testing.go:1465: race detected during execution of test
--- FAIL: TestRecvOnlyRemoteUndoChanges (0.02s)

Syncthing version

v1.27.5

Platform & operating system

Browser version

No response

Relevant log output

No response

Activity

  1. added
    bug
    needs-triage
    on Apr 5, 2024
  2. added
    build
    and removed
    needs-triage
    on Jul 8, 2024
  3. added a commit that references this issue on Jul 8, 2024
    9e11c4e
  4. added this to the v1.27.10 milestone on Jul 10, 2024
  5. added a commit that references this issue on Aug 19, 2024
    4392474
  6. added
    frozen-due-to-age
    on Jul 9, 2025
  7. locked and limited conversation to collaborators on Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbuildfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions