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

Go 1.17 segmentation violation on MacOS Big Sur #1836

Closed
marsmining opened this issue Aug 24, 2021 · 9 comments · Fixed by #1859
Closed

Go 1.17 segmentation violation on MacOS Big Sur #1836

marsmining opened this issue Aug 24, 2021 · 9 comments · Fixed by #1859

Comments

@marsmining
Copy link

marsmining commented Aug 24, 2021

Describe the bug
Using Go 1.17 I see error running skipper:

skipper                                                                                                                     <
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x7fff2036ac9e]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff2036ac9e

To Reproduce
Install Go 1.17 on MacOS Big Sur then run:

GO111MODULE=on go get github.com/zalando/skipper/...

And the run skipper.

Expected behavior

No segmentation violation.

Observed behavior

Segmentation violation.

@AlexanderYastrebov
Copy link
Member

Hello, thank you for reporting.
Does it fail if you run it via docker docker run registry.opensource.zalan.do/teapot/skipper:v0.13.89 skipper?

@marsmining
Copy link
Author

That Docker command runs great.

@AlexanderYastrebov
Copy link
Member

Is there any additional data like stacktrace or skipper version (go: downloading github.com/zalando/skipper vXXX)?

Both
docker run registry.opensource.zalan.do/teapot/skipper:v0.13.89 skipper and GO111MODULE=on go get github.com/zalando/skipper/... work on Ubuntu.

@AlexanderYastrebov AlexanderYastrebov changed the title Go 1.17 segmentation violation Go 1.17 segmentation violation on MacOS Big Sur Aug 25, 2021
@joeypedicini92
Copy link

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x7fff203e3c9e]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff203e3c9e
stack: frame={sp:0x700005a51e58, fp:0x700005a51ea8} stack=[0x7000059d2338,0x700005a51f38)
0x0000700005a51d58:  0x0100700005a51d78  0x0000000000000004
0x0000700005a51d68:  0x000000000000001f  0x00007fff203e3c9e
0x0000700005a51d78:  0x0b01dfacedebac1e  0x0000000000000001
0x0000700005a51d88:  0x0000000004039c11 <runtime.throw+0x0000000000000071>  0x0000700005a51e28
0x0000700005a51d98:  0x0000000004c95ea8  0x0000700005a51de0
0x0000700005a51da8:  0x0000000004039ec8 <runtime.fatalthrow.func1+0x0000000000000048>  0x000000c00049e820
0x0000700005a51db8:  0x0000000000000001  0x0000000000000001
0x0000700005a51dc8:  0x0000700005a51e28  0x0000000004039c11 <runtime.throw+0x0000000000000071>
0x0000700005a51dd8:  0x000000c00049e820  0x0000700005a51e18
0x0000700005a51de8:  0x0000000004039e50 <runtime.fatalthrow+0x0000000000000050>  0x0000700005a51df8
0x0000700005a51df8:  0x0000000004039e80 <runtime.fatalthrow.func1+0x0000000000000000>  0x000000c00049e820
0x0000700005a51e08:  0x0000000004039c11 <runtime.throw+0x0000000000000071>  0x0000700005a51e28
0x0000700005a51e18:  0x0000700005a51e48  0x0000000004039c11 <runtime.throw+0x0000000000000071>
0x0000700005a51e28:  0x0000700005a51e30  0x0000000004039c40 <runtime.throw.func1+0x0000000000000000>
0x0000700005a51e38:  0x0000000004ca5b4f  0x000000000000002a
0x0000700005a51e48:  0x0000700005a51e98  0x00000000040504f6 <runtime.sigpanic+0x0000000000000396>
0x0000700005a51e58: <0x0000000004ca5b4f  0x000000c000057800
0x0000700005a51e68:  0x000000c000100000  0x0000000000000000
0x0000700005a51e78:  0x0000000000000000  0x0000700005a51eb0
0x0000700005a51e88:  0x0000700005a51eb0  0x000000000404138f <runtime.execute+0x000000000000012f>
0x0000700005a51e98:  0x0000700005a51ee0 !0x00007fff203e3c9e
0x0000700005a51ea8: >0x0000700005a51ee0  0x0000000005544000
0x0000700005a51eb8:  0x00000000000004c2  0x000000000412b405 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x0000700005a51ec8:  0x000000000407029f <runtime.syscall+0x000000000000001f>  0x000000c000188568
0x0000700005a51ed8:  0x0000000000000000  0x000000c000188538
0x0000700005a51ee8:  0x000000000406e0d0 <runtime.asmcgocall+0x0000000000000070>  0x000000c000061800
0x0000700005a51ef8:  0x0000700005a51f20  0x000000000403f1ad <runtime.mstart1+0x00000000000000cd>
0x0000700005a51f08:  0x000000c000061800  0x0000000000000000
0x0000700005a51f18:  0x0000000000003af0  0x000000c0000001a0
0x0000700005a51f28:  0x000000000403f0ac <runtime.mstart0+0x000000000000006c>  0x0000700005a51f50
runtime.throw({0x4ca5b4f, 0xc000057800})
	/usr/local/go/src/runtime/panic.go:1198 +0x71
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff203e3c9e
stack: frame={sp:0x700005a51e58, fp:0x700005a51ea8} stack=[0x7000059d2338,0x700005a51f38)
0x0000700005a51d58:  0x0100700005a51d78  0x0000000000000004
0x0000700005a51d68:  0x000000000000001f  0x00007fff203e3c9e
0x0000700005a51d78:  0x0b01dfacedebac1e  0x0000000000000001
0x0000700005a51d88:  0x0000000004039c11 <runtime.throw+0x0000000000000071>  0x0000700005a51e28
0x0000700005a51d98:  0x0000000004c95ea8  0x0000700005a51de0
0x0000700005a51da8:  0x0000000004039ec8 <runtime.fatalthrow.func1+0x0000000000000048>  0x000000c00049e820
0x0000700005a51db8:  0x0000000000000001  0x0000000000000001
0x0000700005a51dc8:  0x0000700005a51e28  0x0000000004039c11 <runtime.throw+0x0000000000000071>
0x0000700005a51dd8:  0x000000c00049e820  0x0000700005a51e18
0x0000700005a51de8:  0x0000000004039e50 <runtime.fatalthrow+0x0000000000000050>  0x0000700005a51df8
0x0000700005a51df8:  0x0000000004039e80 <runtime.fatalthrow.func1+0x0000000000000000>  0x000000c00049e820
0x0000700005a51e08:  0x0000000004039c11 <runtime.throw+0x0000000000000071>  0x0000700005a51e28
0x0000700005a51e18:  0x0000700005a51e48  0x0000000004039c11 <runtime.throw+0x0000000000000071>
0x0000700005a51e28:  0x0000700005a51e30  0x0000000004039c40 <runtime.throw.func1+0x0000000000000000>
0x0000700005a51e38:  0x0000000004ca5b4f  0x000000000000002a
0x0000700005a51e48:  0x0000700005a51e98  0x00000000040504f6 <runtime.sigpanic+0x0000000000000396>
0x0000700005a51e58: <0x0000000004ca5b4f  0x000000c000057800
0x0000700005a51e68:  0x000000c000100000  0x0000000000000000
0x0000700005a51e78:  0x0000000000000000  0x0000700005a51eb0
0x0000700005a51e88:  0x0000700005a51eb0  0x000000000404138f <runtime.execute+0x000000000000012f>
0x0000700005a51e98:  0x0000700005a51ee0 !0x00007fff203e3c9e
0x0000700005a51ea8: >0x0000700005a51ee0  0x0000000005544000
0x0000700005a51eb8:  0x00000000000004c2  0x000000000412b405 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x0000700005a51ec8:  0x000000000407029f <runtime.syscall+0x000000000000001f>  0x000000c000188568
0x0000700005a51ed8:  0x0000000000000000  0x000000c000188538
0x0000700005a51ee8:  0x000000000406e0d0 <runtime.asmcgocall+0x0000000000000070>  0x000000c000061800
0x0000700005a51ef8:  0x0000700005a51f20  0x000000000403f1ad <runtime.mstart1+0x00000000000000cd>
0x0000700005a51f08:  0x000000c000061800  0x0000000000000000
0x0000700005a51f18:  0x0000000000003af0  0x000000c0000001a0
0x0000700005a51f28:  0x000000000403f0ac <runtime.mstart0+0x000000000000006c>  0x0000700005a51f50
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall]:
syscall.syscall(0x412b400, 0x2, 0x40487413, 0xc0001885f8)
	/usr/local/go/src/runtime/sys_darwin.go:22 +0x3b fp=0xc000188568 sp=0xc000188548 pc=0x406ac9b
syscall.syscall(0x8, 0x38, 0x0, 0x5555555555555)
	<autogenerated>:1 +0x26 fp=0xc0001885b0 sp=0xc000188568 pc=0x4070a66
golang.org/x/sys/unix.ioctl(0xc0001886e8, 0x10, 0x203000)
	/Users/joey/Repos/ws/pkg/mod/golang.org/x/sys@v0.0.0-20210415045647-66c3f260301c/unix/zsyscall_darwin_amd64.go:690 +0x39 fp=0xc0001885e0 sp=0xc0001885b0 pc=0x412acb9
golang.org/x/sys/unix.IoctlGetTermios(...)
	/Users/joey/Repos/ws/pkg/mod/golang.org/x/sys@v0.0.0-20210415045647-66c3f260301c/unix/ioctl.go:73
