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

Found data race in the "Local Disk" mode #4

Closed
mstmdev opened this issue Jan 7, 2022 · 1 comment · Fixed by #6
Closed

Found data race in the "Local Disk" mode #4

mstmdev opened this issue Jan 7, 2022 · 1 comment · Fixed by #6
Labels
race Data race

Comments

@mstmdev
Copy link
Member

mstmdev commented Jan 7, 2022

Running command (Windows 10)

cd E:/workspace/gowork/src/github.com/no-src/gofs
mkdir src target
go run -race ./cmd/gofs -src=./src -target=./target

Error info

==================
WARNING: DATA RACE
Write at 0x00c000302e08 by main goroutine:
  container/list.(*List).insert()
      c:/go/src/container/list/list.go:98 +0x6b2
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x38d
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Previous read at 0x00c000302e08 by goroutine 30:
  container/list.(*List).Front()
      c:/go/src/container/list/list.go:70 +0x7d
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:133 +0x3e
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
==================
WARNING: DATA RACE
Read at 0x00c000302de0 by goroutine 30:
  container/list.(*List).Front()
      c:/go/src/container/list/list.go:73 +0x95
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:133 +0x3e
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c000302de0 by main goroutine:
  container/list.(*List).insert()
      c:/go/src/container/list/list.go:95 +0x5b3
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x38d
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
==================
WARNING: DATA RACE
Read at 0x00c0001b8528 by goroutine 30:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:134 +0xba
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c0001b8528 by main goroutine:
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x467
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
==================
WARNING: DATA RACE
Read at 0x00c0000b2127 by goroutine 30:
  runtime.slicecopy()
      c:/go/src/runtime/slice.go:284 +0x0
  strings.(*Builder).WriteString()
      c:/go/src/strings/builder.go:124 +0x155
  strings.Join()
      c:/go/src/strings/strings.go:438 +0x26f
  path/filepath.joinNonEmpty()
      c:/go/src/path/filepath/path_windows.go:175 +0xbc
  path/filepath.join()
      c:/go/src/path/filepath/path_windows.go:152 +0xcc
  path/filepath.Join()
      c:/go/src/path/filepath/path.go:213 +0x26b
  github.com/no-src/gofs/sync.(*diskSync).buildTargetAbsFile()
      E:/workspace/gowork/src/github.com/no-src/gofs/sync/disk_sync.go:258 +0x99
  github.com/no-src/gofs/sync.(*diskSync).Create()
      E:/workspace/gowork/src/github.com/no-src/gofs/sync/disk_sync.go:62 +0x70
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:150 +0x766
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c0000b2127 by goroutine 10:
  runtime.slicecopy()
      c:/go/src/runtime/slice.go:284 +0x0
  strings.(*Builder).WriteString()
      c:/go/src/strings/builder.go:124 +0x155
  strings.Join()
      c:/go/src/strings/strings.go:438 +0x26f
  path/filepath.joinNonEmpty()
      c:/go/src/path/filepath/path_windows.go:175 +0xbc
  path/filepath.join()
      c:/go/src/path/filepath/path_windows.go:152 +0xcc
  path/filepath.Join()
      c:/go/src/path/filepath/path.go:213 +0xb6f
  github.com/fsnotify/fsnotify.(*Watcher).readEvents()
      E:/workspace/gowork/pkg/mod/github.com/fsnotify/fsnotify@v1.5.1/windows.go:457 +0xaf2
  github.com/fsnotify/fsnotify.NewWatcher·dwrap·1()
      E:/workspace/gowork/pkg/mod/github.com/fsnotify/fsnotify@v1.5.1/windows.go:47 +0x39

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 10 (running) created at:
  github.com/fsnotify/fsnotify.NewWatcher()
      E:/workspace/gowork/pkg/mod/github.com/fsnotify/fsnotify@v1.5.1/windows.go:47 +0x390
  github.com/no-src/gofs/monitor.NewFsNotifyMonitor()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:27 +0x64
  github.com/no-src/gofs/monitor.NewMonitor()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/monitor.go:28 +0x376
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:110 +0xff2
==================
==================
WARNING: DATA RACE
Read at 0x00c0001b8520 by goroutine 30:
  container/list.(*List).Remove()
      c:/go/src/container/list/list.go:138 +0xf05
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:185 +0xecc
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c0001b8520 by main goroutine:
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x467
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
==================
WARNING: DATA RACE
Read at 0x00c0001b8510 by goroutine 30:
  container/list.(*List).remove()
      c:/go/src/container/list/list.go:109 +0xf24
  container/list.(*List).Remove()
      c:/go/src/container/list/list.go:141 +0xf1d
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:185 +0xecc
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c0001b8510 by main goroutine:
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x467
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
==================
WARNING: DATA RACE
Read at 0x00c0001b8518 by goroutine 30:
  container/list.(*List).remove()
      c:/go/src/container/list/list.go:109 +0xf45
  container/list.(*List).Remove()
      c:/go/src/container/list/list.go:141 +0xf1d
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:185 +0xecc
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c0001b8518 by main goroutine:
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x467
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
==================
WARNING: DATA RACE
Write at 0x00c0001b85a8 by goroutine 30:
  container/list.(*List).remove()
      c:/go/src/container/list/list.go:110 +0xfd6
  container/list.(*List).Remove()
      c:/go/src/container/list/list.go:141 +0xf1d
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:185 +0xecc
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c0001b85a8 by main goroutine:
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x467
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
==================
WARNING: DATA RACE
Write at 0x00c000302de8 by goroutine 30:
  container/list.(*List).remove()
      c:/go/src/container/list/list.go:110 +0xfd6
  container/list.(*List).Remove()
      c:/go/src/container/list/list.go:141 +0xf1d
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).processEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:185 +0xecc
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start·dwrap·3()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x39

Previous write at 0x00c000302de8 by main goroutine:
  container/list.(*List).insert()
      c:/go/src/container/list/list.go:96 +0x611
  container/list.(*List).insertValue()
      c:/go/src/container/list/list.go:104 +0x38d
  container/list.(*List).PushBack()
      c:/go/src/container/list/list.go:155 +0x42a
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).listenEvents()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:110 +0x328
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:98 +0x404
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2

Goroutine 30 (running) created at:
  github.com/no-src/gofs/monitor.(*fsNotifyMonitor).Start()
      E:/workspace/gowork/src/github.com/no-src/gofs/monitor/fsnotify_monitor.go:96 +0x3f7
  main.main()
      E:/workspace/gowork/src/github.com/no-src/gofs/cmd/gofs/main.go:127 +0x11e2
==================
@mstmdev mstmdev changed the title Found data race in the fsNotifyMonitor Found data race in the "Local Disk" mode Jan 7, 2022
@mstmdev mstmdev added the race Data race label Jan 7, 2022
@mstmdev mstmdev linked a pull request Jan 7, 2022 that will close this issue
@mstmdev mstmdev closed this as completed in #6 Jan 7, 2022
@mstmdev
Copy link
Member Author

mstmdev commented Jan 7, 2022

fixed by #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
race Data race
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant