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 Go templates #917

Closed
bep opened this issue Feb 20, 2015 · 7 comments
Closed

Data race in Go templates #917

bep opened this issue Feb 20, 2015 · 7 comments
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Feb 20, 2015

Build Hugo with go build -race

And build a site.

Extract:

=================
==================
WARNING: DATA RACE
Read by goroutine 64:
  github.com/spf13/hugo/target.(*HTMLRedirectAlias).Translate()
      /home/bep/dev/go/src/github.com/spf13/hugo/target/htmlredirect.go:44 +0x1f1
  github.com/spf13/hugo/target.(*HTMLRedirectAlias).Publish()
      /home/bep/dev/go/src/github.com/spf13/hugo/target/htmlredirect.go:52 +0x75
  github.com/spf13/hugo/hugolib.(*Site).WriteDestAlias()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1514 +0x240
  github.com/spf13/hugo/hugolib.taxonomyRenderer()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1074 +0x786

Previous write by goroutine 54:
  github.com/spf13/hugo/hugolib.(*Site).AliasTarget()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1495 +0xb1
  github.com/spf13/hugo/hugolib.(*Site).WriteDestAlias()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1514 +0x1ee
  github.com/spf13/hugo/hugolib.taxonomyRenderer()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1074 +0x786

Goroutine 64 (running) created at:
  github.com/spf13/hugo/hugolib.(*Site).RenderTaxonomiesLists()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1010 +0x154
  github.com/spf13/hugo/hugolib.(*Site).Render()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:380 +0x9a
  github.com/spf13/hugo/hugolib.(*Site).Build()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:243 +0x99
  github.com/spf13/hugo/commands.buildSite()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:343 +0x136
  github.com/spf13/hugo/commands.build()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:255 +0x364
  github.com/spf13/hugo/commands.func·006()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:51 +0x4c
  github.com/spf13/cobra.(*Command).execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:355 +0x242
  github.com/spf13/cobra.(*Command).Execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:403 +0x224
  github.com/spf13/hugo/commands.Execute()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:64 +0x4c
  main.main()
      /home/bep/dev/go/src/github.com/spf13/hugo/main.go:24 +0x4c

Goroutine 54 (running) created at:
  github.com/spf13/hugo/hugolib.(*Site).RenderTaxonomiesLists()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1010 +0x154
  github.com/spf13/hugo/hugolib.(*Site).Render()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:380 +0x9a
  github.com/spf13/hugo/hugolib.(*Site).Build()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:243 +0x99
  github.com/spf13/hugo/commands.buildSite()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:343 +0x136
  github.com/spf13/hugo/commands.build()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:255 +0x364
  github.com/spf13/hugo/commands.func·006()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:51 +0x4c
  github.com/spf13/cobra.(*Command).execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:355 +0x242
  github.com/spf13/cobra.(*Command).Execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:403 +0x224
  github.com/spf13/hugo/commands.Execute()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:64 +0x4c
  main.main()
      /home/bep/dev/go/src/github.com/spf13/hugo/main.go:24 +0x4c
==================
==================
WARNING: DATA RACE
Read by goroutine 64:
  github.com/spf13/hugo/target.(*HTMLRedirectAlias).Publish()
      /home/bep/dev/go/src/github.com/spf13/hugo/target/htmlredirect.go:62 +0x1ca
  github.com/spf13/hugo/hugolib.(*Site).WriteDestAlias()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1514 +0x240
  github.com/spf13/hugo/hugolib.taxonomyRenderer()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1074 +0x786

Previous write by goroutine 54:
  github.com/spf13/hugo/hugolib.(*Site).AliasTarget()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1495 +0xb1
  github.com/spf13/hugo/hugolib.(*Site).WriteDestAlias()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1514 +0x1ee
  github.com/spf13/hugo/hugolib.taxonomyRenderer()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1074 +0x786

Goroutine 64 (running) created at:
  github.com/spf13/hugo/hugolib.(*Site).RenderTaxonomiesLists()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1010 +0x154
  github.com/spf13/hugo/hugolib.(*Site).Render()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:380 +0x9a
  github.com/spf13/hugo/hugolib.(*Site).Build()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:243 +0x99
  github.com/spf13/hugo/commands.buildSite()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:343 +0x136
  github.com/spf13/hugo/commands.build()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:255 +0x364
  github.com/spf13/hugo/commands.func·006()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:51 +0x4c
  github.com/spf13/cobra.(*Command).execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:355 +0x242
  github.com/spf13/cobra.(*Command).Execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:403 +0x224
  github.com/spf13/hugo/commands.Execute()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:64 +0x4c
  main.main()
      /home/bep/dev/go/src/github.com/spf13/hugo/main.go:24 +0x4c

Goroutine 54 (running) created at:
  github.com/spf13/hugo/hugolib.(*Site).RenderTaxonomiesLists()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:1010 +0x154
  github.com/spf13/hugo/hugolib.(*Site).Render()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:380 +0x9a
  github.com/spf13/hugo/hugolib.(*Site).Build()
      /home/bep/dev/go/src/github.com/spf13/hugo/hugolib/site.go:243 +0x99
  github.com/spf13/hugo/commands.buildSite()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:343 +0x136
  github.com/spf13/hugo/commands.build()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:255 +0x364
  github.com/spf13/hugo/commands.func·006()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:51 +0x4c
  github.com/spf13/cobra.(*Command).execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:355 +0x242
  github.com/spf13/cobra.(*Command).Execute()
      /home/bep/dev/go/src/github.com/spf13/cobra/command.go:403 +0x224
  github.com/spf13/hugo/commands.Execute()
      /home/bep/dev/go/src/github.com/spf13/hugo/commands/hugo.go:64 +0x4c
  main.main()
      /home/bep/dev/go/src/github.com/spf13/hugo/main.go:24 +0x4c
==================
@bep bep added the Bug label Feb 20, 2015
@bep bep self-assigned this Feb 20, 2015
bep added a commit that referenced this issue Feb 20, 2015
As reported by Go's race detector.

See #917
bep added a commit that referenced this issue Feb 20, 2015
As reported by Go's race detector.

See #917
@bep
Copy link
Member Author

bep commented Feb 20, 2015

One of the race issues seems to be a Go issue, see:

golang/go#9945

@bep
Copy link
Member Author

bep commented Feb 20, 2015

OK, that seems to be the last one. It's deep inside Go's templates, and is in heavy use in Hugo - but we'll have to wait until 1.5 for a fix.

@bep bep changed the title Go race detector reports some errors Data race in Go templates Feb 21, 2015
@bep
Copy link
Member Author

bep commented May 17, 2015

golang/go#9945 is fixed - but it's still some months until Hugo can build with that version ...

@kzys
Copy link
Contributor

kzys commented Oct 16, 2015

I couldn't reproduce the issue with Go 1.5.1 (darwin/amd64) which includes golang/go#9945. Since the initial release of Go 1.5 is August, I think we can close the issue.

@bep
Copy link
Member Author

bep commented Oct 16, 2015

We will close this issue when Hugo 0.15 is released.

@bep
Copy link
Member Author

bep commented Oct 20, 2015

Never mind -- we're closing this now. That is in line with other bug fixes.

@bep bep closed this as completed Oct 20, 2015
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
As reported by Go's race detector.

See gohugoio#917
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
As reported by Go's race detector.

See gohugoio#917
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants