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

Crash due to nil *net.Conn when server is restarted with open change stream

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    Description

      I got the following panic when restarting the MongoDB server with an open change stream. I'm using the master branch of the driver and MongoDB 4.0.4.

      You can run the following example yourself and restart the server to get the crash:
      https://github.com/256dpi/fire/tree/official-driver/example

      panic: runtime error: invalid memory address or nil pointer dereferencepanic: runtime error: invalid memory address or nil pointer dereference[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x149cc39]
      goroutine 36 [running]:go.mongodb.org/mongo-driver/x/mongo/driver/topology.newConnection(0x184f4a0, 0xc0000c2048, 0xc0002e0280, 0xf, 0xc0002e6050, 0x2, 0x2, 0x5509850, 0xc00043e300, 0xc000168e00) /Users/256dpi/Development/Go/pkg/mod/go.mongodb.org/mongo-driver@v1.0.1-0.20190520233249-537a129acde0/x/mongo/driver/topology/connection.go:101 +0x739go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*pool).get(0xc0000ac120, 0x184f4a0, 0xc0000c2048, 0x1, 0x0, 0x0) /Users/256dpi/Development/Go/pkg/mod/go.mongodb.org/mongo-driver@v1.0.1-0.20190520233249-537a129acde0/x/mongo/driver/topology/pool.go:157 +0xf6go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*Server).ConnectionLegacy(0xc0002ee000, 0x184f4a0, 0xc0000c2048, 0xa7000000, 0x2540be400, 0x0, 0x0) /Users/256dpi/Development/Go/pkg/mod/go.mongodb.org/mongo-driver@v1.0.1-0.20190520233249-537a129acde0/x/mongo/driver/topology/server.go:244 +0xb8go.mongodb.org/mongo-driver/x/mongo/driverlegacy.KillCursors(0x184f4a0, 0xc0000c2048, 0xc0000c78a0, 0xc, 0xc0000c78ad, 0x4, 0x1842c40, 0xc0002ee000, 0x4b861a30c0352624, 0x0, ...) /Users/256dpi/Development/Go/pkg/mod/go.mongodb.org/mongo-driver@v1.0.1-0.20190520233249-537a129acde0/x/mongo/driverlegacy/kill_cursors.go:36 +0x2b0go.mongodb.org/mongo-driver/mongo.(*ChangeStream).loopNext(0xc000360140, 0x184f4a0, 0xc0000c2048) /Users/256dpi/Development/Go/pkg/mod/go.mongodb.org/mongo-driver@v1.0.1-0.20190520233249-537a129acde0/mongo/change_stream.go:558 +0x35bgo.mongodb.org/mongo-driver/mongo.(*ChangeStream).Next(0xc000360140, 0x0, 0x0, 0x0) /Users/256dpi/Development/Go/pkg/mod/go.mongodb.org/mongo-driver@v1.0.1-0.20190520233249-537a129acde0/mongo/change_stream.go:507 +0x169github.com/256dpi/fire/coal.(*Stream).tail(0xc0000c4460, 0xc0000b73b0, 0xc000169fb0, 0x0, 0x0) /Users/256dpi/Development/GitHub/256dpi/fire/coal/stream.go:166 +0x27agithub.com/256dpi/fire/coal.(*Stream).open(0xc0000c4460) /Users/256dpi/Development/GitHub/256dpi/fire/coal/stream.go:122 +0xc3created by github.com/256dpi/fire/coal.OpenStream /Users/256dpi/Development/GitHub/256dpi/fire/coal/stream.go:76 +0xc1

      Attachments

        Activity

          People

            manny.eppinger@mongodb.com Emmanuel Eppinger (Inactive)
            joel.gaehwiler@gmail.com Joël Gähwiler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: