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

text/template: data race on lexer.pos #3886

Closed
dvyukov opened this issue Jul 29, 2012 · 1 comment
Closed

text/template: data race on lexer.pos #3886

dvyukov opened this issue Jul 29, 2012 · 1 comment

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 29, 2012

ThreadSanitizer says:

WARNING: DATA RACE
Write by goroutine 2:
  text/template/parse.(*lexer).next()
      src/pkg/text/template/parse/lex.go:140 +0x111
  text/template/parse.lexInsideAction()
      src/pkg/text/template/parse/lex.go:293 +0x144
  text/template/parse.(*lexer).run()
      src/pkg/text/template/parse/lex.go:223 +0x65
Previous read by goroutine 0:
  text/template/parse.(*lexer).lineNumber()
      src/pkg/text/template/parse/lex.go:186 +0x50
  text/template/parse.(*Tree).action()
      src/pkg/text/template/parse/parse.go:317 +0x151
  text/template/parse.(*Tree).textOrAction()
      src/pkg/text/template/parse/parse.go:288 +0x69
  text/template/parse.(*Tree).itemList()
      src/pkg/text/template/parse/parse.go:270 +0xbc
  text/template/parse.(*Tree).parseControl()
      src/pkg/text/template/parse/parse.go:373 +0xfd
  text/template/parse.(*Tree).ifControl()
      src/pkg/text/template/parse/parse.go:391 +0x3a
  text/template/parse.(*Tree).action()
      src/pkg/text/template/parse/parse.go:307 +0xed
  text/template/parse.(*Tree).textOrAction()
      src/pkg/text/template/parse/parse.go:288 +0x69
  text/template/parse.(*Tree).parse()
      src/pkg/text/template/parse/parse.go:234 +0x408
  text/template/parse.(*Tree).Parse()
      src/pkg/text/template/parse/parse.go:175 +0x280
  text/template/parse.Parse()
      src/pkg/text/template/parse/parse.go:37 +0x12d
  text/template.(*Template).Parse()
      src/pkg/text/template/template.go:168 +0x29c
  cmd/go.init()
      src/cmd/go/tag_test.go:-1137 +0x190a
  main.init()
      _testmain.go:20 +0x84
  runtime.main()
      src/pkg/runtime/proc.c:237 +0x70
Goroutine 2 (running) created at:
  text/template/parse.lex()
      src/pkg/text/template/parse/lex.go:216 +0x215
  text/template/parse.(*Tree).Parse()
      src/pkg/text/template/parse/parse.go:174 +0xf4
  text/template/parse.Parse()
      src/pkg/text/template/parse/parse.go:37 +0x12d
  text/template.(*Template).Parse()
      src/pkg/text/template/template.go:168 +0x29c
  cmd/go.init()
      src/cmd/go/tag_test.go:-1137 +0x190a
  main.init()
      _testmain.go:20 +0x84
  runtime.main()
      src/pkg/runtime/proc.c:237 +0x70

Similar reports on cmd/go, text/template, text/template/parse, html/template,
net/rpc/jsonrpc.

Total Undefined Behavior under gccgo aside, at least it leads to non-deterministic error
messages, it can contain either the correct line or any arbitrary subsequent line.
@robpike
Copy link
Contributor

robpike commented Jul 30, 2012

Comment 1:

This issue was closed by revision 20d9fd3.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
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