[GH-ISSUE #573] Crash in program due to deadlock #418

Closed
opened 2026-03-04 01:04:48 +03:00 by kerem · 14 comments
Owner

Originally created by @joegrasse on GitHub (Mar 4, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/573

This example program crashes when doing a CTR-C.

fatal error: all goroutines are asleep - deadlock!

goroutine 1 [select]:
github.com/rivo/tview.(*Application).Run(0xc00017c000, 0x0, 0x0)
        C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210217110421-8a8f78a6dd01/application.go:302 +0x205
main.main()
        C:/Users/user/Documents/gowork/src/github.com/user/box/main.go:17 +0x1e5

goroutine 19 [select]:
github.com/gdamore/tcell/v2.(*cScreen).PollEvent(0xc00017e000, 0xc000049fa0, 0xc0002b85e0)
        C:/Users/user/Documents/gowork/pkg/mod/github.com/gdamore/tcell/v2@v2.2.0/console_win.go:372 +0xbf
github.com/rivo/tview.(*Application).Run.func2(0xc0000b1690, 0xc00017c000)
        C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210217110421-8a8f78a6dd01/application.go:267 +0xac
created by github.com/rivo/tview.(*Application).Run
        C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210217110421-8a8f78a6dd01/application.go:254 +0x11d

C:\WINDOWS\system32>

main.go

// Demo code for the Box primitive.
package main

import (
	"github.com/gdamore/tcell/v2"
	"github.com/rivo/tview"
)

func main() {
	box := tview.NewBox().
		SetBackgroundColor(tcell.ColorGreen).
		SetTitle("Hello").
		SetBorder(true).
		SetBorderPadding(0, 0, 0, 0).
		SetBorderColor(tcell.ColorWhite)

	if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil {
		panic(err)
	}
}

go.mod

module github.com/joegrasse/box

go 1.15

require (
	github.com/gdamore/tcell/v2 v2.2.0
	github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01
)

go.sum

github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell v1.4.0 h1:vUnHwJRvcPQa3tzi+0QI4U9JINXYJlOz9yiaiPQ2wMU=
github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA=
github.com/gdamore/tcell/v2 v2.2.0 h1:vSyEgKwraXPSOkvCk7IwOSyX+Pv3V2cV9CikJMXg4U4=
github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01 h1:rtCzDXdaqhiRakJsz0bUj+3sOUjw82bJDcJrAzQ0u+M=
github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01/go.mod h1:n2q/ydglZJ1kqxiNrnYO+FaX1H14vA0wKyIo953QakU=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY=
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Originally created by @joegrasse on GitHub (Mar 4, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/573 This example program crashes when doing a CTR-C. ``` fatal error: all goroutines are asleep - deadlock! goroutine 1 [select]: github.com/rivo/tview.(*Application).Run(0xc00017c000, 0x0, 0x0) C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210217110421-8a8f78a6dd01/application.go:302 +0x205 main.main() C:/Users/user/Documents/gowork/src/github.com/user/box/main.go:17 +0x1e5 goroutine 19 [select]: github.com/gdamore/tcell/v2.(*cScreen).PollEvent(0xc00017e000, 0xc000049fa0, 0xc0002b85e0) C:/Users/user/Documents/gowork/pkg/mod/github.com/gdamore/tcell/v2@v2.2.0/console_win.go:372 +0xbf github.com/rivo/tview.(*Application).Run.func2(0xc0000b1690, 0xc00017c000) C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210217110421-8a8f78a6dd01/application.go:267 +0xac created by github.com/rivo/tview.(*Application).Run C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210217110421-8a8f78a6dd01/application.go:254 +0x11d C:\WINDOWS\system32> ``` main.go ```Go // Demo code for the Box primitive. package main import ( "github.com/gdamore/tcell/v2" "github.com/rivo/tview" ) func main() { box := tview.NewBox(). SetBackgroundColor(tcell.ColorGreen). SetTitle("Hello"). SetBorder(true). SetBorderPadding(0, 0, 0, 0). SetBorderColor(tcell.ColorWhite) if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil { panic(err) } } ``` go.mod ``` module github.com/joegrasse/box go 1.15 require ( github.com/gdamore/tcell/v2 v2.2.0 github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01 ) ``` go.sum ``` github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell v1.4.0 h1:vUnHwJRvcPQa3tzi+0QI4U9JINXYJlOz9yiaiPQ2wMU= github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= github.com/gdamore/tcell/v2 v2.2.0 h1:vSyEgKwraXPSOkvCk7IwOSyX+Pv3V2cV9CikJMXg4U4= github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU= github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01 h1:rtCzDXdaqhiRakJsz0bUj+3sOUjw82bJDcJrAzQ0u+M= github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01/go.mod h1:n2q/ydglZJ1kqxiNrnYO+FaX1H14vA0wKyIo953QakU= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY= golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= ```
kerem closed this issue 2026-03-04 01:04:49 +03:00
Author
Owner

@rivo commented on GitHub (Mar 11, 2021):

I'm a bit confused because you appear to be using commit 8a8f78a6dd01dd45a16f940155a4bcc296dfd6bc of tview but with a different go.mod file, see there actual file:

github.com/rivo/tview@8a8f78a6dd/go.mod (L5-L12)

Specifically, the tcell version in your go.mod file is a different one. Did you create your own go.mod file?

<!-- gh-comment-id:796877021 --> @rivo commented on GitHub (Mar 11, 2021): I'm a bit confused because you appear to be using commit `8a8f78a6dd01dd45a16f940155a4bcc296dfd6bc` of `tview` but with a different `go.mod` file, see there actual file: https://github.com/rivo/tview/blob/8a8f78a6dd01dd45a16f940155a4bcc296dfd6bc/go.mod#L5-L12 Specifically, the `tcell` version in your `go.mod` file is a different one. Did you create your own `go.mod` file?
Author
Owner

@joegrasse commented on GitHub (Mar 11, 2021):

No. Here is what I did.

  1. Made sure I didn't have tcell or tview in my $GOPATH src dir.
  2. Created new project folder
  3. Created main.go
  4. Ran go mod init
  5. Ran go install
<!-- gh-comment-id:796950388 --> @joegrasse commented on GitHub (Mar 11, 2021): No. Here is what I did. 1. Made sure I didn't have `tcell` or `tview` in my $GOPATH src dir. 2. Created new project folder 3. Created main.go 4. Ran `go mod init` 5. Ran `go install`
Author
Owner

@joegrasse commented on GitHub (Mar 11, 2021):

As a test, I pinned tcell to the version you stated above by setting the go.mod to the following, and rebuilt. My app didn't crash when doing a CTR-C.

module github.com/joegrasse/box

go 1.15

require (
	github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591
	github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01
)
<!-- gh-comment-id:796955253 --> @joegrasse commented on GitHub (Mar 11, 2021): As a test, I pinned `tcell` to the version you stated above by setting the `go.mod` to the following, and rebuilt. My app didn't crash when doing a CTR-C. ``` module github.com/joegrasse/box go 1.15 require ( github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591 github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01 ) ```
Author
Owner

@rivo commented on GitHub (Mar 12, 2021):

In my previous comment, I didn't realize this was the go.mod file of your program, not tview. But I think it should have still imported the correct tcell version. I don't know why it didn't.

In the meantime, I upgraded tcell to the latest version in tview (which is the one you used in the first place) but still couldn't reproduce the error. So it's a bit odd that this is happening.

In any case, I understand that you also can't reproduce it anymore?

<!-- gh-comment-id:797260921 --> @rivo commented on GitHub (Mar 12, 2021): In my previous comment, I didn't realize this was the `go.mod` file of _your_ program, not `tview`. But I think it should have still imported the correct `tcell` version. I don't know why it didn't. In the meantime, I upgraded `tcell` to the latest version in `tview` (which is the one you used in the first place) but still couldn't reproduce the error. So it's a bit odd that this is happening. In any case, I understand that you also can't reproduce it anymore?
Author
Owner

@joegrasse commented on GitHub (Mar 12, 2021):

I can still reproduce it if i switch my go.mod back.

What was happening with my program was go was importing the most recent version of tcell, which is v2.2.0. So there is an incompatibility when my program uses tcell v2.2.0 with version v0.0.0-20210217110421-8a8f78a6dd01 of tview.

I can upgrade to your most recent version of tview and see if it still happens.

<!-- gh-comment-id:797461299 --> @joegrasse commented on GitHub (Mar 12, 2021): I can still reproduce it if i switch my `go.mod` back. What was happening with my program was `go` was importing the most recent version of `tcell`, which is `v2.2.0`. So there is an incompatibility when my program uses `tcell v2.2.0` with version `v0.0.0-20210217110421-8a8f78a6dd01` of `tview`. I can upgrade to your most recent version of `tview` and see if it still happens.
Author
Owner

@joegrasse commented on GitHub (Mar 12, 2021):

With the most recent version of tview and tcell, I am still able to reproduce the error.

go.mod

module github.com/joegrasse/box

go 1.15

require (
	github.com/gdamore/tcell/v2 v2.2.0
	github.com/rivo/tview v0.0.0-20210312115847-ae065beb933c
)

go.sum

github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell v1.4.0 h1:vUnHwJRvcPQa3tzi+0QI4U9JINXYJlOz9yiaiPQ2wMU=
github.com/gdamore/tcell/v2 v2.2.0 h1:vSyEgKwraXPSOkvCk7IwOSyX+Pv3V2cV9CikJMXg4U4=
github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/rivo/tview v0.0.0-20210312115847-ae065beb933c h1:eNIEQTOdI8dIlu809N3vS4vB1l/EEc/B8fHAgu7nGN0=
github.com/rivo/tview v0.0.0-20210312115847-ae065beb933c/go.mod h1:N/me/Wl2SRS18qi3TyvXbciIPyNwljilmybxouFxEuk=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [select]:
github.com/rivo/tview.(*Application).Run(0xc00017c000, 0x0, 0x0)
        C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210312115847-ae065beb933c/application.go:302 +0x205
main.main()
        C:/Users/user/Documents/gowork/src/github.com/joegrasse/box/main.go:17 +0x1e5

goroutine 19 [select]:
github.com/gdamore/tcell/v2.(*cScreen).PollEvent(0xc00017e000, 0xc000049fa0, 0xc0003ead40)
        C:/Users/user/Documents/gowork/pkg/mod/github.com/gdamore/tcell/v2@v2.2.0/console_win.go:372 +0xbf
github.com/rivo/tview.(*Application).Run.func2(0xc0000cbf50, 0xc00017c000)
        C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210312115847-ae065beb933c/application.go:267 +0xac
created by github.com/rivo/tview.(*Application).Run
        C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210312115847-ae065beb933c/application.go:254 +0x11d
<!-- gh-comment-id:797473895 --> @joegrasse commented on GitHub (Mar 12, 2021): With the most recent version of `tview` and `tcell`, I am still able to reproduce the error. go.mod ``` module github.com/joegrasse/box go 1.15 require ( github.com/gdamore/tcell/v2 v2.2.0 github.com/rivo/tview v0.0.0-20210312115847-ae065beb933c ) ``` go.sum ``` github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell v1.4.0 h1:vUnHwJRvcPQa3tzi+0QI4U9JINXYJlOz9yiaiPQ2wMU= github.com/gdamore/tcell/v2 v2.2.0 h1:vSyEgKwraXPSOkvCk7IwOSyX+Pv3V2cV9CikJMXg4U4= github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/rivo/tview v0.0.0-20210312115847-ae065beb933c h1:eNIEQTOdI8dIlu809N3vS4vB1l/EEc/B8fHAgu7nGN0= github.com/rivo/tview v0.0.0-20210312115847-ae065beb933c/go.mod h1:N/me/Wl2SRS18qi3TyvXbciIPyNwljilmybxouFxEuk= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= ``` ``` fatal error: all goroutines are asleep - deadlock! goroutine 1 [select]: github.com/rivo/tview.(*Application).Run(0xc00017c000, 0x0, 0x0) C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210312115847-ae065beb933c/application.go:302 +0x205 main.main() C:/Users/user/Documents/gowork/src/github.com/joegrasse/box/main.go:17 +0x1e5 goroutine 19 [select]: github.com/gdamore/tcell/v2.(*cScreen).PollEvent(0xc00017e000, 0xc000049fa0, 0xc0003ead40) C:/Users/user/Documents/gowork/pkg/mod/github.com/gdamore/tcell/v2@v2.2.0/console_win.go:372 +0xbf github.com/rivo/tview.(*Application).Run.func2(0xc0000cbf50, 0xc00017c000) C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210312115847-ae065beb933c/application.go:267 +0xac created by github.com/rivo/tview.(*Application).Run C:/Users/user/Documents/gowork/pkg/mod/github.com/rivo/tview@v0.0.0-20210312115847-ae065beb933c/application.go:254 +0x11d ```
Author
Owner

@rivo commented on GitHub (Mar 12, 2021):

I just used exactly the same configuration as you but still didn't get a panic. But I'm on macOS. What OS and shell are you using?

<!-- gh-comment-id:797665976 --> @rivo commented on GitHub (Mar 12, 2021): I just used exactly the same configuration as you but still didn't get a panic. But I'm on macOS. What OS and shell are you using?
Author
Owner

@joegrasse commented on GitHub (Mar 12, 2021):

I am on windows 10 and cmd.exe.

<!-- gh-comment-id:797720148 --> @joegrasse commented on GitHub (Mar 12, 2021): I am on windows 10 and `cmd.exe`.
Author
Owner

@joegrasse commented on GitHub (Mar 16, 2021):

I have tested this on linux and it doesn't crash with the same error. So this is windows code path specific.

<!-- gh-comment-id:800386276 --> @joegrasse commented on GitHub (Mar 16, 2021): I have tested this on linux and it doesn't crash with the same error. So this is windows code path specific.
Author
Owner

@joegrasse commented on GitHub (Mar 23, 2021):

After looking into this more, it looks like the problem is a change in behavior of tcell. In v1 of tcell, Fini would call a section of code that would close(s.quit). In v2 of tcell, Fini now calls disengage (see that here). The code that was called to close the s.quit channel is now buried in a new private function finish (see that here). So PollEvent doesn't return. So both tview and tcell are waiting for something to happen.

I am not sure if this is a bug in tcell, where it should also be calling finish after disengage, or if this is a bug in the use of tcell v2.

\cc @rivo @gdamore

<!-- gh-comment-id:805141224 --> @joegrasse commented on GitHub (Mar 23, 2021): After looking into this more, it looks like the problem is a change in behavior of `tcell`. In v1 of `tcell`, `Fini` would call a section of [code](https://github.com/gdamore/tcell/blob/v1.4.0/console_win.go#L267) that would `close(s.quit)`. In v2 of `tcell`, `Fini` now calls `disengage` (see that [here](https://github.com/gdamore/tcell/blob/v2.2.0/console_win.go#L265)). The code that was called to close the `s.quit` channel is now buried in a new private function `finish` (see that [here](https://github.com/gdamore/tcell/blob/v2.2.0/console_win.go#L268)). So `PollEvent` doesn't return. So both `tview` and `tcell` are waiting for something to happen. I am not sure if this is a bug in `tcell`, where it should also be calling `finish` after `disengage`, or if this is a bug in the use of `tcell` v2. \cc @rivo @gdamore
Author
Owner

@joegrasse commented on GitHub (Apr 19, 2021):

This might be fixed in tcell v2.2.1. Can you upgrade to that version?

<!-- gh-comment-id:822397388 --> @joegrasse commented on GitHub (Apr 19, 2021): This might be fixed in `tcell` v2.2.1. Can you upgrade to that version?
Author
Owner

@rivo commented on GitHub (Apr 26, 2021):

I upgraded to the latest version. Does it work for you now?

<!-- gh-comment-id:826779334 --> @rivo commented on GitHub (Apr 26, 2021): I upgraded to the latest version. Does it work for you now?
Author
Owner

@joegrasse commented on GitHub (Apr 27, 2021):

Yes, it works now. Thanks.

<!-- gh-comment-id:827591092 --> @joegrasse commented on GitHub (Apr 27, 2021): Yes, it works now. Thanks.
Author
Owner

@rivo commented on GitHub (Apr 27, 2021):

Great! Thanks for the feedback.

<!-- gh-comment-id:827598609 --> @rivo commented on GitHub (Apr 27, 2021): Great! Thanks for the feedback.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#418
No description provided.