osquery / osquery-go

Go bindings for osquery
MIT License
386 stars 78 forks source link

Failure to run custom logger example since eb3599e #60

Closed leonjza closed 6 years ago

leonjza commented 6 years ago

Hey,

Today I updated the dependencies of my local osquery plugin that makes use of osquery-go and can no longer start a custom logger. As soon as I try and Run() a NewExtensionManagerServer() instance, I get a panic as follows:

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

goroutine 35 [running]:
github.com/xxxxt/vendor/github.com/kolide/osquery-go/gen/osquery.(*ExtensionManagerClient).RegisterExtension(0xc4201bc060, 0x150c400, 0xc4200be010, 0xc4201c2080, 0xc4201a8090, 0x1471de0, 0x1, 0xc4201c2080)
    /Users/xxxx/Documents/git/gopath/src/github.com/xxxxt/vendor/github.com/kolide/osquery-go/gen/osquery/osquery.go:1853 +0x8a
github.com/xxxxt/vendor/github.com/kolide/osquery-go.(*ExtensionManagerClient).RegisterExtension(0xc4201bc080, 0xc4201c2080, 0xc4201a8090, 0x0, 0x0, 0x0)
    /Users/xxxx/Documents/git/gopath/src/github.com/xxxxt/vendor/github.com/kolide/osquery-go/client.go:73 +0x5f
github.com/xxxxt/vendor/github.com/kolide/osquery-go.(*ExtensionManagerServer).Start.func1(0xc42001e080, 0xc4201d0f78, 0x0, 0x0)
    /Users/xxxx/Documents/git/gopath/src/github.com/xxxxt/vendor/github.com/kolide/osquery-go/server.go:143 +0xfe
github.com/xxxxt/vendor/github.com/kolide/osquery-go.(*ExtensionManagerServer).Start(0xc42001e080, 0x0, 0x0)
    /Users/xxxx/Documents/git/gopath/src/github.com/xxxxt/vendor/github.com/kolide/osquery-go/server.go:172 +0x41
github.com/xxxxt/vendor/github.com/kolide/osquery-go.(*ExtensionManagerServer).Run.func1(0xc4201c0060, 0xc42001e080)
    /Users/xxxx/Documents/git/gopath/src/github.com/xxxxt/vendor/github.com/kolide/osquery-go/server.go:186 +0x2b
created by github.com/xxxxt/vendor/github.com/kolide/osquery-go.(*ExtensionManagerServer).Run
    /Users/xxxx/Documents/git/gopath/src/github.com/xxxxt/vendor/github.com/kolide/osquery-go/server.go:185 +0x66

The example here currently shows the same behaviour. Could it be that there is a change in how the logger should be registered?

leonjza commented 6 years ago

Pinning the dependency to d4f3a629e76ccc0d62dccc16a9b8d52e7b2fb10b still works fine for now.

groob commented 6 years ago

I'm guessing this was fixed in #61 @leonjza can you confirm?

zwass commented 6 years ago

Should be fixed by #61.

leonjza commented 6 years ago

Confirmed working with 0d2b07f57cb4def53a17a093662f80b862efbcca again. Thanks!