arduino-create-agent icon indicating copy to clipboard operation
arduino-create-agent copied to clipboard

Incompatibility with Go 1.17.1

Open rhaidiz opened this issue 3 years ago • 0 comments

Bug Report

Describe the bug

Segmentation violation at runtime when running the Create Agent compiled with Go version 1.17.1

To Reproduce

  • Compile the repository with Go 1.17.1 go build .
  • Run the generate binary ./arduino-create-agent

Expected behavior

The Create Agent should start and run.

Environment (please complete the following information):

  • OS [e.g. Windows]: macOS
  • OS version: 11.5.2 (20G95)
  • Agent Version [e.g. 1.0.0]: current main branch on GitHub
  • CPU architecture [e.g. amd64]: amd64

Additional context

When running the compiled binary I obtain the following stack trace.

./arduino-create-agent                                                                                                                  09/13/21 -  4:30 PM
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x7fff2047fc9e]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff2047fc9e
stack: frame={sp:0x70000b851e58, fp:0x70000b851ea8} stack=[0x70000b7d2338,0x70000b851f38)
0x000070000b851d58:  0x010070000b851d78  0x0000000000000004
0x000070000b851d68:  0x000000000000001f  0x00007fff2047fc9e
0x000070000b851d78:  0x0b01dfacedebac1e  0x0000000000000001
0x000070000b851d88:  0x0000000004037e31 <runtime.throw+0x0000000000000071>  0x000070000b851e28
0x000070000b851d98:  0x0000000004775309  0x000070000b851de0
0x000070000b851da8:  0x00000000040380e8 <runtime.fatalthrow.func1+0x0000000000000048>  0x000000c0001021a0
0x000070000b851db8:  0x0000000000000001  0x0000000000000001
0x000070000b851dc8:  0x000070000b851e28  0x0000000004037e31 <runtime.throw+0x0000000000000071>
0x000070000b851dd8:  0x000000c0001021a0  0x000070000b851e18
0x000070000b851de8:  0x0000000004038070 <runtime.fatalthrow+0x0000000000000050>  0x000070000b851df8
0x000070000b851df8:  0x00000000040380a0 <runtime.fatalthrow.func1+0x0000000000000000>  0x000000c0001021a0
0x000070000b851e08:  0x0000000004037e31 <runtime.throw+0x0000000000000071>  0x000070000b851e28
0x000070000b851e18:  0x000070000b851e48  0x0000000004037e31 <runtime.throw+0x0000000000000071>
0x000070000b851e28:  0x000070000b851e30  0x0000000004037e60 <runtime.throw.func1+0x0000000000000000>
0x000070000b851e38:  0x000000000477e63a  0x000000000000002a
0x000070000b851e48:  0x000070000b851e98  0x000000000404d656 <runtime.sigpanic+0x0000000000000396>
0x000070000b851e58: <0x000000000477e63a  0x000000000401ca16 <runtime.(*fixalloc).alloc+0x0000000000000056>
0x000070000b851e68:  0x0100000000000002  0x0000000000000000
0x000070000b851e78:  0x00000000000001e0  0x000000c000100000
0x000070000b851e88:  0x0000000005b09a88  0x000000c0001021a0
0x000070000b851e98:  0x000070000b851ee0 !0x00007fff2047fc9e
0x000070000b851ea8: >0x000070000b851ee0  0x0000000004c84000
0x000070000b851eb8:  0x00000000000005c8  0x0000000004119b25 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x000070000b851ec8:  0x000000000406a2ff <runtime.syscall+0x000000000000001f>  0x000000c000175120
0x000070000b851ed8:  0x0000000004069c6c <runtime.nanotime_trampoline+0x000000000000000c>  0x000000c0001750f0
0x000070000b851ee8:  0x0000000004068150 <runtime.asmcgocall+0x0000000000000070>  0x000000c0000441e0
0x000070000b851ef8:  0x000000c000044101  0x0000000005f85098
0x000070000b851f08:  0x000070000b851f20  0x000000000401c9a5 <runtime.SetFinalizer.func1+0x0000000000000025>
0x000070000b851f18:  0x0000000000000f38  0x000000c000184340
0x000070000b851f28:  0x0000000004066269 <runtime.systemstack+0x0000000000000049>  0x0000700000000000
runtime.throw({0x477e63a, 0x401ca16})
	/usr/local/go/src/runtime/panic.go:1198 +0x71
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff2047fc9e
stack: frame={sp:0x70000b851e58, fp:0x70000b851ea8} stack=[0x70000b7d2338,0x70000b851f38)
0x000070000b851d58:  0x010070000b851d78  0x0000000000000004
0x000070000b851d68:  0x000000000000001f  0x00007fff2047fc9e
0x000070000b851d78:  0x0b01dfacedebac1e  0x0000000000000001
0x000070000b851d88:  0x0000000004037e31 <runtime.throw+0x0000000000000071>  0x000070000b851e28
0x000070000b851d98:  0x0000000004775309  0x000070000b851de0
0x000070000b851da8:  0x00000000040380e8 <runtime.fatalthrow.func1+0x0000000000000048>  0x000000c0001021a0
0x000070000b851db8:  0x0000000000000001  0x0000000000000001
0x000070000b851dc8:  0x000070000b851e28  0x0000000004037e31 <runtime.throw+0x0000000000000071>
0x000070000b851dd8:  0x000000c0001021a0  0x000070000b851e18
0x000070000b851de8:  0x0000000004038070 <runtime.fatalthrow+0x0000000000000050>  0x000070000b851df8
0x000070000b851df8:  0x00000000040380a0 <runtime.fatalthrow.func1+0x0000000000000000>  0x000000c0001021a0
0x000070000b851e08:  0x0000000004037e31 <runtime.throw+0x0000000000000071>  0x000070000b851e28
0x000070000b851e18:  0x000070000b851e48  0x0000000004037e31 <runtime.throw+0x0000000000000071>
0x000070000b851e28:  0x000070000b851e30  0x0000000004037e60 <runtime.throw.func1+0x0000000000000000>
0x000070000b851e38:  0x000000000477e63a  0x000000000000002a
0x000070000b851e48:  0x000070000b851e98  0x000000000404d656 <runtime.sigpanic+0x0000000000000396>
0x000070000b851e58: <0x000000000477e63a  0x000000000401ca16 <runtime.(*fixalloc).alloc+0x0000000000000056>
0x000070000b851e68:  0x0100000000000002  0x0000000000000000
0x000070000b851e78:  0x00000000000001e0  0x000000c000100000
0x000070000b851e88:  0x0000000005b09a88  0x000000c0001021a0
0x000070000b851e98:  0x000070000b851ee0 !0x00007fff2047fc9e
0x000070000b851ea8: >0x000070000b851ee0  0x0000000004c84000
0x000070000b851eb8:  0x00000000000005c8  0x0000000004119b25 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x000070000b851ec8:  0x000000000406a2ff <runtime.syscall+0x000000000000001f>  0x000000c000175120
0x000070000b851ed8:  0x0000000004069c6c <runtime.nanotime_trampoline+0x000000000000000c>  0x000000c0001750f0
0x000070000b851ee8:  0x0000000004068150 <runtime.asmcgocall+0x0000000000000070>  0x000000c0000441e0
0x000070000b851ef8:  0x000000c000044101  0x0000000005f85098
0x000070000b851f08:  0x000070000b851f20  0x000000000401c9a5 <runtime.SetFinalizer.func1+0x0000000000000025>
0x000070000b851f18:  0x0000000000000f38  0x000000c000184340
0x000070000b851f28:  0x0000000004066269 <runtime.systemstack+0x0000000000000049>  0x0000700000000000
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 34 [syscall]:
syscall.syscall(0x4119b20, 0x1, 0x40487413, 0xc0001751b0)
	/usr/local/go/src/runtime/sys_darwin.go:22 +0x3b fp=0xc000175120 sp=0xc000175100 pc=0x4064d1b
syscall.syscall(0xc000175188, 0x40d3025, 0xc0001751c0, 0x406aac6)
	<autogenerated>:1 +0x26 fp=0xc000175168 sp=0xc000175120 pc=0x406aac6
golang.org/x/sys/unix.ioctl(0xc00022e000, 0x1000, 0x0)
	/Users/federicodemeo/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:689 +0x39 fp=0xc000175198 sp=0xc000175168 pc=0x4119179
golang.org/x/sys/unix.IoctlGetTermios(...)
	/Users/federicodemeo/go/pkg/mod/golang.org/x/[email protected]/unix/ioctl.go:72
github.com/sirupsen/logrus.isTerminal(0x40d483e)
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/terminal_check_bsd.go:11 +0x50 fp=0xc000175208 sp=0xc000175198 pc=0x4124c70
github.com/sirupsen/logrus.checkIfTerminal({0x4854120, 0xc00012e008})
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/terminal_check_notappengine.go:13 +0x75 fp=0xc000175220 sp=0xc000175208 pc=0x4124d15
github.com/sirupsen/logrus.(*TextFormatter).init(0xc000112180, 0x5f81778)
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:106 +0x34 fp=0xc0001752a0 sp=0xc000175220 pc=0x4124df4
github.com/sirupsen/logrus.(*TextFormatter).Format.func1()
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:196 +0x25 fp=0xc0001752c0 sp=0xc0001752a0 pc=0x41264a5
sync.(*Once).doSlow(0x48600a0, 0xc000124630)
	/usr/local/go/src/sync/once.go:68 +0xd2 fp=0xc000175328 sp=0xc0001752c0 pc=0x40717b2
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:59
github.com/sirupsen/logrus.(*TextFormatter).Format(0xc000112180, 0xc0004049a0)
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:196 +0xebe fp=0xc000175898 sp=0xc000175328 pc=0x4125e5e
github.com/sirupsen/logrus.(*Entry).write(0xc0004049a0)
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:279 +0x56 fp=0xc000175928 sp=0xc000175898 pc=0x4120136
github.com/sirupsen/logrus.(*Entry).log(0xc0001759f0, 0x4, {0xc00038c318, 0x11})
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:251 +0x219 fp=0xc000175998 sp=0xc000175928 pc=0x411fd39
github.com/sirupsen/logrus.(*Entry).Log(0xc000404930, 0x4, {0xc0001759f0, 0x4121e3a, 0xc000136040})
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:293 +0x4f fp=0xc0001759c8 sp=0xc000175998 pc=0x412038f
github.com/sirupsen/logrus.(*Entry).Logln(0xc000404930, 0x4, {0xc000175ca0, 0x10, 0x46757e0})
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:383 +0x85 fp=0xc000175a10 sp=0xc0001759c8 pc=0x4120f65
github.com/sirupsen/logrus.(*Entry).Infoln(...)
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:396
github.com/sirupsen/logrus.(*Entry).Println(...)
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:400
github.com/sirupsen/logrus.(*Logger).Println(0xc000136000, {0xc000175ca0, 0x1, 0x1})
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/logger.go:311 +0x51 fp=0xc000175a50 sp=0xc000175a10 pc=0x4123c91
github.com/sirupsen/logrus.Println(...)
	/Users/federicodemeo/go/pkg/mod/github.com/sirupsen/[email protected]/exported.go:239
main.loop()
	/Users/federicodemeo/Downloads/arduino-create-agent-main/main.go:227 +0x4ef fp=0xc000175fe0 sp=0xc000175a50 pc=0x461608f
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000175fe8 sp=0xc000175fe0 pc=0x4068441
created by main.main
	/Users/federicodemeo/Downloads/arduino-create-agent-main/main.go:116 +0x9c

goroutine 1 [syscall, locked to thread]:
github.com/getlantern/systray._Cfunc_registerSystray()
	_cgo_gotypes.go:138 +0x45
github.com/getlantern/systray.registerSystray(...)
	/Users/federicodemeo/go/pkg/mod/github.com/getlantern/[email protected]/systray_nonwindows.go:19
github.com/getlantern/systray.Register(0xc000032010, 0xc000032020)
	/Users/federicodemeo/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:106 +0x14b
github.com/getlantern/systray.Run(0x475f79b, 0x47)
	/Users/federicodemeo/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:77 +0x19
github.com/arduino/arduino-create-agent/systray.(*Systray).Start(0x4cef580)
	/Users/federicodemeo/Downloads/arduino-create-agent-main/systray/systray_real.go:25 +0x132
main.main()
	/Users/federicodemeo/Downloads/arduino-create-agent-main/main.go:149 +0x2cb

goroutine 35 [runnable]:
github.com/getlantern/systray.Register.func2()
	/Users/federicodemeo/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:92
created by github.com/getlantern/systray.Register
	/Users/federicodemeo/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:92 +0xc8

rhaidiz avatar Sep 13 '21 14:09 rhaidiz