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

Update task_check_system.go #60

Closed
wants to merge 1 commit into from
Closed

Update task_check_system.go #60

wants to merge 1 commit into from

Conversation

jframeau
Copy link
Contributor

Do not delete interface but old values only using useful Trim function.

Otherwise got nil pointer dereference.

[2023-11-26 17:12:22.461][Error][pid:538522][snclient:671] Panic: runtime error: invalid memory address or nil pointer dereference [2023-11-26 17:12:22.461][Error][pid:538522][snclient:672] **** Stack: [2023-11-26 17:12:22.461][Error][pid:538522][snclient:673] goroutine 14 [running]: runtime/debug.Stack()
runtime/debug/stack.go:24 +0x5e
pkg/snclient.(*Agent).logPanicRecover(0x0?)
pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:673 +0x168
panic({0xb3cc40?, 0x11b5da0?})
runtime/panic.go:914 +0x21f
pkg/snclient.(*Counter).GetLast(...)
pkg/snclient@v0.0.0-00010101000000-000000000000/counter.go:91
pkg/snclient.(*CheckNetwork).Check(0xc0001ae800, {0xc0000e4930?, 0x1?}, 0x1?, 0xc000014240, {0x1?, 0x1?, 0xc0002bc200?})
pkg/snclient@v0.0.0-00010101000000-000000000000/check_network.go:107 +0xdb3
pkg/snclient.(*Agent).runCheck(0x50fb0d?, {0xd1c098, 0xc0000e4930}, {0xc0001a94c0, 0xd}, {0xc0002bc1f0, 0x1, 0x1})
pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:727 +0x375
pkg/snclient.(*Agent).RunCheckWithContext(0xd1bf48?, {0xd1c098?, 0xc0000e4930?}, {0xc0001a94c0?, 0xc0002bc1f0?}, {0xc0002bc1f0?, 0x0?, 0xc0003fbcb0?})
pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:688 +0x2a
pkg/snclient.(*Agent).RunCheck(0xc00019ab70?, {0xc0001a94c0, 0xd}, {0xc0002bc1f0, 0x1, 0x1})
pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:683 +0xad
pkg/snclient.(*HandlerNRPE).ServeTCP(0xc000196d08, 0x8589ca442?, {0xd20698?, 0xc000157880})
pkg/snclient@v0.0.0-00010101000000-000000000000/listen_nrpe.go:116 +0x5f4
pkg/snclient.(*Listener).handleTCPCon(0xc0001b0120, {0xd20698, 0xc000157880}, {0x7f12471f8830, 0xc000196d08})
pkg/snclient@v0.0.0-00010101000000-000000000000/listener.go:336 +0x322
pkg/snclient.(*Listener).startListenerTCP.func1({0xd20698?, 0xc000157880?})
pkg/snclient@v0.0.0-00010101000000-000000000000/listener.go:316 +0x6b
created by pkg/snclient.(*Listener).startListenerTCP in goroutine 36
pkg/snclient@v0.0.0-00010101000000-000000000000/listener.go:312 +0x2b6
[2023-11-26 17:12:22.461][Error][pid:538522][snclient:674] *************************

Do not delete interface but old values only using useful Trim function.

Otherwise got nil pointer dereference.

[2023-11-26 17:12:22.461][Error][pid:538522][snclient:671] Panic: runtime error: invalid memory address or nil pointer dereference
[2023-11-26 17:12:22.461][Error][pid:538522][snclient:672] **** Stack:
[2023-11-26 17:12:22.461][Error][pid:538522][snclient:673] goroutine 14 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x5e
pkg/snclient.(*Agent).logPanicRecover(0x0?)
	pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:673 +0x168
panic({0xb3cc40?, 0x11b5da0?})
	runtime/panic.go:914 +0x21f
pkg/snclient.(*Counter).GetLast(...)
	pkg/snclient@v0.0.0-00010101000000-000000000000/counter.go:91
pkg/snclient.(*CheckNetwork).Check(0xc0001ae800, {0xc0000e4930?, 0x1?}, 0x1?, 0xc000014240, {0x1?, 0x1?, 0xc0002bc200?})
	pkg/snclient@v0.0.0-00010101000000-000000000000/check_network.go:107 +0xdb3
pkg/snclient.(*Agent).runCheck(0x50fb0d?, {0xd1c098, 0xc0000e4930}, {0xc0001a94c0, 0xd}, {0xc0002bc1f0, 0x1, 0x1})
	pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:727 +0x375
pkg/snclient.(*Agent).RunCheckWithContext(0xd1bf48?, {0xd1c098?, 0xc0000e4930?}, {0xc0001a94c0?, 0xc0002bc1f0?}, {0xc0002bc1f0?, 0x0?, 0xc0003fbcb0?})
	pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:688 +0x2a
pkg/snclient.(*Agent).RunCheck(0xc00019ab70?, {0xc0001a94c0, 0xd}, {0xc0002bc1f0, 0x1, 0x1})
	pkg/snclient@v0.0.0-00010101000000-000000000000/snclient.go:683 +0xad
pkg/snclient.(*HandlerNRPE).ServeTCP(0xc000196d08, 0x8589ca442?, {0xd20698?, 0xc000157880})
	pkg/snclient@v0.0.0-00010101000000-000000000000/listen_nrpe.go:116 +0x5f4
pkg/snclient.(*Listener).handleTCPCon(0xc0001b0120, {0xd20698, 0xc000157880}, {0x7f12471f8830, 0xc000196d08})
	pkg/snclient@v0.0.0-00010101000000-000000000000/listener.go:336 +0x322
pkg/snclient.(*Listener).startListenerTCP.func1({0xd20698?, 0xc000157880?})
	pkg/snclient@v0.0.0-00010101000000-000000000000/listener.go:316 +0x6b
created by pkg/snclient.(*Listener).startListenerTCP in goroutine 36
	pkg/snclient@v0.0.0-00010101000000-000000000000/listener.go:312 +0x2b6
[2023-11-26 17:12:22.461][Error][pid:538522][snclient:674] *************************
@sni
Copy link
Contributor

sni commented Nov 26, 2023

thanks for looking into this, i have a fix already but could not push it because of another thing. Will do that later.

@jframeau
Copy link
Contributor Author

ok, thx, I'll wait then for your code.

@jframeau jframeau closed this Nov 26, 2023
@sni
Copy link
Contributor

sni commented Nov 26, 2023

i'd say it should be fixed with: c6e4304

@jframeau
Copy link
Contributor Author

jframeau commented Nov 27, 2023 via email

@jframeau
Copy link
Contributor Author

jframeau commented Nov 27, 2023 via email

@sni
Copy link
Contributor

sni commented Nov 27, 2023

weird.. Well, your patch simply removes the cleanup, but interfaces need to be cleaned up because docker and such tools create one-time throw away interfaces all the time.
I'll have a look.

@jframeau
Copy link
Contributor Author

jframeau commented Nov 27, 2023 via email

@jframeau
Copy link
Contributor Author

jframeau commented Nov 27, 2023 via email

sni added a commit that referenced this pull request Nov 27, 2023
@sni
Copy link
Contributor

sni commented Nov 27, 2023

found it, interfaces had been removed all the time, instead of when the last value is older than one hour. Should be fine now.

@jframeau
Copy link
Contributor Author

jframeau commented Nov 27, 2023 via email

@sni
Copy link
Contributor

sni commented Nov 28, 2023

But I don't understand why the "for _, key := range

oh thanks, good catch. It doesn't has to be. I moved it outside that loop with 7707f3f

@jframeau
Copy link
Contributor Author

jframeau commented Nov 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants