Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heartbeat#sendEvent(m): nil-check m before dereferencing it #559

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

Al2Klimov
Copy link
Member

as it can be nil.

@cla-bot cla-bot bot added the cla/signed label Jan 19, 2023
@yhabteab yhabteab requested review from julianbrost and removed request for yhabteab January 24, 2023 12:02
@julianbrost
Copy link
Contributor

For reference, this is what the PR is supposed to fix:

2023-01-19T14:52:34.040Z        INFO    runtime-updates Upserted 1 HostState items
2023-01-19T14:53:27.647Z        WARN    heartbeat       Lost Icinga heartbeat   {"timeout": "1m0s"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2f39a4]

goroutine 13 [running]:
github.com/icinga/icingadb/pkg/icingaredis.(*Heartbeat).sendEvent(0x4000156410, 0x0)
        /go/src/github.com/Icinga/icingadb/pkg/icingaredis/heartbeat.go:184 +0xa4
github.com/icinga/icingadb/pkg/icingaredis.(*Heartbeat).controller.func2()
        /go/src/github.com/Icinga/icingadb/pkg/icingaredis/heartbeat.go:147 +0x170
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x60
created by golang.org/x/sync/errgroup.(*Group).Go
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x8c
exit status 2

@lippserd lippserd self-requested a review June 5, 2023 09:16
@julianbrost julianbrost merged commit 78fa223 into master Jun 5, 2023
@julianbrost julianbrost deleted the segv branch June 5, 2023 10:54
@julianbrost julianbrost added this to the 1.2.0 milestone Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants