mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #573] Crash in program due to deadlock #418
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#418
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
main.go
go.mod
go.sum
@rivo commented on GitHub (Mar 11, 2021):
I'm a bit confused because you appear to be using commit
8a8f78a6dd01dd45a16f940155a4bcc296dfd6bcoftviewbut with a differentgo.modfile, see there actual file:github.com/rivo/tview@8a8f78a6dd/go.mod (L5-L12)Specifically, the
tcellversion in yourgo.modfile is a different one. Did you create your owngo.modfile?@joegrasse commented on GitHub (Mar 11, 2021):
No. Here is what I did.
tcellortviewin my $GOPATH src dir.go mod initgo install@joegrasse commented on GitHub (Mar 11, 2021):
As a test, I pinned
tcellto the version you stated above by setting thego.modto the following, and rebuilt. My app didn't crash when doing a CTR-C.@rivo commented on GitHub (Mar 12, 2021):
In my previous comment, I didn't realize this was the
go.modfile of your program, nottview. But I think it should have still imported the correcttcellversion. I don't know why it didn't.In the meantime, I upgraded
tcellto the latest version intview(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?
@joegrasse commented on GitHub (Mar 12, 2021):
I can still reproduce it if i switch my
go.modback.What was happening with my program was
gowas importing the most recent version oftcell, which isv2.2.0. So there is an incompatibility when my program usestcell v2.2.0with versionv0.0.0-20210217110421-8a8f78a6dd01oftview.I can upgrade to your most recent version of
tviewand see if it still happens.@joegrasse commented on GitHub (Mar 12, 2021):
With the most recent version of
tviewandtcell, I am still able to reproduce the error.go.mod
go.sum
@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?
@joegrasse commented on GitHub (Mar 12, 2021):
I am on windows 10 and
cmd.exe.@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.
@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 oftcell,Finiwould call a section of code that wouldclose(s.quit). In v2 oftcell,Fininow callsdisengage(see that here). The code that was called to close thes.quitchannel is now buried in a new private functionfinish(see that here). SoPollEventdoesn't return. So bothtviewandtcellare waiting for something to happen.I am not sure if this is a bug in
tcell, where it should also be callingfinishafterdisengage, or if this is a bug in the use oftcellv2.\cc @rivo @gdamore
@joegrasse commented on GitHub (Apr 19, 2021):
This might be fixed in
tcellv2.2.1. Can you upgrade to that version?@rivo commented on GitHub (Apr 26, 2021):
I upgraded to the latest version. Does it work for you now?
@joegrasse commented on GitHub (Apr 27, 2021):
Yes, it works now. Thanks.
@rivo commented on GitHub (Apr 27, 2021):
Great! Thanks for the feedback.