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

Agent segfaults intermittently when it receives a SIGTERM or SIGINT #334

Closed
dekobon opened this issue Jun 6, 2023 · 0 comments · Fixed by #335
Closed

Agent segfaults intermittently when it receives a SIGTERM or SIGINT #334

dekobon opened this issue Jun 6, 2023 · 0 comments · Fixed by #335

Comments

@dekobon
Copy link
Contributor

dekobon commented Jun 6, 2023

On Linux, when I issue a TERM or INT signal to NGINX Agent, I frequently see that Agent has segfaulted instead of exiting gracefully. Upon error, the following is frequently outputted:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11a4b4c]

goroutine 81 [running]:
main.handleSignals.func1()
        /home/elijah/Development/Open_Source/nginx-agent/main.go:139 +0x24c
created by main.handleSignals
        /home/elijah/Development/Open_Source/nginx-agent/main.go:125 +0x251

As best as I can tell, this is caused by not checking if cmder is nil before main.go:133.

dekobon added a commit to dekobon/agent that referenced this issue Jun 6, 2023
Fixes nginx#334

This change prevents agent from having a segmentation fault when
it receives a TERM or INT signal.
Dean-Coakley pushed a commit that referenced this issue Jun 8, 2023
Fixes #334

This change prevents agent from having a segmentation fault when
it receives a TERM or INT signal.
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 a pull request may close this issue.

1 participant