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

Opening a change stream cursor for any database gives error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 0.2.0
    • Affects Version/s: None
    • Component/s: CRUD
    • Labels:
      None
    • Environment:
      Ubuntu 18.04.1 LTS
      go version go1.11.2 linux/amd64

      On opening a change stream cursor for any database, whenever the cursor is used to decode, it panics on runtime.

      Generate the case using: this

      Output

      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x779242]

      goroutine 1 [running]:
      github.com/mongodb/mongo-go-driver/mongo.(*changeStream).Decode(0xc000118000, 0x7bb880, 0xc000116028, 0xc0000cfe01, 0x42ad92)
      $GOPATH/src/github.com/mongodb/mongo-go-driver/mongo/change_stream.go:454 +0x62
      main.traverseCursor(0x979100, 0xc00001e0f0, 0x97a0c0, 0xc000118000)
      .../main.go:27 +0x48
      main.watchOnDB(0x979100, 0xc00001e0f0, 0xc000093400, 0x84e5bc, 0x6)
      .../main.go:68 +0x1dc
      main.main()
      .../main.go:81 +0x119

      Process finished with exit code 2

      I have resolved the bug and created a PR on Github: #117

       

            Assignee:
            go-community-user Go Community User
            Reporter:
            shivam010 Shivam Rathore
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: