google / trillian

A transparent, highly scalable and cryptographically verifiable data store.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nil Metric Factory Prevents Server Initialization

vishalkuo opened this issue · comments

When trying to initialize a trillian_log_server with a nil metric factory, the rpc_stats_interceptor panics:

vishalkuo@Vishal's Macbook Pro trillian (master)*$ ./trillian_log_server --logtostderr
I0915 11:52:25.438108   63941 mysql_quota_provider.go:44] Using MySQL QuotaManager
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1474a08]

goroutine 1 [running]:
github.com/google/trillian/monitoring.NewRPCStatsInterceptor(0x1b6e460, 0x227c8e0, 0x1a3f42a, 0x3, 0x0, 0x0, 0x1b6e400)
	/Users/vishalkuo/go_work/src/github.com/google/trillian/monitoring/rpc_stats_interceptor.go:47 +0xd8
github.com/google/trillian/server.(*Main).newGRPCServer(0xc000392000, 0x7, 0x0, 0xc0003742d0)
	/Users/vishalkuo/go_work/src/github.com/google/trillian/server/main.go:196 +0x83
github.com/google/trillian/server.(*Main).Run(0xc000392000, 0x1b7c400, 0xc000034078, 0x0, 0x0)
	/Users/vishalkuo/go_work/src/github.com/google/trillian/server/main.go:116 +0x82
main.main()
	/Users/vishalkuo/go_work/src/github.com/google/trillian/server/trillian_log_server/main.go:172 +0x6b2

A nil metrics factory is guarded against in various other places so this is likely unintended behaviour

Fixed by #1287