Skip to content

[Release Blocker] valueLog.Read slice index crash #1389

@jarifibrahim

Description

@jarifibrahim

The crash was first seen in cddf7c03451c . The line in question is https://github.com/dgraph-io/badger/blob/cddf7c03451c91e7a9c9df4121d16e1a56937786/value.go#L1518 .

Similar to the other index crash issues. This one is also not reproducible. The crash could be because the background compression/encryption corrupts the value pointer. The lower bound of [4294967295:7] is math.MaxUint32

panic: runtime error: slice bounds out of range [4294967295:7]

goroutine 90985 [running]:
github.com/dgraph-io/badger/v2.(*valueLog).Read(0xc0005549d0, 0xc7d00000000, 0x10000c0001b83b9, 0xc006e9c360, 0x10, 0xc006e959b0, 0x99e0de, 0xc08a0261a0, 0xc056f582a3, 0xc)
	/go/pkg/mod/github.com/dgraph-io/badger/v2@v2.0.1-rc1.0.20200421062606-cddf7c03451c/value.go:1518 +0x604
github.com/dgraph-io/badger/v2.(*Item).yieldItemValue(0xc006ea0840, 0xd979c4, 0x1, 0xc05b94678d, 0xc006e95b00, 0x9598c8, 0x60)
	/go/pkg/mod/github.com/dgraph-io/badger/v2@v2.0.1-rc1.0.20200421062606-cddf7c03451c/iterator.go:170 +0x11d
github.com/dgraph-io/badger/v2.(*Item).Value(0xc006ea0840, 0xc006e95bc0, 0x0, 0x0)
	/go/pkg/mod/github.com/dgraph-io/badger/v2@v2.0.1-rc1.0.20200421062606-cddf7c03451c/iterator.go:105 +0xd6
github.com/dgraph-io/dgraph/posting.ReadPostingList(0xc056f582a0, 0x18, 0x18, 0xc006e98820, 0x0, 0x0, 0x0)
	/ext-go/1/src/github.com/dgraph-io/dgraph/posting/mvcc.go:301 +0x374
github.com/dgraph-io/dgraph/posting.getNew(0xc056f582a0, 0x18, 0x18, 0xc000554800, 0xffffffffffffffff, 0x0, 0x0, 0x0)
	/ext-go/1/src/github.com/dgraph-io/dgraph/posting/mvcc.go:347 +0x1dc
github.com/dgraph-io/dgraph/posting.(*LocalCache).getInternal(0x0, 0xc056f582a0, 0x18, 0x18, 0x1, 0x18, 0x0, 0x1)
	/ext-go/1/src/github.com/dgraph-io/dgraph/posting/lists.go:209 +0x342
github.com/dgraph-io/dgraph/posting.(*LocalCache).Get(...)
	/ext-go/1/src/github.com/dgraph-io/dgraph/posting/lists.go:242
github.com/dgraph-io/dgraph/worker.(*queryState).handleValuePostings.func1(0x0, 0x1d, 0xc042934680, 0x98b566)
	/ext-go/1/src/github.com/dgraph-io/dgraph/worker/task.go:385 +0x1fb
github.com/dgraph-io/dgraph/worker.(*queryState).handleValuePostings.func2(0xc006ea2000, 0xc006e9a100, 0x0, 0x1d)
	/ext-go/1/src/github.com/dgraph-io/dgraph/worker/task.go:494 +0x3a
created by github.com/dgraph-io/dgraph/worker.(*queryState).handleValuePostings
	/ext-go/1/src/github.com/dgraph-io/dgraph/worker/task.go:493 +0x3ee

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/crashThis issue causes a panic or some other of exception that causes a crash.help wantedPlease help us fix this!kind/bugSomething is broken.priority/P1Serious issue that requires eventual attention (can wait a bit)releaseblockerstatus/acceptedWe accept to investigate or work on it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions