testing/swiftservice: data race

Bug #1336634 reported by Dave Cheney on 2014-07-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Go OpenStack Exchange
High
Dave Cheney
juju-core
High
Dave Cheney

Bug Description

Lots of data races when this package is used in anger.

2014/07/02 14:50:20 http: TLS handshake error from 127.0.0.1:58121: remote error: bad certificate
2014/07/02 14:50:20 http: TLS handshake error from 127.0.0.1:58124: remote error: bad certificate
==================
WARNING: DATA RACE
Read by goroutine 123:
  runtime.mapaccess2_faststr()
      /home/dfc/go/src/pkg/runtime/hashmap_fast.c:122 +0x0
  launchpad.net/goose/testservices/swiftservice.(*Swift).GetObject()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service.go:83 +0x32a
  launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:129 +0x215
  launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
  net/http.(*ServeMux).ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
  net/http.serverHandler.ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
  net/http.(*conn).serve()
      /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e

Previous write by goroutine 54:
  runtime.mapdelete()
      /home/dfc/go/src/pkg/runtime/hashmap.goc:948 +0x0
  launchpad.net/goose/testservices/swiftservice.(*Swift).RemoveObject()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service.go:181 +0x360
  launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:142 +0x400
  launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
  net/http.(*ServeMux).ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
  net/http.serverHandler.ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
  net/http.(*conn).serve()
      /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e
  runtime.gosched0()
      /home/dfc/go/src/pkg/runtime/proc.c:1440 +0xbf
  math/big.nat.expNNWindowed()
      /home/dfc/go/src/pkg/math/big/nat.go:1359 +0xea8
  math/big.nat.expNN()
      /home/dfc/go/src/pkg/math/big/nat.go:1260 +0x4f1
  math/big.nat.probablyPrime()
      /home/dfc/go/src/pkg/math/big/nat.go:1445 +0x990
  math/big.(*Int).ProbablyPrime()
      /home/dfc/go/src/pkg/math/big/int.go:735 +0x7b
  crypto/rsa.(*PrivateKey).Validate()
      /home/dfc/go/src/pkg/crypto/rsa/rsa.go:91 +0x188
  crypto/x509.ParsePKCS1PrivateKey()
      /home/dfc/go/src/pkg/crypto/x509/pkcs1.go:77 +0xa3c
  crypto/tls.parsePrivateKey()
      /home/dfc/go/src/pkg/crypto/tls/tls.go:259 +0x94
  crypto/tls.X509KeyPair()
      /home/dfc/go/src/pkg/crypto/tls/tls.go:213 +0x3f5
  github.com/juju/juju/environs/config.verifyKeyPair()
      /home/dfc/src/github.com/juju/juju/environs/config/authkeys.go:82 +0x10d
  github.com/juju/juju/environs/config.Validate()
      /home/dfc/src/github.com/juju/juju/environs/config/config.go:333 +0x1496
  github.com/juju/juju/environs/config.New()
      /home/dfc/src/github.com/juju/juju/environs/config/config.go:170 +0x2b3
  github.com/juju/juju/provider/openstack.environProvider.Validate()
      /home/dfc/src/github.com/juju/juju/provider/openstack/config.go:229 +0x228d
  github.com/juju/juju/provider/openstack.environProvider.newConfig()
      /home/dfc/src/github.com/juju/juju/provider/openstack/config.go:99 +0x58
  github.com/juju/juju/provider/openstack.(*environ).SetConfig()
      /home/dfc/src/github.com/juju/juju/provider/openstack/provider.go:700 +0x83
  github.com/juju/juju/provider/openstack.environProvider.Open()
      /home/dfc/src/github.com/juju/juju/provider/openstack/provider.go:206 +0x187
  github.com/juju/juju/provider/openstack.environProvider.Prepare()
      /home/dfc/src/github.com/juju/juju/provider/openstack/provider.go:227 +0x3ae
  github.com/juju/juju/provider/openstack.environProvider.Prepare·i()
      <autogenerated>:110 +0x8a
  github.com/juju/juju/environs.prepare()
      /home/dfc/src/github.com/juju/juju/environs/open.go:219 +0x307
  github.com/juju/juju/environs.Prepare()
      /home/dfc/src/github.com/juju/juju/environs/open.go:196 +0xa2b
  github.com/juju/juju/provider/openstack_test.(*localHTTPSServerSuite).SetUpTest()
      /home/dfc/src/github.com/juju/juju/provider/openstack/local_test.go:935 +0x606
  runtime.call16()
      /home/dfc/go/src/pkg/runtime/asm_amd64.s:363 +0x31
  reflect.Value.Call()
      /home/dfc/go/src/pkg/reflect/value.go:411 +0xed
  launchpad.net/gocheck.func·005()
      /home/dfc/src/launchpad.net/gocheck/gocheck.go:685 +0x1b7
  launchpad.net/gocheck.func·004()
      /home/dfc/src/launchpad.net/gocheck/gocheck.go:630 +0xf4

Goroutine 123 (running) created at:
  net/http.(*Server).Serve()
      /home/dfc/go/src/pkg/net/http/server.go:1721 +0x35d

Goroutine 54 (running) created at:
  net/http.(*Server).Serve()
      /home/dfc/go/src/pkg/net/http/server.go:1721 +0x35d
==================
==================
WARNING: DATA RACE
Read by goroutine 40:
  runtime.mapaccess2_faststr()
      /home/dfc/go/src/pkg/runtime/hashmap_fast.c:122 +0x0
  launchpad.net/goose/testservices/swiftservice.(*Swift).GetObject()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service.go:83 +0x32a
  launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:129 +0x215
  launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
  net/http.(*ServeMux).ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
  net/http.serverHandler.ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
  net/http.(*conn).serve()
      /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e

Previous write by goroutine 94:
  runtime.mapdelete()
      /home/dfc/go/src/pkg/runtime/hashmap.goc:948 +0x0
  launchpad.net/goose/testservices/swiftservice.(*Swift).RemoveObject()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service.go:181 +0x360
  launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:142 +0x400
  launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
  net/http.(*ServeMux).ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
  net/http.serverHandler.ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
  net/http.(*conn).serve()
      /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e
  runtime.gosched0()
      /home/dfc/go/src/pkg/runtime/proc.c:1440 +0xbf
  crypto/elliptic.p256Mul()
      /home/dfc/go/src/pkg/crypto/elliptic/p256.go:645 +0x15ad
  crypto/elliptic.p256PointAdd()
      /home/dfc/go/src/pkg/crypto/elliptic/p256.go:921 +0x56d
  crypto/elliptic.p256ScalarMult()
      /home/dfc/go/src/pkg/crypto/elliptic/p256.go:1127 +0x7c9
  crypto/elliptic.p256Curve.ScalarMult()
      /home/dfc/go/src/pkg/crypto/elliptic/p256.go:76 +0x158
  crypto/tls.(*ecdheKeyAgreement).generateClientKeyExchange()
      /home/dfc/go/src/pkg/crypto/tls/key_agreement.go:394 +0x415
  crypto/tls.(*clientHandshakeState).doFullHandshake()
      /home/dfc/go/src/pkg/crypto/tls/handshake_client.go:402 +0x185c
  crypto/tls.(*Conn).clientHandshake()
      /home/dfc/go/src/pkg/crypto/tls/handshake_client.go:184 +0x1f36
  crypto/tls.(*Conn).Handshake()
      /home/dfc/go/src/pkg/crypto/tls/conn.go:974 +0x144
  net/http.func·021()
      /home/dfc/go/src/pkg/net/http/transport.go:577 +0x5b

Goroutine 40 (running) created at:
  net/http.(*Server).Serve()
      /home/dfc/go/src/pkg/net/http/server.go:1721 +0x35d

Goroutine 94 (running) created at:
  net/http.(*Server).Serve()
      /home/dfc/go/src/pkg/net/http/server.go:1721 +0x35d
==================
==================
WARNING: DATA RACE
Read by goroutine 305:
  runtime.mapaccess2_faststr()
      /home/dfc/go/src/pkg/runtime/hashmap_fast.c:122 +0x0
  launchpad.net/goose/testservices/swiftservice.(*Swift).GetObject()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service.go:83 +0x32a
  launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:129 +0x215
  launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
  net/http.(*ServeMux).ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
  net/http.serverHandler.ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
  net/http.(*conn).serve()
      /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e

Previous write by goroutine 233:
  runtime.mapdelete()
      /home/dfc/go/src/pkg/runtime/hashmap.goc:948 +0x0
  launchpad.net/goose/testservices/swiftservice.(*Swift).RemoveObject()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service.go:181 +0x360
  launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:142 +0x400
  launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
      /home/dfc/src/launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
  net/http.(*ServeMux).ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
  net/http.serverHandler.ServeHTTP()
      /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
  net/http.(*conn).serve()
      /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e

Goroutine 305 (running) created at:
  net/http.(*Server).Serve()
      /home/dfc/go/src/pkg/net/http/server.go:1721 +0x35d

Goroutine 233 (running) created at:
  net/http.(*Server).Serve()
      /home/dfc/go/src/pkg/net/http/server.go:1721 +0x35d
==================
OK: 77 passed, 5 skipped
PASS
Found 3 data race(s)

Related branches

Changed in juju-core:
assignee: nobody → Dave Cheney (dave-cheney)
status: New → In Progress
Download full text (11.5 KiB)

I think this is Fix Committed now, right?

On Wed, Jul 2, 2014 at 9:33 AM, Dave Cheney <email address hidden>
wrote:

> Public bug reported:
>
> Lots of data races when this package is used in anger.
>
> 2014/07/02 14:50:20 http: TLS handshake error from 127.0.0.1:58121:
> remote error: bad certificate
> 2014/07/02 14:50:20 http: TLS handshake error from 127.0.0.1:58124:
> remote error: bad certificate
> ==================
> WARNING: DATA RACE
> Read by goroutine 123:
> runtime.mapaccess2_faststr()
> /home/dfc/go/src/pkg/runtime/hashmap_fast.c:122 +0x0
> launchpad.net/goose/testservices/swiftservice.(*Swift).GetObject()
> /home/dfc/src/
> launchpad.net/goose/testservices/swiftservice/service.go:83 +0x32a
> launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
> /home/dfc/src/
> launchpad.net/goose/testservices/swiftservice/service_http.go:129 +0x215
> launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
> /home/dfc/src/
> launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
> net/http.(*ServeMux).ServeHTTP()
> /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
> net/http.serverHandler.ServeHTTP()
> /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
> net/http.(*conn).serve()
> /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e
>
> Previous write by goroutine 54:
> runtime.mapdelete()
> /home/dfc/go/src/pkg/runtime/hashmap.goc:948 +0x0
> launchpad.net/goose/testservices/swiftservice.(*Swift).RemoveObject()
> /home/dfc/src/
> launchpad.net/goose/testservices/swiftservice/service.go:181 +0x360
> launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
> /home/dfc/src/
> launchpad.net/goose/testservices/swiftservice/service_http.go:142 +0x400
> launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
> /home/dfc/src/
> launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
> net/http.(*ServeMux).ServeHTTP()
> /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
> net/http.serverHandler.ServeHTTP()
> /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
> net/http.(*conn).serve()
> /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e
> runtime.gosched0()
> /home/dfc/go/src/pkg/runtime/proc.c:1440 +0xbf
> math/big.nat.expNNWindowed()
> /home/dfc/go/src/pkg/math/big/nat.go:1359 +0xea8
> math/big.nat.expNN()
> /home/dfc/go/src/pkg/math/big/nat.go:1260 +0x4f1
> math/big.nat.probablyPrime()
> /home/dfc/go/src/pkg/math/big/nat.go:1445 +0x990
> math/big.(*Int).ProbablyPrime()
> /home/dfc/go/src/pkg/math/big/int.go:735 +0x7b
> crypto/rsa.(*PrivateKey).Validate()
> /home/dfc/go/src/pkg/crypto/rsa/rsa.go:91 +0x188
> crypto/x509.ParsePKCS1PrivateKey()
> /home/dfc/go/src/pkg/crypto/x509/pkcs1.go:77 +0xa3c
> crypto/tls.parsePrivateKey()
> /home/dfc/go/src/pkg/crypto/tls/tls.go:259 +0x94
> crypto/tls.X509KeyPair()
> /home/dfc/go/src/pkg/crypto/tls/tls.go:213 +0x3f5
> github.com/juju/juju/environs/config.verifyKeyPair()
> /home/dfc/src/github.com/juju/juju/environs/config/auth...

Dave Cheney (dave-cheney) wrote :
Download full text (23.1 KiB)

only on goose, I need to propose a fix to dependencies.tsv for
juju/juju, but that is blocked by the fact that juju doesn't appear to
be compatible with the head of goose.

On Wed, Jul 2, 2014 at 10:01 PM, John A Meinel <email address hidden> wrote:
> I think this is Fix Committed now, right?
>
>
> On Wed, Jul 2, 2014 at 9:33 AM, Dave Cheney <email address hidden>
> wrote:
>
>> Public bug reported:
>>
>> Lots of data races when this package is used in anger.
>>
>> 2014/07/02 14:50:20 http: TLS handshake error from 127.0.0.1:58121:
>> remote error: bad certificate
>> 2014/07/02 14:50:20 http: TLS handshake error from 127.0.0.1:58124:
>> remote error: bad certificate
>> ==================
>> WARNING: DATA RACE
>> Read by goroutine 123:
>> runtime.mapaccess2_faststr()
>> /home/dfc/go/src/pkg/runtime/hashmap_fast.c:122 +0x0
>> launchpad.net/goose/testservices/swiftservice.(*Swift).GetObject()
>> /home/dfc/src/
>> launchpad.net/goose/testservices/swiftservice/service.go:83 +0x32a
>> launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
>> /home/dfc/src/
>> launchpad.net/goose/testservices/swiftservice/service_http.go:129 +0x215
>> launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
>> /home/dfc/src/
>> launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
>> net/http.(*ServeMux).ServeHTTP()
>> /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
>> net/http.serverHandler.ServeHTTP()
>> /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
>> net/http.(*conn).serve()
>> /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e
>>
>> Previous write by goroutine 54:
>> runtime.mapdelete()
>> /home/dfc/go/src/pkg/runtime/hashmap.goc:948 +0x0
>> launchpad.net/goose/testservices/swiftservice.(*Swift).RemoveObject()
>> /home/dfc/src/
>> launchpad.net/goose/testservices/swiftservice/service.go:181 +0x360
>> launchpad.net/goose/testservices/swiftservice.(*Swift).handleObjects()
>> /home/dfc/src/
>> launchpad.net/goose/testservices/swiftservice/service_http.go:142 +0x400
>> launchpad.net/goose/testservices/swiftservice.(*Swift).ServeHTTP()
>> /home/dfc/src/
>> launchpad.net/goose/testservices/swiftservice/service_http.go:200 +0x3fb
>> net/http.(*ServeMux).ServeHTTP()
>> /home/dfc/go/src/pkg/net/http/server.go:1511 +0x21c
>> net/http.serverHandler.ServeHTTP()
>> /home/dfc/go/src/pkg/net/http/server.go:1673 +0x1fc
>> net/http.(*conn).serve()
>> /home/dfc/go/src/pkg/net/http/server.go:1174 +0xf9e
>> runtime.gosched0()
>> /home/dfc/go/src/pkg/runtime/proc.c:1440 +0xbf
>> math/big.nat.expNNWindowed()
>> /home/dfc/go/src/pkg/math/big/nat.go:1359 +0xea8
>> math/big.nat.expNN()
>> /home/dfc/go/src/pkg/math/big/nat.go:1260 +0x4f1
>> math/big.nat.probablyPrime()
>> /home/dfc/go/src/pkg/math/big/nat.go:1445 +0x990
>> math/big.(*Int).ProbablyPrime()
>> /home/dfc/go/src/pkg/math/big/int.go:735 +0x7b
>> crypto/rsa.(*PrivateKey).Validate()
>> /home/dfc/go/src/pkg/crypto/rsa/rsa.go:91 +0x188
>> crypto/x509.ParsePKCS1PrivateKey()
>> /home/dfc/go/src/pkg/crypto...

Dave Cheney (dave-cheney) wrote :
Changed in goose:
status: In Progress → Fix Committed
assignee: nobody → Dave Cheney (dave-cheney)
Curtis Hovey (sinzui) on 2014-07-10
Changed in juju-core:
importance: Undecided → High
milestone: none → 1.21-alpha1
status: In Progress → Fix Committed
Curtis Hovey (sinzui) on 2014-09-08
Changed in juju-core:
status: Fix Committed → Fix Released
Changed in goose:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers