Skip to content

possible data race #366

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

Closed
kevinburke opened this issue Jan 2, 2017 · 4 comments
Closed

possible data race #366

kevinburke opened this issue Jan 2, 2017 · 4 comments

Comments

@kevinburke
Copy link
Contributor

From golang/go#18429:

On a side note, sqlite3 might also have a data race where sqliteConn.Close doesn't check if the sqliteStmt.exec is still running the goroutine.

Here's the stack trace:

WARNING: DATA RACE
Read at 0x00c420095810 by goroutine 2118:
  github.com/mattn/go-sqlite3.(*SQLiteStmt).exec.func3()
      /home/daniel/src/github.com/mattn/go-sqlite3/sqlite3.go:814 +0xef

Previous write at 0x00c420095810 by goroutine 312:
  github.com/mattn/go-sqlite3.(*SQLiteConn).Close()
      /home/daniel/src/github.com/mattn/go-sqlite3/sqlite3.go:633 +0x7b
  database/sql.(*driverConn).finalClose.func2()
      /home/daniel/code/go-cl/src/database/sql/sql.go:439 +0x8c
  database/sql.withLock()
      /home/daniel/code/go-cl/src/database/sql/sql.go:2452 +0x76
  database/sql.(*driverConn).finalClose()
      /home/daniel/code/go-cl/src/database/sql/sql.go:441 +0x1d0
  database/sql.(finalCloser).(database/sql.finalClose)-fm()
      /home/daniel/code/go-cl/src/database/sql/sql.go:536 +0x46
  database/sql.(*driverConn).Close()
      /home/daniel/code/go-cl/src/database/sql/sql.go:418 +0x1ee
  database/sql.(*DB).putConn()
      /home/daniel/code/go-cl/src/database/sql/sql.go:1016 +0x2d0
  database/sql.(*Tx).close()
      /home/daniel/code/go-cl/src/database/sql/sql.go:1428 +0xb7
  database/sql.(*Tx).rollback()
      /home/daniel/code/go-cl/src/database/sql/sql.go:1497 +0x14d
  database/sql.(*DB).begin.func2()
      /home/daniel/code/go-cl/src/database/sql/sql.go:1366 +0xb8

(I'm just passing this along; I don't know how to repro it)

@mattn
Copy link
Owner

mattn commented Jan 3, 2017

should fix race condition.

Could you please try this 6f2749a ?

@yonderblue
Copy link

yonderblue commented Feb 11, 2017

Isn't there another one around line 769?

@mattn
Copy link
Owner

mattn commented Feb 11, 2017

No

@mattn mattn closed this as completed Feb 11, 2017
@mattn
Copy link
Owner

mattn commented Feb 11, 2017

Ah, I just notice you said. Thanks.

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

3 participants