Skip to content

kolide_program_icons sometimes panics #2271

Description

@RebeccaMahany

Example stack trace for invalid memory address or nil pointer dereference:

runtime error: invalid memory address or nil pointer dereference
github.com/kolide/launcher/ee/gowrapper.GoWithRecoveryAction.func1.1
	D:/a/launcher/launcher/ee/gowrapper/goroutine.go:31
runtime.gopanic
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/runtime/panic.go:785
runtime.panicmem
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/runtime/panic.go:262
runtime.sigpanic
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/runtime/signal_windows.go:401
compress/flate.(*huffmanBitWriter).writeTokens
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/huffman_bit_writer.go:578
compress/flate.(*huffmanBitWriter).writeBlock
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/huffman_bit_writer.go:492
compress/flate.(*compressor).writeBlock
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:171
compress/flate.(*compressor).deflate
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:409
compress/flate.(*compressor).close
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:639
compress/flate.(*Writer).Close
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:731
compress/zlib.(*Writer).Close
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/zlib/writer.go:184
image/png.(*encoder).writeImage
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:543
image/png.(*encoder).writeIDATs
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:556
image/png.(*Encoder).Encode
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:657
image/png.Encode
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:586
github.com/kolide/launcher/pkg/osquery/table.parseIcoFile
	D:/a/launcher/launcher/pkg/osquery/table/program_icons_windows.go:196
github.com/kolide/launcher/pkg/osquery/table.generateInstallersProgramIcons
	D:/a/launcher/launcher/pkg/osquery/table/program_icons_windows.go:134
github.com/kolide/launcher/pkg/osquery/table.generateProgramIcons
	D:/a/launcher/launcher/pkg/osquery/table/program_icons_windows.go:48
github.com/kolide/launcher/ee/tables/tablewrapper.(*wrappedTable).generate.func1
	D:/a/launcher/launcher/ee/tables/tablewrapper/tablewrapper.go:127
github.com/kolide/launcher/ee/gowrapper.GoWithRecoveryAction.func1
	D:/a/launcher/launcher/ee/gowrapper/goroutine.go:39
runtime.goexit
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/runtime/asm_amd64.s:1700

Example stack trace for index out of range:

runtime error: index out of range [65280] with length 286
github.com/kolide/launcher/ee/gowrapper.GoWithRecoveryAction.func1.1
	D:/a/launcher/launcher/ee/gowrapper/goroutine.go:31
runtime.gopanic
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/runtime/panic.go:785
runtime.goPanicIndex
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/runtime/panic.go:115
compress/flate.(*huffmanBitWriter).writeTokens
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/huffman_bit_writer.go:580
compress/flate.(*huffmanBitWriter).writeBlock
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/huffman_bit_writer.go:492
compress/flate.(*compressor).writeBlock
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:171
compress/flate.(*compressor).deflate
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:409
compress/flate.(*compressor).close
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:639
compress/flate.(*Writer).Close
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/flate/deflate.go:731
compress/zlib.(*Writer).Close
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/compress/zlib/writer.go:184
image/png.(*encoder).writeImage
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:543
image/png.(*encoder).writeIDATs
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:556
image/png.(*Encoder).Encode
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:657
image/png.Encode
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/image/png/writer.go:586
github.com/kolide/launcher/pkg/osquery/table.parseIcoFile
	D:/a/launcher/launcher/pkg/osquery/table/program_icons_windows.go:196
github.com/kolide/launcher/pkg/osquery/table.generateInstallersProgramIcons
	D:/a/launcher/launcher/pkg/osquery/table/program_icons_windows.go:134
github.com/kolide/launcher/pkg/osquery/table.generateProgramIcons
	D:/a/launcher/launcher/pkg/osquery/table/program_icons_windows.go:48
github.com/kolide/launcher/ee/tables/tablewrapper.(*wrappedTable).generate.func1
	D:/a/launcher/launcher/ee/tables/tablewrapper/tablewrapper.go:130
github.com/kolide/launcher/ee/gowrapper.GoWithRecoveryAction.func1
	D:/a/launcher/launcher/ee/gowrapper/goroutine.go:39
runtime.goexit
	C:/hostedtoolcache/windows/go/1.23.0/x64/src/runtime/asm_amd64.s:1700

Also triggered by generateUninstallerProgramIcons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions