Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-791

Panic on cursor Close with a dead server

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.3.0
    • Affects Version/s: 0.0.2
    • Component/s: Error Handling
    • Labels:
      None
    • Environment:
      Linux

      Received the following panic when doing some negative testing.  This seems to have occurred when Close() was called on a cursor after Next() returned false. 

      I started a long running query with MongoDB running and brought mongod down in the middle of it returning results.   So mongod was down at the time of the Close call.  

      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x743edc]
      goroutine 59 [running]:
      github.com/mongodb/mongo-go-driver/x/mongo/driver/topology.(*cursor).legacy(...)
      /home/vagrant/go/pkg/mod/github.com/mongodb/mongo-go-driver@v0.2.0/x/mongo/driver/topology/cursor.go:142
      github.com/mongodb/mongo-go-driver/x/mongo/driver/topology.(*cursor).Close(0xc00007ab40, 0x9ab240, 0xc0000140b0, 0x0, 0x0)
      /home/vagrant/go/pkg/mod/github.com/mongodb/mongo-go-driver@v0.2.0/x/mongo/driver/topology/cursor.go:207 +0x16c

            Assignee:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            ryan.m.wynn@gmail.com Ryan Wynn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: