sourcegraph/thyme

thyme show slice bounds out of range

denivorium opened this issue · 2 comments

I just pulled the latest binary, 0.2.2, and I'm getting a slightly different stacktrace when trying to run show. I'm not proficient in GO troubleshooting, so I thought I'd pass it on.

$ ./thyme-linux-386 show -i thyme.json -w stats > plain.html
panic: runtime error: slice bounds out of range [recovered]
    panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0x81b5760, 0x1852c030)
    /home/beyang/go/src/runtime/panic.go:500 +0x331
text/template.errRecover(0x185cdcc0)
    /home/beyang/go/src/text/template/exec.go:140 +0xd9
panic(0x81b5760, 0x1852c030)
    /home/beyang/go/src/runtime/panic.go:458 +0x40b
github.com/sourcegraph/thyme.(*BarChart).OrderedBars(0x1859b3b0, 0x0, 0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/show.go:99 +0x198
reflect.Value.call(0x81b5a60, 0x1859b3b0, 0x213, 0x81d2f1c, 0x4, 0x8292fd0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/beyang/go/src/reflect/value.go:434 +0xdd7
reflect.Value.Call(0x81b5a60, 0x1859b3b0, 0x213, 0x8292fd0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/beyang/go/src/reflect/value.go:302 +0x8c
text/template.(*state).evalCall(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x81b5a60, 0x1859b3b0, 0x213, 0x8272ee0, 0x1859c080, 0x1859c067, ...)
    /home/beyang/go/src/text/template/exec.go:658 +0x87d
text/template.(*state).evalField(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c067, 0xb, 0x8272ee0, 0x1859c080, 0x1859e010, 0x1, ...)
    /home/beyang/go/src/text/template/exec.go:549 +0x301
text/template.(*state).evalFieldChain(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x81b5a60, 0x185a1510, 0x196, 0x8272ee0, 0x1859c080, 0x185a0008, ...)
    /home/beyang/go/src/text/template/exec.go:520 +0x1d4
text/template.(*state).evalVariableNode(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c080, 0x1859e010, 0x1, 0x1, 0x0, 0x0, ...)
    /home/beyang/go/src/text/template/exec.go:508 +0x217
text/template.(*state).evalCommand(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c000, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/beyang/go/src/text/template/exec.go:432 +0x747
text/template.(*state).evalPipeline(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859a030, 0x0, 0x0, 0x0)
    /home/beyang/go/src/text/template/exec.go:400 +0x11c
text/template.(*state).walkRange(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c260)
    /home/beyang/go/src/text/template/exec.go:309 +0xe7
text/template.(*state).walk(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x8272de0, 0x1859c260)
    /home/beyang/go/src/text/template/exec.go:237 +0x23d
text/template.(*state).walk(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x8272ce0, 0x1858c460)
    /home/beyang/go/src/text/template/exec.go:234 +0x523
text/template.(*state).walkRange.func1(0x81ae260, 0x185e2db4, 0x82, 0x81b5a60, 0x185a1510, 0x196)
    /home/beyang/go/src/text/template/exec.go:321 +0x13a
text/template.(*state).walkRange(0x185cdc84, 0x819dac0, 0x185a1520, 0x16, 0x18511280)
    /home/beyang/go/src/text/template/exec.go:330 +0x366
text/template.(*state).walk(0x185cdc84, 0x819dac0, 0x185a1520, 0x16, 0x8272de0, 0x18511280)
    /home/beyang/go/src/text/template/exec.go:237 +0x23d
text/template.(*state).walk(0x185cdc84, 0x819dac0, 0x185a1520, 0x16, 0x8272ce0, 0x18510960)
    /home/beyang/go/src/text/template/exec.go:234 +0x523
text/template.(*Template).execute(0x18510860, 0x8271900, 0x1852c0e0, 0x819dac0, 0x185a1520, 0x0, 0x0)
    /home/beyang/go/src/text/template/exec.go:189 +0x1e3
text/template.(*Template).Execute(0x18510860, 0x8271900, 0x1852c0e0, 0x819dac0, 0x185a1520, 0x0, 0x0)
    /home/beyang/go/src/text/template/exec.go:175 +0x4b
github.com/sourcegraph/thyme.Stats(0x185a0260, 0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/show.go:24 +0x11e
main.(*ShowCmd).Execute(0x82830f0, 0x1859a240, 0x0, 0x5, 0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x461
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0x1859a210, 0x1850a2a8, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/beyang/src/github.com/jessevdk/go-flags/parser.go:314 +0x8f9
github.com/jessevdk/go-flags.(*Parser).Parse(0x1859a210, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/beyang/src/github.com/jessevdk/go-flags/parser.go:185 +0x78
main.main.func1(0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2d
main.main()
    /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x22

There is a partial HTML page.

[ thyme]$ ls -l
total 3524
-rw-r--r--. 1 user group    7455 Aug 19 15:34 plain.html
-rw-r--r--. 1 user group    2988 Aug 19 15:32 thyme.json
-rwxr-xr-x. 1 user group 3595657 Aug 19 14:15 thyme-linux-386

When I try to load it into a browser I see

Error: Container is not defined
https://www.gstatic.com/charts/loader.js line 138 > eval
Line 108

Running on Fedora 21

This was a stupid oversight by me. Sorry about that. Please try downloading the latest binary again. Should work now. Re-open if still an issue.

Awesome, works with my sample size of 2 now :)

Off to generate more data.