github.com/sirupsen/logrus.isTerminal(0x2)
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/terminal_check_bsd.go:10 +0x50 fp=0xc000188650 sp=0xc0001885e0 pc=0x4136630
github.com/sirupsen/logrus.checkIfTerminal({0x4ddaea0, 0xc000010020})
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/terminal_check_notappengine.go:13 +0x75 fp=0xc000188668 sp=0xc000188650 pc=0x41366d5
github.com/sirupsen/logrus.(*TextFormatter).init(...)
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/text_formatter.go:86
github.com/sirupsen/logrus.(*TextFormatter).Format.func1()
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/text_formatter.go:170 +0x36 fp=0xc000188690 sp=0xc000188668 pc=0x4137d76
sync.(*Once).doSlow(0x4dee9d0, 0xc000484150)
	/usr/local/go/src/sync/once.go:68 +0xd2 fp=0xc0001886f8 sp=0xc000188690 pc=0x4086172
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:59
github.com/sirupsen/logrus.(*TextFormatter).Format(0xc00009c0a0, 0xc00013c0e0)
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/text_formatter.go:170 +0xebe fp=0xc000188c68 sp=0xc0001886f8 pc=0x413771e
github.com/zalando/skipper/logging.(*prefixFormatter).Format(0xc00012a020, 0x4049701)
	/Users/joey/Repos/ws/pkg/mod/github.com/zalando/skipper@v0.13.105/logging/log.go:51 +0x2e fp=0xc000188cc8 sp=0xc000188c68 pc=0x433622e
github.com/sirupsen/logrus.(*Entry).write(0xc00013c0e0)
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:255 +0xa5 fp=0xc000188d40 sp=0xc000188cc8 pc=0x4131385
github.com/sirupsen/logrus.Entry.log({0xc0000ba000, 0xc000126210, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0}, 0x0, ...}, ...)
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:231 +0x22e fp=0xc000188dc0 sp=0xc000188d40 pc=0x413102e
github.com/sirupsen/logrus.(*Entry).Log(0xc00013c070, 0x4, {0xc000188ef0, 0x1, 0x1})
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:268 +0xa8 fp=0xc000188ec8 sp=0xc000188dc0 pc=0x4131588
github.com/sirupsen/logrus.(*Entry).Logf(0xc00013c070, 0x4, {0x4c904af, 0x0}, {0xc00018a078, 0x0, 0x0})
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/entry.go:314 +0x85 fp=0xc000188f10 sp=0xc000188ec8 pc=0x4131b05
github.com/sirupsen/logrus.(*Logger).Logf(0xc0000ba000, 0x4, {0x4c904af, 0x1b}, {0xc00018a078, 0x1, 0x1})
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/logger.go:145 +0x85 fp=0xc000188f60 sp=0xc000188f10 pc=0x4134705
github.com/sirupsen/logrus.(*Logger).Infof(...)
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/logger.go:159
github.com/sirupsen/logrus.Infof(...)
	/Users/joey/Repos/ws/pkg/mod/github.com/sirupsen/logrus@v1.4.2/exported.go:154
github.com/zalando/skipper.run({0xa7a358200, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0x4c77de0, 0x5}, 0x0, ...}, ...)
	/Users/joey/Repos/ws/pkg/mod/github.com/zalando/skipper@v0.13.105/skipper.go:1128 +0x226 fp=0xc00018a598 sp=0xc000188f60 pc=0x4a2d6e6
github.com/zalando/skipper.Run(...)
	/Users/joey/Repos/ws/pkg/mod/github.com/zalando/skipper@v0.13.105/skipper.go:1609
main.main()
	/Users/joey/Repos/ws/pkg/mod/github.com/zalando/skipper@v0.13.105/cmd/skipper/main.go:47 +0x105 fp=0xc00018bf80 sp=0xc00018a598 pc=0x4a3bf65
runtime.main()
	/usr/local/go/src/runtime/proc.go:255 +0x227 fp=0xc00018bfe0 sp=0xc00018bf80 pc=0x403c567
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00018bfe8 sp=0xc00018bfe0 pc=0x406e3c1

[1]  + exit 2     skipper -routes-file example.eskip

@szuecs
Copy link
Member

szuecs commented Sep 18, 2021

@joeypedicini92 you also built on a Mac, right?
Can you please all including @marsmining share how you built skipper?

@joeypedicini92
Copy link

joeypedicini92 commented Sep 18, 2021

I just followed the steps in the readme exactly, and yeah also on mac

@AlexanderYastrebov
Copy link
Member

Judging from the trace #1836 (comment) this sirupsen/logrus#1285 seems related

AlexanderYastrebov added a commit that referenced this issue Sep 18, 2021
Older version of indirect golang.org/x/sys caused SIGSEGV on Go 1.17 on MacOS Big Sur

See sirupsen/logrus#1275
Fixes #1836

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
@AlexanderYastrebov
Copy link
Member

I have created a PR #1859 to update logrus

@joeypedicini92 @marsmining Could you please check if PR fixes the problem?

@marsmining
Copy link
Author

Thanks @AlexanderYastrebov. I can confirm it fixes the problem.

  1. I had go1.16.7 installed, ran make clean then make install then skipper and everything is ok.
  2. I then installed go1.17.1 and repeated step one and got a panic as described in this issue.
  3. I then checked out branch of Updates logrus dependency #1859 and repeated step one and everything is ok.

AlexanderYastrebov added a commit that referenced this issue Sep 20, 2021
Older version of indirect golang.org/x/sys caused SIGSEGV on Go 1.17 on MacOS Big Sur

See sirupsen/logrus#1275
Fixes #1836

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
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.

4 participants