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

runtime panic when using tsh built with go1.17 on Darwin #8104

Closed
kjgorman opened this issue Aug 31, 2021 · 1 comment
Closed

runtime panic when using tsh built with go1.17 on Darwin #8104

kjgorman opened this issue Aug 31, 2021 · 1 comment
Labels

Comments

@kjgorman
Copy link

Description

What happened:

Running tsh ssh user@host fails like so:

[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x7fff203a8c9e]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff203a8c9e
stack: frame={sp:0x70000b734e58, fp:0x70000b734ea8} stack=[0x70000b6b5338,0x70000b734f38)
0x000070000b734d58:  0x010070000b734d78  0x0000000000000004
0x000070000b734d68:  0x000000000000001f  0x00007fff203a8c9e
0x000070000b734d78:  0x0b01dfacedebac1e  0x0000000000000001
0x000070000b734d88:  0x0000000004037611 <runtime.throw+0x0000000000000071>  0x000070000b734e28
0x000070000b734d98:  0x0000000004f77fb5  0x000070000b734de0
0x000070000b734da8:  0x00000000040378c8 <runtime.fatalthrow.func1+0x0000000000000048>  0x000000c0000011e0
0x000070000b734db8:  0x0000000000000001  0x0000000000000001
0x000070000b734dc8:  0x000070000b734e28  0x0000000004037611 <runtime.throw+0x0000000000000071>
0x000070000b734dd8:  0x000000c0000011e0  0x000070000b734e18
0x000070000b734de8:  0x0000000004037850 <runtime.fatalthrow+0x0000000000000050>  0x000070000b734df8
0x000070000b734df8:  0x0000000004037880 <runtime.fatalthrow.func1+0x0000000000000000>  0x000000c0000011e0
0x000070000b734e08:  0x0000000004037611 <runtime.throw+0x0000000000000071>  0x000070000b734e28
0x000070000b734e18:  0x000070000b734e48  0x0000000004037611 <runtime.throw+0x0000000000000071>
0x000070000b734e28:  0x000070000b734e30  0x0000000004037640 <runtime.throw.func1+0x0000000000000000>
0x000070000b734e38:  0x0000000004f8b083  0x000000000000002a
0x000070000b734e48:  0x000070000b734e98  0x000000000404ddd6 <runtime.sigpanic+0x0000000000000396>
0x000070000b734e58: <0x0000000004f8b083  0x00000000040404de <runtime.checkTimers+0x000000000000005e>
0x000070000b734e68:  0x00021ef3cde3f762  0x000070000b734ea0
0x000070000b734e78:  0x000070000b734ea0  0x000000000403eacf <runtime.execute+0x000000000000012f>
0x000070000b734e88:  0x000000c0000001d8  0x0000000200000001
0x000070000b734e98:  0x000070000b734ee0 !0x00007fff203a8c9e
0x000070000b734ea8: >0x000070000b734ee0  0x0000000005af8000
0x000070000b734eb8:  0x00000000000007ed  0x0000000004307aa5 <github.com/gravitational/teleport/vendor/golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x000070000b734ec8:  0x000000000406cebf <runtime.syscall+0x000000000000001f>  0x000000c000473520
0x000070000b734ed8:  0x000000c0000001a0  0x000000c0004734f0
0x000070000b734ee8:  0x000000000406ad10 <runtime.asmcgocall+0x0000000000000070>  0x000000000404080d <runtime.park_m+0x000000000000014d>
0x000070000b734ef8:  0x000000c0004bb6c0  0x0000000400000002
0x000070000b734f08:  0x000000c0000011e0  0x000000c0004bb6c0
0x000070000b734f18:  0x0000000000000b38  0x000000c0000001a0
0x000070000b734f28:  0x000000c0004bb6c0  0x000070000b734f50
runtime.throw({0x4f8b083, 0x40404de})
        /usr/local/Cellar/go/1.17/libexec/src/runtime/panic.go:1198 +0x71
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff203a8c9e
stack: frame={sp:0x70000b734e58, fp:0x70000b734ea8} stack=[0x70000b6b5338,0x70000b734f38)
0x000070000b734d58:  0x010070000b734d78  0x0000000000000004
0x000070000b734d68:  0x000000000000001f  0x00007fff203a8c9e
0x000070000b734d78:  0x0b01dfacedebac1e  0x0000000000000001
0x000070000b734d88:  0x0000000004037611 <runtime.throw+0x0000000000000071>  0x000070000b734e28
0x000070000b734d98:  0x0000000004f77fb5  0x000070000b734de0
0x000070000b734da8:  0x00000000040378c8 <runtime.fatalthrow.func1+0x0000000000000048>  0x000000c0000011e0
0x000070000b734db8:  0x0000000000000001  0x0000000000000001
0x000070000b734dc8:  0x000070000b734e28  0x0000000004037611 <runtime.throw+0x0000000000000071>
0x000070000b734dd8:  0x000000c0000011e0  0x000070000b734e18
0x000070000b734de8:  0x0000000004037850 <runtime.fatalthrow+0x0000000000000050>  0x000070000b734df8
0x000070000b734df8:  0x0000000004037880 <runtime.fatalthrow.func1+0x0000000000000000>  0x000000c0000011e0
0x000070000b734e08:  0x0000000004037611 <runtime.throw+0x0000000000000071>  0x000070000b734e28
0x000070000b734e18:  0x000070000b734e48  0x0000000004037611 <runtime.throw+0x0000000000000071>
0x000070000b734e28:  0x000070000b734e30  0x0000000004037640 <runtime.throw.func1+0x0000000000000000>
0x000070000b734e38:  0x0000000004f8b083  0x000000000000002a
0x000070000b734e48:  0x000070000b734e98  0x000000000404ddd6 <runtime.sigpanic+0x0000000000000396>
0x000070000b734e58: <0x0000000004f8b083  0x00000000040404de <runtime.checkTimers+0x000000000000005e>
0x000070000b734e68:  0x00021ef3cde3f762  0x000070000b734ea0
0x000070000b734e78:  0x000070000b734ea0  0x000000000403eacf <runtime.execute+0x000000000000012f>
0x000070000b734e88:  0x000000c0000001d8  0x0000000200000001
0x000070000b734e98:  0x000070000b734ee0 !0x00007fff203a8c9e
0x000070000b734ea8: >0x000070000b734ee0  0x0000000005af8000
0x000070000b734eb8:  0x00000000000007ed  0x0000000004307aa5 <github.com/gravitational/teleport/vendor/golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x000070000b734ec8:  0x000000000406cebf <runtime.syscall+0x000000000000001f>  0x000000c000473520
0x000070000b734ed8:  0x000000c0000001a0  0x000000c0004734f0
0x000070000b734ee8:  0x000000000406ad10 <runtime.asmcgocall+0x0000000000000070>  0x000000000404080d <runtime.park_m+0x000000000000014d>
0x000070000b734ef8:  0x000000c0004bb6c0  0x0000000400000002
0x000070000b734f08:  0x000000c0000011e0  0x000000c0004bb6c0
0x000070000b734f18:  0x0000000000000b38  0x000000c0000001a0
0x000070000b734f28:  0x000000c0004bb6c0  0x000070000b734f50
runtime.sigpanic()
        /usr/local/Cellar/go/1.17/libexec/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall]:
syscall.syscall(0x4307aa0, 0x0, 0x40087468, 0xc0004735b0)
        /usr/local/Cellar/go/1.17/libexec/src/runtime/sys_darwin.go:22 +0x3b fp=0xc000473520 sp=0xc000473500 pc=0x406795b
syscall.syscall(0x4b00, 0x5df, 0x1215177fffff04, 0xf161311191a1c03)
        <autogenerated>:1 +0x26 fp=0xc000473568 sp=0xc000473520 pc=0x406d6c6
github.com/gravitational/teleport/vendor/golang.org/x/sys/unix.ioctl(0x2580, 0xc000473558, 0xc0004735c8)
        /Users/kierangorman/src/github.com/gravitational/teleport/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:746 +0x39 fp=0xc000473598 sp=0xc000473568 pc=0x43075d9
github.com/gravitational/teleport/vendor/golang.org/x/sys/unix.IoctlGetWinsize(...)
        /Users/kierangorman/src/github.com/gravitational/teleport/vendor/golang.org/x/sys/unix/ioctl.go:57
github.com/gravitational/teleport/vendor/github.com/docker/docker/pkg/term.GetWinsize(0x0)
        /Users/kierangorman/src/github.com/gravitational/teleport/vendor/github.com/docker/docker/pkg/term/winsize.go:11 +0x2c fp=0xc0004735d8 sp=0xc000473598 pc=0x461e4ac
github.com/gravitational/teleport/lib/client.(*NodeSession).allocateTerminal(0xc000124c80, {0xc000048015, 0x6}, 0xc000576360)
        /Users/kierangorman/src/github.com/gravitational/teleport/lib/client/session.go:286 +0x77 fp=0xc000473710 sp=0xc0004735d8 pc=0x47b6e17
github.com/gravitational/teleport/lib/client.(*NodeSession).interactiveSession(0xc000124c80, 0xc0004737e8)
        /Users/kierangorman/src/github.com/gravitational/teleport/lib/client/session.go:215 +0xb7 fp=0xc0004737d8 sp=0xc000473710 pc=0x47b67d7
github.com/gravitational/teleport/lib/client.(*NodeSession).runShell(0xc000473800, 0xc0004e8240)
        /Users/kierangorman/src/github.com/gravitational/teleport/lib/client/session.go:439 +0x45 fp=0xc000473810 sp=0xc0004737d8 pc=0x47b8165
github.com/gravitational/teleport/lib/client.(*TeleportClient).runShell(0xc0002e8000, 0x513cbd0, 0xc000475300)
        /Users/kierangorman/src/github.com/gravitational/teleport/lib/client/api.go:1451 +0xad fp=0xc0004738b8 sp=0xc000473810 pc=0x479ddad
github.com/gravitational/teleport/lib/client.(*TeleportClient).SSH(0xc0002e8000, {0x513cbd0, 0xc000475300}, {0x0, 0x0, 0x0}, 0x0)
        /Users/kierangorman/src/github.com/gravitational/teleport/lib/client/api.go:935 +0x585 fp=0xc0004739c8 sp=0xc0004738b8 pc=0x4799105
main.onSSH(0xc000462480)
        /Users/kierangorman/src/github.com/gravitational/teleport/tool/tsh/tsh.go:745 +0x9e fp=0xc000473a28 sp=0xc0004739c8 pc=0x4cc0e1e
main.Run({0xc00003c1f0, 0x5, 0x5}, 0x0)
        /Users/kierangorman/src/github.com/gravitational/teleport/tool/tsh/tsh.go:335 +0x5725 fp=0xc000473f20 sp=0xc000473a28 pc=0x4cbd9c5
main.main()
        /Users/kierangorman/src/github.com/gravitational/teleport/tool/tsh/tsh.go:176 +0x20f fp=0xc000473f80 sp=0xc000473f20 pc=0x4cb81cf
runtime.main()
        /usr/local/Cellar/go/1.17/libexec/src/runtime/proc.go:255 +0x227 fp=0xc000473fe0 sp=0xc000473f80 pc=0x4039ca7
runtime.goexit()
        /usr/local/Cellar/go/1.17/libexec/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000473fe8 sp=0xc000473fe0 pc=0x406b001

…(more stacks elided — I think not relevant, lmk if you want all of them)…

What you expected to happen:

An SSH session to start...

Reproduction Steps

As minimally and precisely as possible, describe step-by-step how to reproduce the problem.

  1. Install tool/tsh using go1.17 on MacOS/Darwin
  2. tsh ssh user@host
  3. Observe crash — reproduces 100% of the time for me

Server Details

  • Teleport version (run teleport version): n/a
  • Server OS (e.g. from /etc/os-release): n/a
  • Where are you running Teleport? (e.g. AWS, GCP, Dedicated Hardware): n/a
  • Additional details: n/a

Client Details

  • Tsh version (tsh version): v3.2.11
  • Computer OS (e.g. Linux, macOS, Windows): Darwin Kernel Version 20.4.0 x86
  • Browser version (for UI-related issues): n/a
  • Installed via (e.g. apt, yum, brew, website download): built from source
  • Additional details:

Debug Logs

Please include or attach debug logs, when appropriate. Obfuscate sensitive information!

  • Start Teleport with --debug flag (teleport --debug)
  • Run tsh with --debug flag (tsh --debug)
@kjgorman kjgorman added the bug label Aug 31, 2021
@kjgorman
Copy link
Author

This seems to be the same issue as reported here: golang/go#46763 — the suggested fix is to re-vendor x/sys to pick up this fix: golang/go#45702

@zmb3 zmb3 closed this as completed Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants