Skip to content

net/smtp: data race in smtp.TestSendMail #4559

Description

@davecheney
rev d68fadb4593f exposed a data race in the smtp tests

==================
WARNING: DATA RACE
Read by goroutine 9:
  bufio.(*Writer).Write()
      /usr/local/go/src/pkg/bufio/bufio.go:491 +0xa0
  net/smtp.func·002()
      /usr/local/go/src/pkg/net/smtp/smtp_test.go:407 +0x519

Previous write by goroutine 7:
  bufio.(*Writer).Flush()
      /usr/local/go/src/pkg/bufio/bufio.go:476 +0x3bb
  net/smtp.TestSendMail()
      /usr/local/go/src/pkg/net/smtp/smtp_test.go:432 +0x6a9
  testing.tRunner()
      /usr/local/go/src/pkg/testing/testing.go:301 +0xe8

Goroutine 9 (running) created at:
  net/smtp.TestSendMail()
      /usr/local/go/src/pkg/net/smtp/smtp_test.go:419 +0x40d
  testing.tRunner()
      /usr/local/go/src/pkg/testing/testing.go:301 +0xe8

Goroutine 7 (finished) created at:
  testing.RunTests()
      /usr/local/go/src/pkg/testing/testing.go:377 +0xaec
  testing.Main()
      /usr/local/go/src/pkg/testing/testing.go:313 +0xcd
  main.main()
      net/smtp/_test/_testmain.go:53 +0xda
  runtime.main()
      /usr/local/go/src/pkg/runtime/proc.c:248 +0x91

==================
==================
WARNING: DATA RACE
Write by goroutine 9:
  runtime.copy()
      /usr/local/go/src/pkg/runtime/slice.c:199 +0x0
  bufio.(*Writer).Write()
      /usr/local/go/src/pkg/bufio/bufio.go:508 +0x50e
  net/smtp.func·002()
      /usr/local/go/src/pkg/net/smtp/smtp_test.go:407 +0x519

Previous read by goroutine 7:
  runtime.copy()
      /usr/local/go/src/pkg/runtime/slice.c:199 +0x0
  bytes.(*Buffer).Write()
      /usr/local/go/src/pkg/bytes/buffer.go:122 +0x177
  bufio.(*Writer).Flush()
      /usr/local/go/src/pkg/bufio/bufio.go:464 +0x161
  net/smtp.TestSendMail()
      /usr/local/go/src/pkg/net/smtp/smtp_test.go:432 +0x6a9
  testing.tRunner()
      /usr/local/go/src/pkg/testing/testing.go:301 +0xe8

Goroutine 9 (running) created at:
  net/smtp.TestSendMail()
      /usr/local/go/src/pkg/net/smtp/smtp_test.go:419 +0x40d
  testing.tRunner()
      /usr/local/go/src/pkg/testing/testing.go:301 +0xe8

Goroutine 7 (finished) created at:
  testing.RunTests()
      /usr/local/go/src/pkg/testing/testing.go:377 +0xaec
  testing.Main()
      /usr/local/go/src/pkg/testing/testing.go:313 +0xcd
  main.main()
      net/smtp/_test/_testmain.go:53 +0xda
  runtime.main()
      /usr/local/go/src/pkg/runtime/proc.c:248 +0x91

==================
PASS
Found 2 data race(s)
FAIL    net/smtp    1.029s

http://build.golang.org/log/06613f019d1bee8778521f4505d908c2f58c0323

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions