readline
readline copied to clipboard
Fix race condition in DefaultOnWidthChanged
==================
WARNING: DATA RACE
Write at 0x0000017ecc40 by goroutine 57:
github.com/chzyer/readline.DefaultOnWidthChanged()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/utils_unix.go:68 +0x30
github.com/chzyer/readline.NewOperation()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:82 +0x84c
github.com/chzyer/readline.(*Terminal).Readline()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x5b
github.com/chzyer/readline.NewEx()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x41
github.com/manifoldco/promptui.(*Prompt).Run()
/home/runner/go/pkg/mod/github.com/kylecarbs/[email protected][119](https://github.com/coder/coder/runs/5152098085?check_suite_focus=true#step:7:119)0244-d8f2159af2b2/prompt.go:142 +0x35a
github.com/coder/coder/cli.prompt()
/home/runner/work/coder/coder/cli/root.go:178 +0x9b2
github.com/coder/coder/cli.projectCreate.func1()
/home/runner/work/coder/coder/cli/projectcreate.go:44 +0x364
github.com/spf13/cobra.(*Command).execute()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0xa7d
github.com/spf13/cobra.(*Command).ExecuteC()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x5da
github.com/spf13/cobra.(*Command).Execute()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:902 +0x44
github.com/coder/coder/cli_test.TestProjectCreate.func2.1()
/home/runner/work/coder/coder/cli/projectcreate_test.go:83 +0x39
Previous write at 0x0000017ecc40 by goroutine 46:
github.com/chzyer/readline.DefaultOnWidthChanged()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/utils_unix.go:68 +0x30
github.com/chzyer/readline.NewOperation()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:82 +0x84c
github.com/chzyer/readline.(*Terminal).Readline()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x5b
github.com/chzyer/readline.NewEx()
/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x41
github.com/manifoldco/promptui.(*Prompt).Run()
/home/runner/go/pkg/mod/github.com/kylecarbs/[email protected][123](https://github.com/coder/coder/runs/5152098085?check_suite_focus=true#step:7:123)1190244-d8f2[159](https://github.com/coder/coder/runs/5152098085?check_suite_focus=true#step:7:159)af2b2/prompt.go:142 +0x35a
github.com/coder/coder/cli.prompt()
/home/runner/work/coder/coder/cli/root.go:178 +0x9b2
github.com/coder/coder/cli.projectCreate.func1()
/home/runner/work/coder/coder/cli/projectcreate.go:44 +0x364
github.com/spf13/cobra.(*Command).execute()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0xa7d
github.com/spf13/cobra.(*Command).ExecuteC()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x5da
github.com/spf13/cobra.(*Command).Execute()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:902 +0x44
github.com/coder/coder/cli_test.TestProjectCreate.func1.1()
/home/runner/work/coder/coder/cli/projectcreate_test.go:34 +0x39
@chzyer any shot we could get this merged? It'd help us not have to fork.