You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
panic: runtime error: slice bounds out of range #233
termui crashed while trying to add a label to a bug. I've added about 100 or so bugs and pushed/pulled about 5 or 6 times since creating the repository a couple of days ago... and this is the first time I got this crash... so I'm not sure how common of a case it is.
I'm not sure if this is helpful information, but the text of the error message below was printed about 1/2 way down the list of labels. Hopefully the error message is enough to narrow in on the code line. I wish I had also grabbed a screenshot to illustrate.
I'm using the linux-amd64 binary from the 0.5.0 release on github.
panic: runtime error: slice bounds out of range
[ ] json
goroutine 36 [running]:
github.com/MichaelMure/git-bug/vendor/github.com/nsf/termbox-go.PollEvent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/travis/gopath/src/github.com/MichaelMure/git-bug/vendor/github.com/nsf/termbox-go/api.go:348 +0x8d4
github.com/MichaelMure/git-bug/vendor/github.com/MichaelMure/gocui.(*Gui).MainLoop.func1(0xc000290000)
/home/travis/gopath/src/github.com/MichaelMure/git-bug/vendor/github.com/MichaelMure/gocui/gui.go:354 +0x30
created by github.com/MichaelMure/git-bug/vendor/github.com/MichaelMure/gocui.(*Gui).MainLoop
/home/travis/gopath/src/github.com/MichaelMure/git-bug/vendor/github.com/MichaelMure/gocui/gui.go:352 +0x6e
That's a though one to debug ... This is happening in termbox, the low level access to the terminal, when being called by gocui, the library we use to draw the termui. As you can see, the stacktrace doesn't even mention git-bug's own code, which means it's happening either because of a bad state created by git-bug, or a bug in gocui or termbox.
Could you try to reproduce with GOTRACEBACK=all set ? This should dump the stracktrace of all the goroutines, maybe there is something in there.
Got it! I will try with GOTRACEBACK=all and update here with the result. Possibly all that happens is we report upstream but that's fine. Hopefully they can help. Double-hopefully they're already aware of the issue and have a fix coming down the pipe.
Edit: Oh, I just realized... this is using the unstable version which I installed this morning with go get (forgot that was on my path). If you think this might be a different behavior than v0.5.0 I can delete the unstable copy and go back to using v0.5.0.
Another thing to explore is that gocui require that changes in the UI state to be made in sync with the main loop. For git-bug concern, that means in a layout function or through a g.Update(func(gui *gocui.Gui) error {. Maybe there is some place in the termui that doesn't respect this.
With #242 I migrated to awesome-gocui. This maintained fork include some commit that may be related to this issue, so let me know if you have new datapoint about this.
Activity
cheshirekow commentedon Oct 23, 2019
Got this again today. Same repository, different clone, different machine. Here's a screenshot of what it looks like:

MichaelMure commentedon Oct 24, 2019
That's a though one to debug ... This is happening in
termbox, the low level access to the terminal, when being called bygocui, the library we use to draw the termui. As you can see, the stacktrace doesn't even mention git-bug's own code, which means it's happening either because of a bad state created by git-bug, or a bug in gocui or termbox.Could you try to reproduce with
GOTRACEBACK=allset ? This should dump the stracktrace of all the goroutines, maybe there is something in there.cheshirekow commentedon Oct 24, 2019
Got it! I will try with
GOTRACEBACK=alland update here with the result. Possibly all that happens is we report upstream but that's fine. Hopefully they can help. Double-hopefully they're already aware of the issue and have a fix coming down the pipe.cheshirekow commentedon Oct 24, 2019
Edit: Oh, I just realized... this is using the unstable version which I installed this morning with
go get(forgot that was on my path). If you think this might be a different behavior than v0.5.0 I can delete the unstable copy and go back to using v0.5.0.MichaelMure commentedon Oct 28, 2019
I managed to trigger that bug as well, during a demo of all the possible timing ...
One possible way to explore is to ditch my fork of gocui and migrate to the maintained https://github.com/awesome-gocui/gocui
Another thing to explore is that gocui require that changes in the UI state to be made in sync with the main loop. For git-bug concern, that means in a
layoutfunction or through ag.Update(func(gui *gocui.Gui) error {. Maybe there is some place in the termui that doesn't respect this.MichaelMure commentedon Nov 10, 2019
With #242 I migrated to awesome-gocui. This maintained fork include some commit that may be related to this issue, so let me know if you have new datapoint about this.
cheshirekow commentedon Nov 11, 2019
Ok great. I will pull master and report back if I see this again.
MichaelMure commentedon Dec 8, 2019
About a month without any complaint, let's call that resolved. If it happen again for someone, feel free to reopen.