<p>I haven't used kubectl in about two months.  It was working well in June but now I get the following error:</p>

<pre><code>$ kubectl
fatal error: runtime: bsdthread_register error

runtime stack:
runtime.throw(0x2cb65a5, 0x21)
    /usr/local/go/src/runtime/panic.go:596 +0x95 fp=0x7fff5fbff810 sp=0x7fff5fbff7f0
runtime.goenvs()
    /usr/local/go/src/runtime/os_darwin.go:108 +0xa0 fp=0x7fff5fbff840 sp=0x7fff5fbff810
runtime.schedinit()
    /usr/local/go/src/runtime/proc.go:486 +0xa1 fp=0x7fff5fbff880 sp=0x7fff5fbff840
runtime.rt0_go(0x7fff5fbff8b0, 0x1, 0x7fff5fbff8b0, 0x0, 0x1, 0x7fff5fbffa38, 0x0, 0x7fff5fbffa40, 0x7fff5fbffa5c, 0x7fff5fbffa6c, ...)
    /usr/local/go/src/runtime/asm_amd64.s:158 +0x183 fp=0x7fff5fbff888 sp=0x7fff5fbff880
</code></pre>

<p>I've read that this can be caused by websense but I don't have websense installed on my Mac.  The only thing that has changed to my knowledge was a routine update to Max OSX (10.12.6), and a routine update to gcloud (163).  </p>

<p>I've tried reinstalling kubectl, gcloud, but it still fails.  As far as I can tell there is something wrong with Go, and I think Go is part of the core library included in gcloud sdk.</p>

<p>Any ideas on how to troubleshoot/fix this?  I cannot connect to any of my pods due to this issue.</p>

<p>The problem is caused by a library change for system calls in MacOS 12. Older binaries use an old library which isn't supported anymore.</p>
<p>Update your kubectl to a new version. This should fix it.</p>
<p>If you can't update because you need an older version (e.g. because of api changes) you can build the needed kubectl using a new go version.</p>
<p>Necessary:</p>
<p>go 1.11 or newer</p>
<pre><code>brew install go
</code></pre>
<p>Get repo</p>
<pre><code>git clone https://github.com/kubernetes/kubernetes.git
</code></pre>
<p>Select version needed. e.g. 1.11.3</p>
<pre><code>git checkout tags/v1.11.3
</code></pre>
<p>Build</p>
<pre><code>GO111MODULE=off make 
</code></pre>
<p><code>GO111MODULE=off</code> turns off modules which are needed by default since go v1.16. If your kubernetes version is newer it might be necessary to have them turned on. If that is the case just leave out <code>GO111MODULE=off</code>.</p>
<p>When the build is done you can find the kubectl for your system in <code>_output/bin</code>.</p>
