Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1493

Tools crash running help when terminal width is low

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 100.0.0
    • Affects Version/s: None
    • Component/s: All Tools
    • Not Needed

      When running --help with a narrow terminal, crashed. Appears to be an issue with go-flags.

       ~/Documents/repos ◯ mongoimport --help
      panic: runtime error: slice bounds out of range
      
      goroutine 1 [running]:
      github.com/jessevdk/go-flags.wrapText(0x759b09, 0xb, 0xfffffffffffffff8, 0xc2080a2180, 0x32, 0x0, 0x0)
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/vendor/src/github.com/jessevdk/go-flags/convert.go:333 +0x3b8
      github.com/jessevdk/go-flags.(*Parser).writeHelpOption(0xc208040190, 0xc2080a2100, 0xc208072160, 0x25, 0x101, 0x2a, 0x0)
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/vendor/src/github.com/jessevdk/go-flags/help.go:204 +0x81a
      github.com/jessevdk/go-flags.func·008(0xc20804a120)
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/vendor/src/github.com/jessevdk/go-flags/help.go:371 +0x506
      github.com/jessevdk/go-flags.(*Group).eachGroup(0xc20804a120, 0xc208092d08)
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/vendor/src/github.com/jessevdk/go-flags/group_private.go:50 +0x2d
      github.com/jessevdk/go-flags.(*Group).eachGroup(0xc20804a090, 0xc208092d08)
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/vendor/src/github.com/jessevdk/go-flags/group_private.go:53 +0x87
      github.com/jessevdk/go-flags.(*Parser).WriteHelp(0xc208040190, 0x7f213670ac18, 0xc208046008)
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/vendor/src/github.com/jessevdk/go-flags/help.go:373 +0xc84
      github.com/mongodb/mongo-tools/common/options.(*ToolOptions).PrintHelp(0xc208070080, 0xc20800a200, 0x8818c8)
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/common/options/options.go:237 +
      0x84
      main.main()
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/mongoimport/main/mongoimport.go:36 +0x37d
      
      goroutine 5 [syscall]:
      os/signal.loop()
              /usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
      created by os/signal.init·1
              /usr/local/go/src/os/signal/signal_unix.go:27 +0x35
      
      goroutine 6 [chan receive]:
      github.com/mongodb/mongo-tools/common/signals.Handle()
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/common/signals/signals_unix.go:
      16 +0x209
      created by main.main
              /srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/mongoimport/main/mongoimport.go:16 +0x34
      [2]
      

            Assignee:
            evgeni.dobranov@mongodb.com Evgeni Dobranov
            Reporter:
            william.banfield William Banfield
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: