arborchat / muscadine

[legacy] The Arbor reference client implementation
Apache License 2.0
5 stars 2 forks source link

Run-time Error: Slice bounds out of range when querying history #61

Open jwhett opened 5 years ago

jwhett commented 5 years ago

Expected Behavior

Current Behavior

panic: runtime error: slice bounds out of range

goroutine 20 [running]:
github.com/arborchat/muscadine/archive.(*Archive).Needed(0xc00007a7b0, 0xa, 0x0, 0x0, 0x0)
    /Users/jwhetton/go/src/github.com/arborchat/muscadine/archive/archive.go:56 +0x2c3
github.com/arborchat/muscadine/tui.(*TUI).queryNeeded(0xc00012c050, 0xc00011a000, 0xc0001540f0, 0x28, 0x5)
    /Users/jwhetton/go/src/github.com/arborchat/muscadine/tui/tui.go:238 +0x45
github.com/arborchat/muscadine/tui.(*TUI).queryNeeded-fm(0xc00011a000, 0xc0001540f0, 0x7, 0xc00005e901)
    /Users/jwhetton/go/src/github.com/arborchat/muscadine/tui/keybindings.go:34 +0x3e
github.com/whereswaldon/gocui.(*Gui).execKeybindings(0xc00011a000, 0xc0001540f0, 0xc0001e7d70, 0x115d618, 0x0, 0x0)
    /Users/jwhetton/go/src/github.com/whereswaldon/gocui/gui.go:643 +0xbe
github.com/whereswaldon/gocui.(*Gui).onKey(0xc00011a000, 0xc0001e7d70, 0xc0000469d0, 0xc00007a9b0)
    /Users/jwhetton/go/src/github.com/whereswaldon/gocui/gui.go:607 +0x1b0
github.com/whereswaldon/gocui.(*Gui).handleEvent(0xc00011a000, 0xc0001e7d70, 0x2, 0x0)
    /Users/jwhetton/go/src/github.com/whereswaldon/gocui/gui.go:427 +0x40
github.com/whereswaldon/gocui.(*Gui).MainLoop(0xc00011a000, 0x11cfb4f, 0x4)
    /Users/jwhetton/go/src/github.com/whereswaldon/gocui/gui.go:373 +0x2c3
github.com/arborchat/muscadine/tui.(*TUI).mainLoop.func1(0xc0001260c0, 0xc00012c050)
    /Users/jwhetton/go/src/github.com/arborchat/muscadine/tui/tui.go:118 +0x320
created by github.com/arborchat/muscadine/tui.(*TUI).mainLoop
    /Users/jwhetton/go/src/github.com/arborchat/muscadine/tui/tui.go:104 +0x62

Crash occurs on first attempt to query for broken threads.

BitiTiger commented 5 years ago

I managed to reproduce it on the master branch after running dep ensure

BitiTiger commented 5 years ago

I got the same error on the notifications branch. I think this information is important since the notifications branch is 13 commits behind master. The most notable difference is using jroimartin's gocui instead of Waldon's fork. I am not sure if gocui is involved but it is mentioned in the traceback so I am noting it here.

cameron@School-PC ~/g/s/g/a/muscadine (notifications) [2]> ./muscadine -username "caton101" redacted:7777
-999
panic: runtime error: slice bounds out of range

goroutine 9 [running]:
github.com/arborchat/muscadine/archive.(*Archive).Needed(0xc0000849c0, 0xa, 0x0, 0x0, 0x0)
        /home/cameron/go/src/github.com/arborchat/muscadine/archive/archive.go:56 +0x2c3
github.com/arborchat/muscadine/tui.(*TUI).queryNeeded(0xc0000b21e0, 0xc000102090, 0xc00013c000, 0x28, 0x5)
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/tui.go:232 +0x45
github.com/arborchat/muscadine/tui.(*TUI).queryNeeded-fm(0xc000102090, 0xc00013c000, 0x7, 0xc000136001)
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/tui.go:351 +0x3e
github.com/jroimartin/gocui.(*Gui).execKeybindings(0xc000102090, 0xc00013c000, 0xc0001d7e38, 0x5b1a48, 0x0, 0x0)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:629 +0xbe
github.com/jroimartin/gocui.(*Gui).onKey(0xc000102090, 0xc0001d7e38, 0xc000050960, 0xc000050800)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:593 +0x1b0
github.com/jroimartin/gocui.(*Gui).handleEvent(0xc000102090, 0xc0001d7e38, 0x2, 0x0)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:413 +0x40
github.com/jroimartin/gocui.(*Gui).MainLoop(0xc000102090, 0x0, 0x0)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:373 +0x2c3
github.com/arborchat/muscadine/tui.(*TUI).mainLoop.func1(0xc00001c5a0, 0xc0000b21e0)
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/tui.go:112 +0x1d0
created by github.com/arborchat/muscadine/tui.(*TUI).mainLoop
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/tui.go:102 +0x62
cameron@School-PC ~/g/s/g/a/muscadine (notifications) [2]> /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:373

Ignore the -999 line in the terminal output. It is part of my feature testing.

whereswaldon commented 5 years ago

Okay, thanks for the stack traces! I can see where the problem is coming from now. We're encountering some kind of error that makes this an invalid slice operation.

BitiTiger commented 5 years ago

It is happening again!

cameron@School-PC ~/g/s/g/a/muscadine (bump-arbor-go)> muscadine -username "caton101" redacted:7777
panic: runtime error: slice bounds out of range

goroutine 23 [running]:
github.com/arborchat/muscadine/archive.(*Archive).Needed(0xc00008a930, 0xa, 0x0, 0x0, 0x0)
        /home/cameron/go/src/github.com/arborchat/muscadine/archive/archive.go:56 +0x2c3
github.com/arborchat/muscadine/tui.(*TUI).queryNeeded(0xc0000c6190, 0xc00010e090, 0xc0001440f0, 0x28, 0x5)
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/tui.go:237 +0x45
github.com/arborchat/muscadine/tui.(*TUI).queryNeeded-fm(0xc00010e090, 0xc0001440f0, 0x7, 0xc000070d01)
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/keybindings.go:33 +0x3e
github.com/jroimartin/gocui.(*Gui).execKeybindings(0xc00010e090, 0xc0001440f0, 0xc0000cfd70, 0x5af838, 0x0, 0x0)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:629 +0xbe
github.com/jroimartin/gocui.(*Gui).onKey(0xc00010e090, 0xc0000cfd70, 0xc000086930, 0xc00008aaa0)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:593 +0x1b0
github.com/jroimartin/gocui.(*Gui).handleEvent(0xc00010e090, 0xc0000cfd70, 0x2, 0x0)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:413 +0x40
github.com/jroimartin/gocui.(*Gui).MainLoop(0xc00010e090, 0x674c30, 0x4)
        /home/cameron/go/src/github.com/jroimartin/gocui/gui.go:373 +0x2c3
github.com/arborchat/muscadine/tui.(*TUI).mainLoop.func1(0xc00007c4e0, 0xc0000c6190)
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/tui.go:117 +0x320
created by github.com/arborchat/muscadine/tui.(*TUI).mainLoop
        /home/cameron/go/src/github.com/arborchat/muscadine/tui/tui.go:103 +0x62
cameron@School-PC ~/g/s/g/a/muscadine (bump-arbor-go) [2]> 
whereswaldon commented 5 years ago

Can anyone replicate this since the merge of #65? The stack traces that I see here are from before that change.