Skip to content

time: data race on local Location #3967

@dvyukov

Description

@dvyukov
On a proprietary test ThreadSanitizer says:

WARNING: DATA RACE
Write by goroutine 4:
  time.initLocal()
      src/pkg/time/zoneinfo_unix.go:49 +0x11f
  sync.(*Once).Do()
      src/pkg/sync/once.go:40 +0x7a
  time.(*Location).lookup()
      src/pkg/time/zoneinfo.go:102 +0x46
  time.Time.abs()
      src/pkg/time/time.go:253 +0xf9
  time.Time.date()
      src/pkg/time/time.go:647 +0x31
  time.Time.Date()
      src/pkg/time/time.go:286 +0x36
  [stripped]

Previous read by goroutine 57:
  time.Time.abs()
      src/pkg/time/time.go:250 +0x6b
  time.Time.date()
      src/pkg/time/time.go:647 +0x31
  time.Time.Date()
      src/pkg/time/time.go:286 +0x36
  [stripped]

One goroutine reads local Location while another mutates it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions