Repository: go
Issue: x/tools/gopls: panic in aeshashbody on behalf of mapaccess2_faststr: string memory corrupted
Labels: NeedsInvestigation,gopls,Tools,gopls/telemetry-wins,BugReport

```
#!stacks
"sigpanic" && "aeshashbody" && "mapaccess2_faststr" && "gopls"
```
Issue created by [stacks](https://pkg.go.dev/golang.org/x/tools/gopls/internal/telemetry/cmd/stacks).

The source line `aeshashbody:+233` is nominally 1468, but AESENC is infallible. Assuming there's an off-by-one error in computing the relative  lines for assembly functions, it could conceivably be the following load instruction, which would mean that a Go string points to data that runs off the end of a memory mapping. I have no idea what is going on. @prattmic 

[Update: a bad string was passed to a map. Perhaps produced by a data race?]

```
  asm_amd64.s:1462      0x47a76c                660f38dcc9              AESENC X1, X1                           
  asm_amd64.s:1463      0x47a771                660f38dcd2              AESENC X2, X2                           
  asm_amd64.s:1464      0x47a776                660f38dcdb              AESENC X3, X3                           
  asm_amd64.s:1465      0x47a77b                660f38dce4              AESENC X4, X4                           
  asm_amd64.s:1466      0x47a780                660f38dced              AESENC X5, X5                           
  asm_amd64.s:1467      0x47a785                660f38dcf6              AESENC X6, X6                           
  asm_amd64.s:1468      0x47a78a                660f38dcff              AESENC X7, X7                           
  asm_amd64.s:1471      0x47a78f                f3440f6f440880          MOVDQU -0x80(AX)(CX*1), X8              
  asm_amd64.s:1472      0x47a796                f3440f6f4c0890          MOVDQU -0x70(AX)(CX*1), X9              
  asm_amd64.s:1473      0x47a79d                f3440f6f5408a0          MOVDQU -0x60(AX)(CX*1), X10             
  asm_amd64.s:1474      0x47a7a4                f3440f6f5c08b0          MOVDQU -0x50(AX)(CX*1), X11             
  asm_amd64.s:1475      0x47a7ab                f3440f6f6408c0          MOVDQU -0x40(AX)(CX*1), X12             
  asm_amd64.s:1476      0x47a7b2                f3440f6f6c08d0          MOVDQU -0x30(AX)(CX*1), X13             
  asm_amd64.s:1477      0x47a7b9                f3440f6f7408e0          MOVDQU -0x20(AX)(CX*1), X14             
  asm_amd64.s:1478      0x47a7c0                f3440f6f7c08f0          MOVDQU -0x10(AX)(CX*1), X15            
```

This stack `8jk_dA` was [reported by telemetry](https://storage.googleapis.com/prod-telemetry-merged/2025-01-20.json):

- `crash/crash`
- [`runtime.throw:+9`](https://cs.opensource.google/go/go/+/go1.23.4:src/runtime/panic.go;l=1067)
- [`runtime.sigpanic:+33`](https://cs.opensource.google/go/go/+/go1.23.4:src/runtime/signal_unix.go;l=931)
- `.aeshashbody:+233`
- [`runtime.mapaccess2_faststr:+67`](https://cs.opensource.google/go/go/+/go1.23.4:src/runtime/map_faststr.go;l=184)
- [`golang.org/x/tools/internal/gcimporter.(*iimporter).doDecl:+14`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:internal/gcimporter/iimport.go;l=428)
- [`golang.org/x/tools/internal/gcimporter.iimportCommon:+179`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:internal/gcimporter/iimport.go;l=335)
- [`golang.org/x/tools/internal/gcimporter.IImportShallow:+3`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:internal/gcimporter/iexport.go;l=305)
- [`golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+63`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:gopls/internal/cache/check.go;l=532)
- [`golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage.func1:+23`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:gopls/internal/cache/check.go;l=336)
- `golang.org/x/tools/gopls/internal/cache.(*futureCache[...]).get:+32`
- [`golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+1`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:gopls/internal/cache/check.go;l=313)
- [`golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+26`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:gopls/internal/cache/check.go;l=502)
- [`golang.org/x/tools/internal/gcimporter.iimportCommon:+124`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:internal/gcimporter/iimport.go;l=280)
- [`golang.org/x/tools/internal/gcimporter.IImportShallow:+3`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:internal/gcimporter/iexport.go;l=305)
- [`golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+63`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:gopls/internal/cache/check.go;l=532)
- [`golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage.func1:+23`](https://cs.opensource.google/go/x/tools/+/gopls/v0.17.1:gopls/internal/cache/check.go;l=336)
```
golang.org/x/tools/gopls@v0.17.1 go1.23.4 linux/amd64 vscode (1)
```