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

fatal error: sync: unlock of unlocked mutex #37

Closed
xoba opened this issue Feb 5, 2020 · 0 comments · Fixed by #80
Closed

fatal error: sync: unlock of unlocked mutex #37

xoba opened this issue Feb 5, 2020 · 0 comments · Fixed by #80

Comments

@xoba
Copy link

xoba commented Feb 5, 2020

error happens on the line marked "ERROR" below (mvdb.go:36), re v0.0.0-20181213202341-817cee58a244 (btw, it would be great for this repo to be tagged with its own semantic version releases instead):

		db, err := sql.Open("ramsql", "")
		if err != nil {
			return err
		}
		defer db.Close()
		if err := db.Ping(); err != nil {
			return err
		}
		if _, err := db.Exec("CREATE TABLE address (id int, street text)"); err != nil {
			return err
		}
		stmt, err := db.Prepare("insert into address (id,street) values (?,?)")
		if err != nil {
			return err
		}
		for i := 0; i < 10; i++ {
			if _, err := stmt.Exec(i, fmt.Sprintf("%d park ave", 100+i)); err != nil { // ERROR
				return err
			}
		}

and the stack trace is as follows:

goroutine 1 [running]:
runtime.throw(0x17ffa41, 0x1e)
	/Users/mra/go/src/runtime/panic.go:774 +0x72 fp=0xc0007118e0 sp=0xc0007118b0 pc=0x102f742
sync.throw(0x17ffa41, 0x1e)
	/Users/mra/go/src/runtime/panic.go:760 +0x35 fp=0xc000711900 sp=0xc0007118e0 pc=0x102f6c5
sync.(*Mutex).unlockSlow(0xc000208000, 0xc0ffffffff)
	/Users/mra/go/src/sync/mutex.go:196 +0xd6 fp=0xc000711928 sp=0xc000711900 pc=0x1069b36
sync.(*Mutex).Unlock(0xc000208000)
	/Users/mra/go/src/sync/mutex.go:190 +0x48 fp=0xc000711948 sp=0xc000711928 pc=0x1069a48
github.com/proullon/ramsql/driver.(*Stmt).Exec(0xc000208260, 0xc000208500, 0x2, 0x2, 0x1a0f480, 0xc000208720, 0x0, 0x0)
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/driver/stmt.go:108 +0x400 fp=0xc000711a48 sp=0xc000711948 pc=0x1676950
database/sql.ctxDriverStmtExec(0x1a17f00, 0xc0000d6030, 0x1a18180, 0xc000208260, 0xc000238e60, 0x2, 0x2, 0x2, 0x2, 0x0, ...)
	/Users/mra/go/src/database/sql/ctxutil.go:77 +0x165 fp=0xc000711ac0 sp=0xc000711a48 pc=0x1437985
database/sql.resultFromStatement(0x1a17f00, 0xc0000d6030, 0x1a15680, 0xc000208000, 0xc0000f8400, 0xc000711da8, 0x2, 0x2, 0x0, 0x0, ...)
	/Users/mra/go/src/database/sql/sql.go:2435 +0x156 fp=0xc000711b80 sp=0xc000711ac0 pc=0x1442e56
database/sql.(*Stmt).ExecContext(0xc0001e0900, 0x1a17f00, 0xc0000d6030, 0xc000711da8, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0)
	/Users/mra/go/src/database/sql/sql.go:2411 +0x1f9 fp=0xc000711c60 sp=0xc000711b80 pc=0x1442ae9
database/sql.(*Stmt).Exec(...)
	/Users/mra/go/src/database/sql/sql.go:2423
github.com/xoba/ds/a/mv.glob..func10(0xc0000d4360, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/mra/ds/a/mv/mvdb.go:36 +0x374 fp=0xc000711e18 sp=0xc000711c60 pc=0x16789e4
github.com/xoba/ds/a/cmd.RunCommand(0x17e9dc0, 0x3, 0x180e01c, 0x33, 0x185dc78, 0x0, 0x0, 0x0, 0xc000711ef0, 0x103d28a)
	/Users/mra/ds/a/cmd/cmd.go:66 +0xe9 fp=0xc000711e80 sp=0xc000711e18 pc=0x111daa9
github.com/xoba/ds/a/zexe.RunAsMain(0x17e9dc0, 0x3, 0x180e01c, 0x33, 0x185dc78)
	/Users/mra/ds/a/zexe/zexe.go:18 +0x84 fp=0xc000711f00 sp=0xc000711e80 pc=0x1678e74
main.main()
	/Users/mra/ds/a/zexe/mdb/mdb_exe.go:13 +0x8f fp=0xc000711f60 sp=0xc000711f00 pc=0x1678fef
runtime.main()
	/Users/mra/go/src/runtime/proc.go:203 +0x21e fp=0xc000711fe0 sp=0xc000711f60 pc=0x10310ce
runtime.goexit()
	/Users/mra/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc000711fe8 sp=0xc000711fe0 pc=0x105bce1

goroutine 50 [select]:
database/sql.(*DB).connectionOpener(0xc000228000, 0x1a17ec0, 0xc00025b900)
	/Users/mra/go/src/database/sql/sql.go:1052 +0xe8
created by database/sql.OpenDB
	/Users/mra/go/src/database/sql/sql.go:722 +0x15d

goroutine 51 [select]:
database/sql.(*DB).connectionResetter(0xc000228000, 0x1a17ec0, 0xc00025b900)
	/Users/mra/go/src/database/sql/sql.go:1065 +0xfb
created by database/sql.OpenDB
	/Users/mra/go/src/database/sql/sql.go:723 +0x193

goroutine 52 [select]:
github.com/proullon/ramsql/engine.(*Engine).listen(0xc0002067e0)
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/engine.go:111 +0x13b
created by github.com/proullon/ramsql/engine.(*Engine).start
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/engine.go:64 +0x3f

goroutine 53 [chan receive]:
github.com/proullon/ramsql/engine/protocol.(*ChannelEngineEndpoint).Accept(0xc000010018, 0xc000485fb0, 0xc000010028, 0x0, 0x0)
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/protocol/channel.go:81 +0x45
github.com/proullon/ramsql/engine.(*Engine).listen.func1(0xc0002067e0, 0xc0000aeb40)
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/engine.go:100 +0x63
created by github.com/proullon/ramsql/engine.(*Engine).listen
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/engine.go:98 +0x7c

goroutine 54 [chan receive]:
github.com/proullon/ramsql/engine/protocol.(*ChannelEngineConn).ReadStatement(0xc000010028, 0xc0002086c0, 0x1, 0x1, 0x1a1b000)
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/protocol/channel.go:109 +0x52
github.com/proullon/ramsql/engine.(*Engine).handleConnection(0xc0002067e0, 0x1a1b000, 0xc000010028)
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/engine.go:127 +0x3b
created by github.com/proullon/ramsql/engine.(*Engine).listen
	/Users/mra/gopath/pkg/mod/github.com/proullon/[email protected]/engine/engine.go:113 +0xb7
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

Successfully merging a pull request may close this issue.

1 participant