Skip to content

[lsp][bug] find-all references crashes with concurrent map read/write error #1077

Closed
@mjames-c

Description

@mjames-c
Contributor

I attempted to run find all references on a symbol used widely across Canva's very large TS project (containing 98k+ TS files). The LSP crashed with the following error:

fatal error: concurrent map read and map write

goroutine 196467 [running]:
internal/runtime/maps.fatal({0xeb4e9f?, 0xc0000c7330?})
/usr/local/go/src/runtime/panic.go:1058 +0x18
github.com/microsoft/typescript-go/internal/project.(*checkerPool).getRequestCheckerLocked(0xc00021c070, {0xeef35c, 0x2})
<omitted>/typescript-go/internal/project/checkerpool.go:131 +0x76
github.com/microsoft/typescript-go/internal/project.(*checkerPool).GetAllCheckers(0xc00021c070, {0xf71c30, 0xc0d9bf77c0})
<omitted>/typescript-go/internal/project/checkerpool.go:96 +0xa5
github.com/microsoft/typescript-go/internal/compiler.(*Program).getSemanticDiagnosticsForFile(0xc000403500, {0xf71c30, 0xc0d9bf77c0}, 0xc08a9f2588)
<omitted>/typescript-go/internal/compiler/program.go:454 +0x26d
github.com/microsoft/typescript-go/internal/compiler.(*Program).getDiagnosticsHelper(0xc000403500, {0xf71c30, 0xc0d9bf77c0}, 0xc08a9f2588, 0x1, 0x1, 0xc0000c7b80)
<omitted>/typescript-go/internal/compiler/program.go:619 +0xd0
github.com/microsoft/typescript-go/internal/compiler.(*Program).GetSemanticDiagnostics(0xc000403500, {0xf71c30, 0xc0d9bf77c0}, 0xc08a9f2588)
<omitted>/typescript-go/internal/compiler/program.go:394 +0xb9
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).GetDocumentDiagnostics(0xc434f40270, {0xf71c30, 0xc0d9bf77c0}, {0xc001ed2060, 0x51})
<omitted>/typescript-go/internal/ls/diagnostics.go:18 +0x245
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleDocumentDiagnostic(0xc000000380, {0xf71c30, 0xc0d9bf77c0}, 0xc497fd5b00)
<omitted>/typescript-go/internal/lsp/server.go:567 +0x19f
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0xc000000380, {0xf71c30, 0xc0d9bf77c0}, 0xc497fd5b00)
<omitted>/typescript-go/internal/lsp/server.go:417 +0x399
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
<omitted>/typescript-go/internal/lsp/server.go:302 +0x65
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 34
<omitted>/typescript-go/internal/lsp/server.go:320 +0x58c

It's not actually clear to me whether this is a bug with find refs itself or a race between different LSP commands -- I failed to reproduce on subsequent runs of find refs

Activity

changed the title [-][lsp][bug] find-all references crashes[/-] [+][lsp][bug] find-all references crashes with concurrent map read/write error[/+] on Jun 6, 2025
jakebailey

jakebailey commented on Jun 27, 2025

@jakebailey
Member

I fixed this in #1169, actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jakebailey@mjames-c

        Issue actions

          [lsp][bug] find-all references crashes with concurrent map read/write error · Issue #1077 · microsoft/typescript-go