blazer icon indicating copy to clipboard operation
blazer copied to clipboard

Possible crashing bug

Open kurin opened this issue 5 years ago • 2 comments

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

kurin avatar May 01 '20 06:05 kurin

Probably a use-after-close?

kurin avatar May 01 '20 06:05 kurin

I'm also experiencing this bug when using io.ReadAll. Any solution?

Update: turns out I just forgot to create my B2 client... ha

httpjamesm avatar Jan 26 '23 22:01 httpjamesm