mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #459] index out of range #329
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#329
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 @4781121 on GitHub (Jun 10, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/459
panic: runtime error: index out of range [7] with length 0 [recovered]
panic: runtime error: index out of range [7] with length 0
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc00010e2a0)
d:/base/data/go/src/github.com/rivo/tview/application.go:244 +0x82
panic(0xb4a480, 0xc000462dc0)
d:/base/path/go/src/runtime/panic.go:969 +0x166
github.com/rivo/tview.(*TextView).Draw(0xc00013a780, 0xca5f00, 0xc00031ce00)
d:/base/data/go/src/github.com/rivo/tview/textview.go:944 +0xd89
github.com/rivo/tview.(*Grid).Draw(0xc000124360, 0xca5f00, 0xc00031ce00)
d:/base/data/go/src/github.com/rivo/tview/grid.go:613 +0x1245
github.com/rivo/tview.(*Pages).Draw(0xc000126ea0, 0xca5f00, 0xc00031ce00)
d:/base/data/go/src/github.com/rivo/tview/pages.go:278 +0xa8
github.com/rivo/tview.(*Flex).Draw(0xc000126f00, 0xca5f00, 0xc00031ce00)
d:/base/data/go/src/github.com/rivo/tview/flex.go:179 +0x28b
github.com/rivo/tview.(*Application).draw(0xc00010e2a0, 0x0)
d:/base/data/go/src/github.com/rivo/tview/application.go:582 +0xda
github.com/rivo/tview.(*Application).Draw.func1()
d:/base/data/go/src/github.com/rivo/tview/application.go:535 +0x2a
github.com/rivo/tview.(*Application).Run(0xc00010e2a0, 0x0, 0x0)
d:/base/data/go/src/github.com/rivo/tview/application.go:371 +0x9a6
@rivo commented on GitHub (Jun 10, 2020):
Can you post some (brief) code that allows me to reproduce this error, please?
@4781121 commented on GitHub (Jun 10, 2020):
我不清楚是哪里代码出的问题, 而且这个错误也没指出是哪里出的问题, 而且并不是经常报这个错误, 偶尔会报一下
@rivo commented on GitHub (Jun 10, 2020):
Sorry, but this is not helpful. Please post in English.
@4781121 commented on GitHub (Jun 10, 2020):
i can't post code, the code to many and the error files not in my codes, if error file in my codes i can fix it, now i don't found error point
@ghostsquad commented on GitHub (Jun 15, 2020):
@xing88 what's he's asking for (ideally) is some minimal amount of code to reproduce this issue.
Based on the stacktrace, the offending line is this:
https://github.com/rivo/tview/blob/master/textview.go#L944
But what was it trying to draw at the time? and what the user was doing is still valuable information to figure out how to reproduce the panic and create a regression test and fix.
@rivo commented on GitHub (Jun 15, 2020):
I'd suggest you take a look at https://github.com/rivo/tview/wiki/Concurrency. If primitives such as
TextVieware modified in a separate goroutine without proper thread handling, it can lead to issues such as this one.But if you are certain that this is not what's happening in your program, then, like @ghostsquad wrote, I would need a small piece of code that reproduces this issue. From the offending line alone, I don't see how such a panic can occur.
@4781121 commented on GitHub (Jun 16, 2020):
@ghostsquad @rivo thanks