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

Fix segfault in Server.Serve #14173

Merged
merged 6 commits into from
Jul 7, 2022
Merged

Conversation

nklaassen
Copy link
Contributor

This PR fixes a segfault that can occur in lib/srv/regular.(*Server).Serve.

I discovered this while running TestHSMRotation on a ubuntu ec2 instance, it seems to reproduce in 1/5 runs. The segfault occurs when Server.close() is called before Server.Serve.

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

goroutine 5961 [running]:
github.com/gravitational/teleport/lib/srv/regular.(*Server).Serve(0xc001f6b080, {0x546e810, 0xc001f5bad0})
        /home/ubuntu/src/teleport2/lib/srv/regular/sshserver.go:388 +0x134
created by github.com/gravitational/teleport/lib/service.(*TeleportProcess).initProxyEndpoint.func6
        /home/ubuntu/src/teleport2/lib/service/service.go:3506 +0x2be
FAIL    github.com/gravitational/teleport/integration/hsm       13.760s
FAIL

@nklaassen nklaassen enabled auto-merge (squash) July 7, 2022 16:11
@nklaassen nklaassen merged commit 76aced4 into master Jul 7, 2022
@github-actions
Copy link

github-actions bot commented Jul 7, 2022

@nklaassen See the table below for backport results.

Branch Result
branch/v10 Create PR
branch/v7 Failed
branch/v8 Failed
branch/v9 Failed

nklaassen added a commit that referenced this pull request Jul 7, 2022
@nklaassen nklaassen deleted the nklaassen/fix-heartbeat-segfault branch July 8, 2022 04:01
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.

3 participants