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

x/tools/gopls: gopls killed by zsh due to Code Signature Invalid #65810

Closed
dackon opened this issue Feb 20, 2024 · 2 comments
Closed

x/tools/gopls: gopls killed by zsh due to Code Signature Invalid #65810

dackon opened this issue Feb 20, 2024 · 2 comments
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@dackon
Copy link

dackon commented Feb 20, 2024

gopls version

0.14.2

go env

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/foo/Library/Caches/go-build'
GOENV='/Users/foo/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/foo/Workspace/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/foo/Workspace/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/foo/Workspace/tools/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/foo/Workspace/tools/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/q_/xpyghdbn3tl1qklgrrmp8bdw0000gq/T/go-build853168607=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I updated Go from version 1.20.12 to version 1.22.0 (version 1.21.7 also has the problem), and ran the following commands:

rm -rf "$GOPATH/pkg/mod/golang.org/x/tools/gopls@v0.14.2"
go install golang.org/x/tools/gopls@latest

What did you see happen?

gopls failed to launch; it was killed by zsh. I checked the crash report on macOS, and it shows:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x0000000100b23340
Exception Codes:       0x0000000000000032, 0x0000000100b23340

After reverting back to version 1.20.12, reinstalled gopls works well.

What did you expect to see?

gopls should work normally.

Editor and settings

No response

Logs

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               gopls [3986]
Path:                  /Users/USER/*/gopls
Identifier:            gopls
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        zsh [3240]
Responsible:           Terminal [879]
User ID:               503

Date/Time:             2024-02-20 18:52:53.0505 +0800
OS Version:            macOS 14.3.1 (23D60)
Report Version:        12
Anonymous UUID:        12F2778C-2BF3-7F5F-EB87-6D8312CA769E

Sleep/Wake UUID:       8E179EB2-69B9-49A7-A129-63473A02F1BD

Time Awake Since Boot: 3500 seconds
Time Since Wake:       440 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x0000000100b23340
Exception Codes:       0x0000000000000032, 0x0000000100b23340

Termination Reason:    Namespace CODESIGNING, Code 2 Invalid Page

VM Region Info: 0x100b23340 is in 0x100b1c000-0x1016ac000;  bytes after start: 29504  bytes before end: 12094655
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  __TEXT                      100b1c000-1016ac000    [ 11.6M] r-x/r-x SM=COW  .../USER/*/gopls
      __DATA_CONST                1016ac000-101908000    [ 2416K] r--/rw- SM=COW  .../USER/*/gopls

Kernel Triage:
VM - (arg = 0x0) A memory corruption was found in executable text


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   gopls                         	       0x100b23340 */cpu.Initialize + 0
1   gopls                         	       0x100b5f1a0 runtime.schedinit + 224


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000001   x3: 0x0000000000000000
    x4: 0x3d47554245444f47   x5: 0x0000000040100401   x6: 0x000000000000003e   x7: 0x0000000000000002
    x8: 0x000000016f2e2a10   x9: 0x0000000000000013  x10: 0x000000000000000d  x11: 0x000000016f2e3e33
   x12: 0x0000000000000001  x13: 0x000000016f2e2850  x14: 0x00000000000007fb  x15: 0x0000000090ac17fb
   x16: 0x000000016eae83a0  x17: 0x000000016f2e29d0  x18: 0x0000000000000000  x19: 0x000000016f2e28b8
   x20: 0x000000016f2e2950  x21: 0x0000000000000003  x22: 0x0000000101f3fa64  x23: 0x000000016f2e2b80
   x24: 0x000000016f2e2bc0  x25: 0x0000000182f2462b  x26: 0x0000000000000000  x27: 0x0000000101f3f000
   x28: 0x0000000101ed82a0   fp: 0x000000016f2e2a78   lr: 0x0000000100b5f1a0
    sp: 0x000000016f2e2a80   pc: 0x0000000100b23340 cpsr: 0x60001000
   far: 0x0000000100b23340  esr: 0x82000007 (Instruction Abort) Translation fault

