Skip to content

Panic when gapit commands -context is too high #2679

@hevrard

Description

@hevrard

Calling gapit commands -context 100 foo.gfxtrace leads to a panic, while it should gracefully fail.

Example of panic:

panic: runtime error: index out of range [recovered]
	panic: runtime error: index out of range

goroutine 1 [running]:
github.com/google/gapid/core/app/crash.Crash(0xf6ecc0, 0x177be30)
	core/app/crash/crash.go:89 +0xe1
github.com/google/gapid/core/app.Run.func1()
	core/app/run.go:161 +0xec
panic(0xf6ecc0, 0x177be30)
	GOROOT/src/runtime/panic.go:513 +0x1b9
main.CommandFilterFlags.commandFilter(0x2a, 0x115b460, 0xc000257110, 0x7fe3fcd37048, 0xc0002a80c0, 0xc0002562d0, 0x0, 0x0, 0x0)
	cmd/gapit/common.go:52 +0x2f0
main.(*commandsVerb).Run(0xc000234500, 0x115b460, 0xc000257110, 0xc000284200, 0x0, 0x0, 0x1, 0xc000257200, 0xc000256990, 0xc00027dd30, ...)
	cmd/gapit/commands.go:61 +0x493
github.com/google/gapid/core/app.(*Verb).Invoke(0x17d7500, 0x115b460, 0xc000257110, 0xc00027dd00, 0x4, 0x4, 0x0, 0x0)
	core/app/verbs.go:92 +0x742
github.com/google/gapid/core/app.VerbMain(0x115b460, 0xc000257110, 0x0, 0x0)
	core/app/verbs.go:123 +0x9a
github.com/google/gapid/core/app.Run(0x1097750)
	core/app/run.go:253 +0xbc5
main.main()
	cmd/gapit/main.go:24 +0x7d

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions