'golangci-lint Segmentation Violation error

I am trying to run golangci-lint tool. I think I might have accidentally upgraded my Golang version from 1.17.2 to 1.17.6 recently and somehow broke golangci-lint.

My GOROOT in .zshrc file:

export GOROOT=/usr/local/Cellar/go/1.17.6/libexec/

Contents of /usr/local/Cellar/go and /usr/local/Cellar/go/1.17.6

% ls  /usr/local/Cellar/go
1.17.6

% ls  /usr/local/Cellar/go/1.17.6
AUTHORS         LICENSE         bin
INSTALL_RECEIPT.json    README.md       libexec

Go version:

 % go version
go version go1.17.6 darwin/amd64

Error from golangci-lint:

% golangci-lint run
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x7fff206f7c9e]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff206f7c9e
stack: frame={sp:0x7ffeefbff4e8, fp:0x7ffeefbff538} stack=[0x7ffeefb80588,0x7ffeefbff5f0)
0x00007ffeefbff3e8:  0x01007ffeefbff408  0x0000000000000004 
0x00007ffeefbff3f8:  0x000000000000001f  0x00007fff206f7c9e 
0x00007ffeefbff408:  0x0b01dfacedebac1e  0x0000000000000001 
0x00007ffeefbff418:  0x0000000004039431 <runtime.throw+0x0000000000000071>  0x00007ffeefbff4b8 
0x00007ffeefbff428:  0x0000000004a9e0c5  0x00007ffeefbff470 
0x00007ffeefbff438:  0x00000000040396e8 <runtime.fatalthrow.func1+0x0000000000000048>  0x0000000005312e80 
0x00007ffeefbff448:  0x0000000000000001  0x0000000000000001 
0x00007ffeefbff458:  0x00007ffeefbff4b8  0x0000000004039431 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff468:  0x0000000005312e80  0x00007ffeefbff4a8 
0x00007ffeefbff478:  0x0000000004039670 <runtime.fatalthrow+0x0000000000000050>  0x00007ffeefbff488 
0x00007ffeefbff488:  0x00000000040396a0 <runtime.fatalthrow.func1+0x0000000000000000>  0x0000000005312e80 
0x00007ffeefbff498:  0x0000000004039431 <runtime.throw+0x0000000000000071>  0x00007ffeefbff4b8 
0x00007ffeefbff4a8:  0x00007ffeefbff4d8  0x0000000004039431 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff4b8:  0x00007ffeefbff4c0  0x0000000004039460 <runtime.throw.func1+0x0000000000000000> 
0x00007ffeefbff4c8:  0x0000000004aad1f8  0x000000000000002a 
0x00007ffeefbff4d8:  0x00007ffeefbff528  0x000000000404f916 <runtime.sigpanic+0x0000000000000396> 
0x00007ffeefbff4e8: <0x0000000004aad1f8  0x0000000005312e80 
0x00007ffeefbff4f8:  0x00007ffeefbff568  0x000000000402b4a6 <runtime.(*mheap).allocSpan+0x0000000000000546> 
0x00007ffeefbff508:  0x000000c000198000  0x0000000000002000 
0x00007ffeefbff518:  0x000000c000000008  0x0000000000000000 
0x00007ffeefbff528:  0x00007ffeefbff570 !0x00007fff206f7c9e 
0x00007ffeefbff538: >0x00007ffeefbff570  0x0000000005170000 
0x00007ffeefbff548:  0x000000000000035c  0x00000000042808e5 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005> 
0x00007ffeefbff558:  0x000000000406e95f <runtime.syscall+0x000000000000001f>  0x000000c000197848 
0x00007ffeefbff568:  0x000000000406e2cc <runtime.nanotime_trampoline+0x000000000000000c>  0x000000c000197818 
0x00007ffeefbff578:  0x000000000406c790 <runtime.asmcgocall+0x0000000000000070>  0x0000000000000001 
0x00007ffeefbff588:  0x0000000004013f00 <runtime.mapdelete+0x00000000000001a0>  0x3f00000000001018 
0x00007ffeefbff598:  0x0000000000000000  0x0000000005350bb8 
0x00007ffeefbff5a8:  0x0000000000000810  0x000000c0000001a0 
0x00007ffeefbff5b8:  0x000000000406a8a9 <runtime.systemstack+0x0000000000000049>  0x0000000000000004 
0x00007ffeefbff5c8:  0x0000000004bca710  0x0000000005312e80 
0x00007ffeefbff5d8:  0x00007ffeefbff620  0x000000000406a7a5 <runtime.mstart+0x0000000000000005> 
0x00007ffeefbff5e8:  0x000000000406a75d <runtime.rt0_go+0x000000000000013d> 
runtime.throw({0x4aad1f8, 0x5312e80})
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/panic.go:1198 +0x71
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff206f7c9e
stack: frame={sp:0x7ffeefbff4e8, fp:0x7ffeefbff538} stack=[0x7ffeefb80588,0x7ffeefbff5f0)
0x00007ffeefbff3e8:  0x01007ffeefbff408  0x0000000000000004 
0x00007ffeefbff3f8:  0x000000000000001f  0x00007fff206f7c9e 
0x00007ffeefbff408:  0x0b01dfacedebac1e  0x0000000000000001 
0x00007ffeefbff418:  0x0000000004039431 <runtime.throw+0x0000000000000071>  0x00007ffeefbff4b8 
0x00007ffeefbff428:  0x0000000004a9e0c5  0x00007ffeefbff470 
0x00007ffeefbff438:  0x00000000040396e8 <runtime.fatalthrow.func1+0x0000000000000048>  0x0000000005312e80 
0x00007ffeefbff448:  0x0000000000000001  0x0000000000000001 
0x00007ffeefbff458:  0x00007ffeefbff4b8  0x0000000004039431 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff468:  0x0000000005312e80  0x00007ffeefbff4a8 
0x00007ffeefbff478:  0x0000000004039670 <runtime.fatalthrow+0x0000000000000050>  0x00007ffeefbff488 
0x00007ffeefbff488:  0x00000000040396a0 <runtime.fatalthrow.func1+0x0000000000000000>  0x0000000005312e80 
0x00007ffeefbff498:  0x0000000004039431 <runtime.throw+0x0000000000000071>  0x00007ffeefbff4b8 
0x00007ffeefbff4a8:  0x00007ffeefbff4d8  0x0000000004039431 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff4b8:  0x00007ffeefbff4c0  0x0000000004039460 <runtime.throw.func1+0x0000000000000000> 
0x00007ffeefbff4c8:  0x0000000004aad1f8  0x000000000000002a 
0x00007ffeefbff4d8:  0x00007ffeefbff528  0x000000000404f916 <runtime.sigpanic+0x0000000000000396> 
0x00007ffeefbff4e8: <0x0000000004aad1f8  0x0000000005312e80 
0x00007ffeefbff4f8:  0x00007ffeefbff568  0x000000000402b4a6 <runtime.(*mheap).allocSpan+0x0000000000000546> 
0x00007ffeefbff508:  0x000000c000198000  0x0000000000002000 
0x00007ffeefbff518:  0x000000c000000008  0x0000000000000000 
0x00007ffeefbff528:  0x00007ffeefbff570 !0x00007fff206f7c9e 
0x00007ffeefbff538: >0x00007ffeefbff570  0x0000000005170000 
0x00007ffeefbff548:  0x000000000000035c  0x00000000042808e5 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005> 
0x00007ffeefbff558:  0x000000000406e95f <runtime.syscall+0x000000000000001f>  0x000000c000197848 
0x00007ffeefbff568:  0x000000000406e2cc <runtime.nanotime_trampoline+0x000000000000000c>  0x000000c000197818 
0x00007ffeefbff578:  0x000000000406c790 <runtime.asmcgocall+0x0000000000000070>  0x0000000000000001 
0x00007ffeefbff588:  0x0000000004013f00 <runtime.mapdelete+0x00000000000001a0>  0x3f00000000001018 
0x00007ffeefbff598:  0x0000000000000000  0x0000000005350bb8 
0x00007ffeefbff5a8:  0x0000000000000810  0x000000c0000001a0 
0x00007ffeefbff5b8:  0x000000000406a8a9 <runtime.systemstack+0x0000000000000049>  0x0000000000000004 
0x00007ffeefbff5c8:  0x0000000004bca710  0x0000000005312e80 
0x00007ffeefbff5d8:  0x00007ffeefbff620  0x000000000406a7a5 <runtime.mstart+0x0000000000000005> 
0x00007ffeefbff5e8:  0x000000000406a75d <runtime.rt0_go+0x000000000000013d> 
runtime.sigpanic()
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
syscall.syscall(0x42808e0, 0x1, 0x40487413, 0xc0001978d8)
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/sys_darwin.go:22 +0x3b fp=0xc000197848 sp=0xc000197828 pc=0x406935b
syscall.syscall(0x40ba4a6, 0x20, 0xc000197900, 0x40ba3d8)
    <autogenerated>:1 +0x26 fp=0xc000197890 sp=0xc000197848 pc=0x406f126
golang.org/x/sys/unix.ioctl(0x4a05d6c, 0x4, 0x100c000080900)
    /Users/sg/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:690 +0x39 fp=0xc0001978c0 sp=0xc000197890 pc=0x42801d9
golang.org/x/sys/unix.IoctlGetTermios(...)
    /Users/sg/go/pkg/mod/golang.org/x/[email protected]/unix/ioctl.go:73
github.com/mattn/go-isatty.IsTerminal(0x4a05d6c)
    /Users/sg/go/pkg/mod/github.com/mattn/[email protected]/isatty_bsd.go:10 +0x50 fp=0xc000197930 sp=0xc0001978c0 pc=0x42809f0
github.com/fatih/color.init()
    /Users/sg/go/pkg/mod/github.com/fatih/[email protected]/color.go:21 +0x7a fp=0xc000197968 sp=0xc000197930 pc=0x4282f3a
runtime.doInit(0x51786e0)
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:6498 +0x123 fp=0xc000197aa0 sp=0xc000197968 pc=0x4048ec3
runtime.doInit(0x5178800)
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:6475 +0x71 fp=0xc000197bd8 sp=0xc000197aa0 pc=0x4048e11
runtime.doInit(0x51778a0)
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:6475 +0x71 fp=0xc000197d10 sp=0xc000197bd8 pc=0x4048e11
runtime.doInit(0x5181100)
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:6475 +0x71 fp=0xc000197e48 sp=0xc000197d10 pc=0x4048e11
runtime.doInit(0x5174bc0)
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:6475 +0x71 fp=0xc000197f80 sp=0xc000197e48 pc=0x4048e11
runtime.main()
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:238 +0x1e6 fp=0xc000197fe0 sp=0xc000197f80 pc=0x403bd46
runtime.goexit()
    /usr/local/Cellar/go/1.17.2/libexec/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000197fe8 sp=0xc000197fe0 pc=0x406ca81

I am curious why I am seeing /usr/local/Cellar/go/1.17.2 in the stack trace.

Appreciate any help in fixing my setup. Thank you!

go


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source