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

Open boltDB makes kernel dead. #28

Closed
mcdoyaji opened this issue Feb 28, 2018 · 4 comments
Closed

Open boltDB makes kernel dead. #28

mcdoyaji opened this issue Feb 28, 2018 · 4 comments

Comments

@mcdoyaji
Copy link

mcdoyaji commented Feb 28, 2018

Trying to opening database make kernel dead.

I install bold DB container & log install got 2018/02/28 06:36:17 lgo was installed in /lgo successfully message.

and I run below code. got kernel dead.

import (
	"log"

	"github.com/boltdb/bolt"
)

func main() {
	// Open the my.db data file in your current directory.
	// It will be created if it doesn't exist.
	db, err := bolt.Open("my.db", 0600, nil)
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

}

main()

from

my.db file created.

I think it's not involved with file. golang-scribble makes dir and json file well.

@yunabe
Copy link
Owner

yunabe commented Feb 28, 2018

What happens if you replace log.Fatal with Info or fmt.Print?

@mcdoyaji
Copy link
Author

fmt.Print(err) -> invalid argument

others ->panic: runtime error: invalid memory address or nil pointer dereference

invalid argument

panic: runtime error: invalid memory address or nil pointer dereference

goroutine 43 [running]:
runtime/debug.Stack(0xc400000008, 0x7faa553be490, 0xc4204d20e0)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa9
github.com/yunabe/lgo/core.(*resultCounter).recordResult(0xc4204d20c8, 0x7faa552d01a0, 0x7faa556e0460)
	/go/src/github.com/yunabe/lgo/core/core.go:91 +0xce
github.com/yunabe/lgo/core.(*resultCounter).recordResultInDefer(0xc4204d20c8)
	/go/src/github.com/yunabe/lgo/core/core.go:96 +0x3b
panic(0x7faa552d01a0, 0x7faa556e0460)
	/usr/local/go/src/runtime/panic.go:491 +0x294
github.com/boltdb/bolt.(*DB).Close(0x0, 0x0, 0x0)
	/go/src/github.com/boltdb/bolt/db.go:392 +0x3a
github.com/yunabe/lgo/sess7b2274696d65223a313531393830303633303339383336363735397d/exec4.LgoExport_main()
	/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313531393830303633303339383336363735397d/exec4/src.go:16 +0x79
github.com/yunabe/lgo/sess7b2274696d65223a313531393830303633303339383336363735397d/exec4.lgo_init()
	/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313531393830303633303339383336363735397d/exec4/src.go:20 +0x27
github.com/yunabe/lgo/cmd/runner.loadShared.func3()
	/go/src/github.com/yunabe/lgo/cmd/runner/runner.go:60 +0x26
github.com/yunabe/lgo/core.startExec.func1(0xc4204d2090, 0xc42030ee30)
	/go/src/github.com/yunabe/lgo/core/core.go:247 +0x83
created by github.com/yunabe/lgo/core.startExec
	/go/src/github.com/yunabe/lgo/core/core.go:244 +0xcb
main routine failed

@mcdoyaji
Copy link
Author

hey, I thing my dev env is the problem

I'm using docker toolobx and below isuue tells that is cause.

boltdb/bolt#272 (comment)

Sorry to bother you.

@yunabe
Copy link
Owner

yunabe commented Feb 28, 2018

fmt.Print(err) -> invalid argument

Hmm.. it's weird.
Anyway, it's not a good idea to call functions that invokes os.Exit internally in lgo because they terminate lgo kernel process. I will add a note to README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants