panic: runtime error: invalid memory address or nil pointer dereference
bachkovsky-git opened this issue · comments
I get an error when I run the command cat *log | slit
with large log files. When there isn't many files in input - an error does not occur.
1/3585
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x468146]
goroutine 15 [running]:
panic(0x507520, 0xc42000c150)
/usr/lib/golang/src/runtime/panic.go:500 +0x1a1
bufio.(*Reader).ReadSlice(0x0, 0xc42055400a, 0x13f, 0xc4200a83c0, 0x13f, 0x13f, 0xc42000c1d0)
/usr/lib/golang/src/bufio/bufio.go:308 +0x26
bufio.(*Reader).ReadBytes(0x0, 0xc42000c10a, 0x5aa5c0, 0x410bfe, 0xc42003fce0, 0xc42003fcf0, 0xc42000c101)
/usr/lib/golang/src/bufio/bufio.go:408 +0x66
main.(*Fetcher).readline(0xc420018300, 0xc42000c1d0, 0x5aa5c0, 0xc42000c1d0, 0xdde01, 0x5aa5c0, 0xc42000c1d0)
/home/mike/work/go/src/github.com/tigrawap/slit/fetcher.go:134 +0x38
main.(*Fetcher).advanceLines(0xc420018300, 0xe00, 0xdda85, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/mike/work/go/src/github.com/tigrawap/slit/fetcher.go:309 +0x13e
main.(*viewer).updateLastLine(0xc4200ae000, 0x5ab5c0, 0xc420016680)
/home/mike/work/go/src/github.com/tigrawap/slit/term.go:475 +0x19b
main.(*viewer).termGui.func2(0xc4200ae000, 0x5ab5c0, 0xc420016680, 0xc42000cc60)
/home/mike/work/go/src/github.com/tigrawap/slit/term.go:384 +0x3f
created by main.(*viewer).termGui
/home/mike/work/go/src/github.com/tigrawap/slit/term.go:384 +0x367
Am i doing something wrong? OS is Fedora 25.
what is total size of files? I will try to reproduce/understand
Are you using x86 or amd64 build?
nm, reproduced.
Will take a look later today
release will follow up later, just rebuild go install github.com/tigrawap/slit
will do