blazer
blazer copied to clipboard
Possible crashing bug
Saw this in test output:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x6e8aa8]
goroutine 161 [running]:
bytes.(*Buffer).Len(...)
/home/travis/.gimme/versions/go/src/bytes/buffer.go:73
github.com/kurin/blazer/b2.(*memoryBuffer).Len(0xc0005426f0, 0x0)
/home/travis/gopath/src/github.com/kurin/blazer/b2/buffer.go:122 +0x8
github.com/kurin/blazer/b2.(*Writer).Write(0xc000130160, 0xc00009e060, 0x14, 0x14, 0x14, 0x0, 0x0)
/home/travis/gopath/src/github.com/kurin/blazer/b2/writer.go:257 +0x7e
github.com/kurin/blazer/b2.onlyWriter.Write(...)
/home/travis/gopath/src/github.com/kurin/blazer/b2/reader.go:302
io.copyBuffer(0x8545e0, 0xc000032010, 0x853c80, 0xc00000e580, 0xc00009e060, 0x14, 0x14, 0xc00008e300, 0xc000041f00, 0x1)
/home/travis/.gimme/versions/go/src/io/io.go:411 +0x1fb
io.Copy(...)
/home/travis/.gimme/versions/go/src/io/io.go:368
github.com/kurin/blazer/b2.copyContext.func1(0xc000094440, 0x853c80, 0xc00000e580, 0xc00001c2e0, 0xc000094450, 0xc0000291a0)
/home/travis/gopath/src/github.com/kurin/blazer/b2/reader.go:312 +0xcc
created by github.com/kurin/blazer/b2.copyContext
/home/travis/gopath/src/github.com/kurin/blazer/b2/reader.go:308 +0x119
FAIL github.com/kurin/blazer/b2 0.059s
Probably a use-after-close?
I'm also experiencing this bug when using io.ReadAll. Any solution?
Update: turns out I just forgot to create my B2 client... ha