-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
Concurrent calls to DebugKeysCommand.CaptureSequence() can race on dkc.sequences appends/writes, causing non-deterministic behaviour and race detector failures.
Steps to Reproduce
Steps to reproduce the behaviour:
- Check out branch
mainbefore PR [bug] debug-keys-capture-sequence-race #341. - Run command
go test -race ./internal/keybindings -run TestDebugKeysCommand_ConcurrentAccess -count=1. - See
WARNING: DATA RACEwith stack traces pointing toCaptureSequence()ininternal/keybindings/parser.go.
Expected Behavior
Concurrent key capture should be thread-safe and deterministic, with no race detector warnings.
Screenshots
N/A
Environment
- OS: Darwin 25.2.0
- Go Version: go1.25.7 darwin/arm64
- ggc Version: v7 (source build)
- git Version (run
git --version): git version 2.39.5 (Apple Git-154)
Additional Context
- Root cause: shared mutable fields (
capturing,sequences) were read/written acrossStartCapture,CaptureSequence,StopCapture, andIsCapturingwithout synchronisation. - Fix is in PR [bug] debug-keys-capture-sequence-race #341, which adds mutex protection, snapshots sequences in
StopCapture(), and updates save/read paths accordingly. - Validation after fix:
go test -race ./internal/keybindings -run TestDebugKeysCommand_ConcurrentAccess -count=1go test ./internal/keybindings
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working