Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2905

gremlin-go gorillaTransporter.logHandler is not initialized correctly and leads to panic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.7.0, 3.6.3, 3.5.6
    • go
    • Patch

    Description

      Whenever the gorillaTransporter needs to write a log message we get a nil dereference error:

      panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x710432]goroutine 22 [running]: github.com/nicksnyder/go-i18n/v2/i18n.(*Localizer).getMessageTemplate(0x0, {0xc4a40c, 0x17}, 0x0)         /Users/disq/go/pkg/mod/github.com/nicksnyder/go-i18n/v2@v2.2.1/i18n/localizer.go:182 +0x32 github.com/nicksnyder/go-i18n/v2/i18n.(*Localizer).LocalizeWithTag(0xb?, 0xc000092e68)         /Users/disq/go/pkg/mod/github.com/nicksnyder/go-i18n/v2@v2.2.1/i18n/localizer.go:158 +0x29b github.com/nicksnyder/go-i18n/v2/i18n.(*Localizer).Localize(...)         /Users/disq/go/pkg/mod/github.com/nicksnyder/go-i18n/v2@v2.2.1/i18n/localizer.go:113 github.com/apache/tinkerpop/gremlin-go/v3/driver.(*logHandler).logf(0xc000241d68, 0x4, {0xc4a40c?, 0x0?}, {0xc003d3b520, 0x2, 0x2})         /Users/disq/Downloads/tinkerpop/gremlin-go/driver/logger.go:93 +0x8d github.com/apache/tinkerpop/gremlin-go/v3/driver.(*gorillaTransporter).writeLoop(0xc000241d40)         /Users/disq/Downloads/tinkerpop/gremlin-go/driver/gorillaTransporter.go:189 +0x508 created by github.com/apache/tinkerpop/gremlin-go/v3/driver.(*gorillaTransporter).Connect         /Users/disq/Downloads/tinkerpop/gremlin-go/driver/gorillaTransporter.go:90 +0x332
       

      Since logHandler is not initialized with the constructor (zero value is used instead) logVerbosity is not passed on and localizer is also nil. This leads to a nil dereference error when the localizer is used in the logger. Turning logging off (setting logVerbosity to Off) also doesn't work because the verbosity value is also affected and not passed on.

      Attachments

        Activity

          People

            Unassigned Unassigned
            disq Kemal Hadimli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: