Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: panic: runtime error: index out of range [3] with length 0 [recovered] #1950

Closed
jonathanhecl opened this issue May 17, 2023 · 2 comments
Labels
kind/bug Something is broken.

Comments

@jonathanhecl
Copy link

jonathanhecl commented May 17, 2023

What version of Badger are you using?

v3.2103.5

What version of Go are you using?

1.17

Have you tried reproducing the issue with the latest release?

None

What is the hardware spec (RAM, CPU, OS)?

VPN

What steps will reproduce the bug?

My code

``
opt := badger.DefaultOptions("mydata.db")
opt.WithIndexCacheSize(80 << 20)
opt.WithValueLogFileSize(10 << 20)
opt.CompactL0OnClose = true
opt.Logger = nil

db, err = badger.Open(opt)
if err != nil {
	log.Fatal(err)
}
``

Expected behavior and actual result.

Error message:


panic: runtime error: index out of range [3] with length 0 [recovered]
        panic:
== Recovering from initIndex crash ==
File Info: [ID: 42, Size: 771450, Zeros: 771450]
isEnrypted: false checksumLen: 0 checksum:  indexLen: 0 index: []
== Recovered ==


goroutine 28 [running]:
github.com/dgraph-io/badger/v3/table.(*Table).initBiggestAndSmallest.func1.1()
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/table/table.go:351 +0xa8
github.com/dgraph-io/badger/v3/table.(*Table).initBiggestAndSmallest.func1()
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/table/table.go:397 +0xc2
panic({0x1123040, 0xc0003900a8})
        C:/Program Files/Go/src/runtime/panic.go:884 +0x212
github.com/google/flatbuffers/go.GetUint32(...)
        C:/Users/GS/go/pkg/mod/github.com/google/flatbuffers@v23.5.9+incompatible/go/encode.go:47
github.com/google/flatbuffers/go.GetUOffsetT(...)
        C:/Users/GS/go/pkg/mod/github.com/google/flatbuffers@v23.5.9+incompatible/go/encode.go:121
github.com/dgraph-io/badger/v3/fb.GetRootAsTableIndex(...)
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/fb/TableIndex.go:14
github.com/dgraph-io/badger/v3/table.(*Table).readTableIndex(0xc00039e0c0)
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/table/table.go:707 +0x15e
github.com/dgraph-io/badger/v3/table.(*Table).initIndex(0xc00039e0c0)
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/table/table.go:462 +0x19d
github.com/dgraph-io/badger/v3/table.(*Table).initBiggestAndSmallest(0xc00039e0c0)
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/table/table.go:401 +0x7f
github.com/dgraph-io/badger/v3/table.OpenTable(0xc00045a1e0, {0x0, 0x1, 0x200000, 0x0, 0x0, 0x3f847ae147ae147b, 0x1000, 0x0, 0x1, ...})
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/table/table.go:308 +0x272
github.com/dgraph-io/badger/v3.newLevelsController.func1({0xc000390090, 0x15}, {0x0?, 0x0?, 0x0?})
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/levels.go:150 +0x1f9
created by github.com/dgraph-io/badger/v3.newLevelsController
        C:/Users/GS/go/pkg/mod/github.com/dgraph-io/badger/v3@v3.2103.5/levels.go:129 +0x585
exit status 2

Additional information

I use the same source working by month adding data without problem.
Now, I can't start the app.

@jonathanhecl jonathanhecl added the kind/bug Something is broken. label May 17, 2023
@jonathanhecl jonathanhecl changed the title [BUG]: <Title> [BUG]: panic: runtime error: index out of range [3] with length 0 [recovered] May 17, 2023
@mangalaman93
Copy link
Contributor

Are you on windows by any chance? This seems related to #1883

@jonathanhecl
Copy link
Author

Yes, the VPN is with Windows.

I believe is the same #1883

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken.
Development

No branches or pull requests

2 participants