aergoio / aergo-lib Goto Github PK
View Code? Open in Web Editor NEWa collection of common libraries used in the aergo project
License: MIT License
a collection of common libraries used in the aergo project
License: MIT License
Hi, It seems like the latest update of Aergo-lib doesn't allow for BadgerDB instance to be created. Specifically, I can't create a BadgerDB instance without the lib panic
ing. This didn't happen in the previous version (v1.3.0).
I have a minimal code example to demonstrate this panic:
package main
import (
"log"
"github.com/aergoio/aergo-lib/db"
)
func main() {
aergoDB, err := db.NewBadgerDB("data")
if err != nil {
log.Fatal(err)
}
defer aergoDB.Close()
}
Here is the panic that is generated:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1562c12]
goroutine 1 [running]:
github.com/aergoio/aergo-lib/db.(*extendedLog).Infof(0x0, 0x16b2307, 0x1b, 0xc0054c4080, 0x2, 0x2)
/Users/nmarley/go/pkg/mod/github.com/aergoio/[email protected]/db/logger.go:24 +0x22
github.com/dgraph-io/badger.(*Options).Infof(...)
/Users/nmarley/go/pkg/mod/github.com/dgraph-io/[email protected]/logger.go:46
github.com/dgraph-io/badger.newLevelsController(0xc00016c000, 0xc00010fa98, 0x0, 0x0, 0x0)
/Users/nmarley/go/pkg/mod/github.com/dgraph-io/[email protected]/levels.go:175 +0xe56
github.com/dgraph-io/badger.Open(0x16a3d70, 0x4, 0x16a3d70, 0x4, 0x1, 0x0, 0x0, 0x1, 0x0, 0x17886e0, ...)
/Users/nmarley/go/pkg/mod/github.com/dgraph-io/[email protected]/db.go:288 +0xb75
github.com/aergoio/aergo-lib/db.NewBadgerDB(0x16a3d70, 0x4, 0x16a755c, 0x8, 0xc00012ca58, 0xc000123f20)
/Users/nmarley/go/pkg/mod/github.com/aergoio/[email protected]/db/badgerdb.go:96 +0x136
main.main()
/Users/nmarley/projects/aergo-db-log-broken/main.go:10 +0x48
exit status 2
If it helps, the contents of the data
dir after this panic is just a single file MANIFEST
.
I believe this is probably related to the replacement of the badger default logger in edf758f, but I am currently not too familiar with the lib. Am I using this wrong (e.g. API changed), or does this look like a legitimate bug?
Thanks,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.