Binary Images:
       0x100b1c000 -        0x1016abfff gopls (*) <2516708c-d9d7-3ae0-81e8-722eb9add545> /Users/USER/*/gopls
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x182e9f000 -        0x182f33387 dyld (*) <50746901-db0e-39a0-b391-baaa6b82ad0f> /usr/lib/dyld

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=1.0G resident=0K(0%) swapped_out_or_unallocated=1.0G(100%)
Writable regions: Total=540.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=540.4M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           531.2M       14 
MALLOC guard page                   96K        6 
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
VM_ALLOCATE                        1.1G        4 
__AUTH                             339K       65 
__AUTH_CONST                      4055K      146 
__DATA                            2722K      143 
__DATA_CONST                      11.7M      149 
__DATA_DIRTY                       365K       58 
__LINKEDIT                       893.8M        2 
__OBJC_RO                         71.2M        1 
__OBJC_RW                         2171K        1 
__TEXT                           131.5M      156 
dyld private memory                272K        2 
shared memory                       32K        2 
===========                     =======  ======= 
TOTAL                              2.7G      753 



-----------
Full Report
-----------

{"app_name":"gopls","timestamp":"2024-02-20 18:52:53.00 +0800","app_version":"","slice_uuid":"2516708c-d9d7-3ae0-81e8-722eb9add545","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 14.3.1 (23D60)","roots_installed":0,"incident_id":"4DFE7A27-A20E-40C9-BAD4-31D9672473AE","name":"gopls"}
{
  "uptime" : 3500,
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 503,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro18,1",
  "coalitionID" : 827,
  "osVersion" : {
    "train" : "macOS 14.3.1",
    "build" : "23D60",
    "releaseType" : "User"
  },
  "captureTime" : "2024-02-20 18:52:53.0505 +0800",
  "codeSigningMonitor" : 1,
  "incident" : "4DFE7A27-A20E-40C9-BAD4-31D9672473AE",
  "pid" : 3986,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2024-02-20 18:52:52.7072 +0800",
  "procStartAbsTime" : 85936968351,
  "procExitAbsTime" : 85945182670,
  "procName" : "gopls",
  "procPath" : "\/Users\/USER\/*\/gopls",
  "parentProc" : "zsh",
  "parentPid" : 3240,
  "coalitionName" : "com.apple.Terminal",
  "crashReporterKey" : "12F2778C-2BF3-7F5F-EB87-6D8312CA769E",
  "responsiblePid" : 879,
  "responsibleProc" : "Terminal",
  "codeSigningID" : "a.out",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 587334144,
  "codeSigningValidationCategory" : 0,
  "codeSigningTrustLevel" : 4294967295,
  "instructionByteStream" : {"beforePC":"wANf1uAHAPnhCwD54wMeqpLJAZTgB0D54QtA+e\/\/\/xcAAAAAAAAAAA==","atPC":"kAtA+f9jMOupAQBU\/g8e+P2DH\/j9IwDR4BcA+eEbAPlIAQCU4BdA+Q=="},
  "wakeTime" : 440,
  "sleepWakeUUID" : "8E179EB2-69B9-49A7-A129-63473A02F1BD",
  "sip" : "enabled",
  "vmRegionInfo" : "0x100b23340 is in 0x100b1c000-0x1016ac000;  bytes after start: 29504  bytes before end: 12094655\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  __TEXT                      100b1c000-1016ac000    [ 11.6M] r-x\/r-x SM=COW  ...\/USER\/*\/gopls\n      __DATA_CONST                1016ac000-101908000    [ 2416K] r--\/rw- SM=COW  ...\/USER\/*\/gopls",
  "exception" : {"codes":"0x0000000000000032, 0x0000000100b23340","rawCodes":[50,4306645824],"type":"EXC_BAD_ACCESS","signal":"SIGKILL (Code Signature Invalid)","subtype":"UNKNOWN_0x32 at 0x0000000100b23340"},
  "termination" : {"flags":0,"code":2,"namespace":"CODESIGNING","indicator":"Invalid Page"},
  "ktriageinfo" : "VM - (arg = 0x0) A memory corruption was found in executable text\n",
  "vmregioninfo" : "0x100b23340 is in 0x100b1c000-0x1016ac000;  bytes after start: 29504  bytes before end: 12094655\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  __TEXT                      100b1c000-1016ac000    [ 11.6M] r-x\/r-x SM=COW  ...\/USER\/*\/gopls\n      __DATA_CONST                1016ac000-101908000    [ 2416K] r--\/rw- SM=COW  ...\/USER\/*\/gopls",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":72935,"threadState":{"x":[{"value":0},{"value":0},{"value":1},{"value":0},{"value":4415591702778367815},{"value":1074791425},{"value":62},{"value":2},{"value":6160263696},{"value":19},{"value":13},{"value":6160268851},{"value":1},{"value":6160263248},{"value":2043},{"value":2427197435},{"value":6151898016},{"value":6160263632},{"value":0},{"value":6160263352},{"value":6160263504},{"value":3},{"value":4327733860,"symbolLocation":4,"symbol":"timebase"},{"value":6160264064},{"value":6160264128},{"value":6491883051},{"value":0},{"value":4327731200,"symbolLocation":260928,"symbol":"runtime.trace"},{"value":4327309984,"symbolLocation":0,"symbol":"runtime.g0"}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4306891168},"cpsr":{"value":1610616832},"fp":{"value":6160263800},"sp":{"value":6160263808},"esr":{"value":2181038087,"description":"(Instruction Abort) Translation fault"},"pc":{"value":4306645824,"matchesCrashFrame":1},"far":{"value":4306645824}},"queue":"com.apple.main-thread","frames":[{"imageOffset":29504,"symbol":"*\/cpu.Initialize","symbolLocation":0,"imageIndex":0},{"imageOffset":274848,"symbol":"runtime.schedinit","symbolLocation":224,"imageIndex":0}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4306616320,
    "size" : 12124160,
    "uuid" : "2516708c-d9d7-3ae0-81e8-722eb9add545",
    "path" : "\/Users\/USER\/*\/gopls",
    "name" : "gopls"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6491336704,
    "size" : 607112,
    "uuid" : "50746901-db0e-39a0-b391-baaa6b82ad0f",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  }
],
  "sharedCache" : {
  "base" : 6490587136,
  "size" : 4065345536,
  "uuid" : "c32b200e-cf99-3583-bc9f-b7fb11382e8f"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=1.0G resident=0K(0%) swapped_out_or_unallocated=1.0G(100%)\nWritable regions: Total=540.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=540.4M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           531.2M       14 \nMALLOC guard page                   96K        6 \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \nVM_ALLOCATE                        1.1G        4 \n__AUTH                             339K       65 \n__AUTH_CONST                      4055K      146 \n__DATA                            2722K      143 \n__DATA_CONST                      11.7M      149 \n__DATA_DIRTY                       365K       58 \n__LINKEDIT                       893.8M        2 \n__OBJC_RO                         71.2M        1 \n__OBJC_RW                         2171K        1 \n__TEXT                           131.5M      156 \ndyld private memory                272K        2 \nshared memory                       32K        2 \n===========                     =======  ======= \nTOTAL                              2.7G      753 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "logWritingSignature" : "1fbcf3f1aad9a3b38ab694d3e7e35148dda26de5",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "5fb4245a1bbfe8005e33a1e1",
      "factorPackIds" : {

      },
      "deploymentId" : 240000021
    },
    {
      "rolloutId" : "6425c75e4327780c10cc4252",
      "factorPackIds" : {
        "SIRI_HOME_AUTOMATION_INTENT_SELECTION_CACHE" : "642600a457e7664b1698eb32"
      },
      "deploymentId" : 240000004
    }
  ],
  "experiments" : [

  ]
}
}
@dackon dackon added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Feb 20, 2024
@gopherbot gopherbot added this to the Unreleased milestone Feb 20, 2024
@hyangah
Copy link
Contributor

hyangah commented Feb 20, 2024

Looks like the same issue as #63997 and #64351

#63997 (comment)
Can you please check the PATH and see if there are other llvm toolchains getting in the way?

The upcoming gopls v0.15 removed the cgo dependency so we think these issues from toolchain selection will be avoided.
(go install golang.org/x/tools/gopls@v0.15.0-pre.3 in case you want to check the prerelease)

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 20, 2024
@dackon
Copy link
Author

dackon commented Feb 20, 2024

@hyangah Yes, I disabled the LLVM toolchains in macports, and rebuilt gopls. It works well now. Thank you.

@dackon dackon closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants