Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data race in fakeFS (testing) #9499

Open
calmh opened this issue Apr 5, 2024 · 0 comments
Open

Data race in fakeFS (testing) #9499

calmh opened this issue Apr 5, 2024 · 0 comments
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated

Comments

@calmh
Copy link
Member

calmh commented Apr 5, 2024

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

@calmh calmh added bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated labels Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated
Projects
None yet
Development

No branches or pull requests

1 participant