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

database/sql: race detector is not happy on darwin/amd64 #6928

Closed
davecheney opened this issue Dec 10, 2013 · 8 comments
Closed

database/sql: race detector is not happy on darwin/amd64 #6928

davecheney opened this issue Dec 10, 2013 · 8 comments
Assignees
Milestone

Comments

@davecheney
Copy link
Contributor

@davecheney davecheney commented Dec 10, 2013

What steps will reproduce the problem?

Testing database/sql under the race detector has been failing since
https://code.google.com/p/go/source/detail?r=5298d82f682fecf71a7570c6625b2d80880749ff 

What is the expected output? What do you see instead?

Expected, test finishes in under 2 seconds

Got, assorted hangs causing the test harness to kill the build 

SIGQUIT: quit
PC=0x56c25

database/sql.(*fakeDB).columnType(0xc21004d480, 0x204037, 0x2, 0x20403a, 0x4, ...)
    /usr/local/go/src/pkg/database/sql/fakedb_test.go:213 +0x175 fp=0x5e7880
database/sql.(*fakeConn).prepareInsert(0xc210072c80, 0xc21000b840, 0xc21008d640, 0x2,
0x2, ...)
    /usr/local/go/src/pkg/database/sql/fakedb_test.go:400 +0x68e fp=0x5e7a98
database/sql.(*fakeConn).Prepare(0xc210072c80, 0x204030, 0x14, 0xc21003a2f0, 0x1, ...)
    /usr/local/go/src/pkg/database/sql/fakedb_test.go:457 +0x5a6 fp=0x5e7b80
database/sql.(*DB).exec(0xc210050100, 0x204030, 0x14, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/database/sql/sql.go:884 +0x42e fp=0x5e7cd8
database/sql.(*DB).Exec(0xc210050100, 0x204030, 0x14, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/database/sql/sql.go:850 +0xb4 fp=0x5e7d58
database/sql.exec(0x5574a8, 0xc21004f7e0, 0xc210050100, 0x204030, 0x14, ...)
    /usr/local/go/src/pkg/database/sql/sql_test.go:65 +0x84 fp=0x5e7de0
database/sql.TestTxQuery(0xc21004f7e0)
    /usr/local/go/src/pkg/database/sql/sql_test.go:471 +0x1ef fp=0x5e7f40
testing.tRunner(0xc21004f7e0, 0x47b1d8)
    /usr/local/go/src/pkg/testing/testing.go:391 +0x110 fp=0x5e7f90
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1394 fp=0x5e7f98
created by testing.RunTests
    /usr/local/go/src/pkg/testing/testing.go:471 +0xbd7

goroutine 1 [chan receive]:
testing.RunTests(0x25fc80, 0x47b0a0, 0x26, 0x26, 0x14d201)
    /usr/local/go/src/pkg/testing/testing.go:472 +0xc24
testing.Main(0x25fc80, 0x47b0a0, 0x26, 0x26, 0x4788c0, ...)
    /usr/local/go/src/pkg/testing/testing.go:403 +0xa3
main.main()
    database/sql/_test/_testmain.go:137 +0xdd

goroutine 37 [chan receive]:
database/sql.(*DB).connectionOpener(0xc210050100)
    /usr/local/go/src/pkg/database/sql/sql.go:574 +0x5f
created by database/sql.Open
    /usr/local/go/src/pkg/database/sql/sql.go:436 +0x355

rax     0x1
rbx     0xdeaddeaddeaddead
rcx     0xdeaddeaddeaddead
rdx     0xdeaddeaddeaddead
rdi     0xc210001b40
rsi     0x4
rbp     0x3
rsp     0x5e77f8
r8      0x0
r9      0x42e6
r10     0xc21008d5d0
r11     0x1
r12     0x1dd180
r13     0x6b85543926330
r14     0x133e3d197f8b3e00
r15     0x0
rip     0x56c25
rflags  0x10206
cs      0x2b
fs      0x40000000
gs      0x0
*** Test killed with quit: ran too long (10m0s).
FAIL    database/sql    600.073s

Please use labels and text to provide additional information.
@davecheney
Copy link
Contributor Author

@davecheney davecheney commented Dec 10, 2013

Comment 1:

Looks like it's not just darwin/amd64-race,
http://build.golang.org/log/3a3621414b48cdc38a65ca1bfd5afd513dbf71d7

Labels changed: removed os-macosx.

@robpike
Copy link
Contributor

@robpike robpike commented Dec 13, 2013

Comment 2:

Looks like a genuine failure, perhaps a compiler bug. Fix in 1.3.

Status changed to Accepted.

@davecheney
Copy link
Contributor Author

@davecheney davecheney commented Jan 5, 2014

Comment 3:

I was lucky enough to find sql.test wedged during a race build and hit it with SIGQUIT
PASS
BenchmarkConcurrentDBExec-4        5      37539173 ns/op     2354108 B/op      14705 allocs/op
BenchmarkConcurrentStmtQuery-4         5      33826012 ns/op     2754566 B/op      18224 allocs/op
BenchmarkConcurrentStmtExec-4          5      25281842 ns/op     1922510 B/op       4179 allocs/op
BenchmarkConcurrentTxQuery-4    SIGQUIT: quit
PC=0x2912b
runtime.mach_semaphore_wait()
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/sys_darwin_amd64.s:395 +0xb
runtime.semasleep(0xffffffffffffffff)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/os_darwin.c:414 +0xa1
runtime.notesleep(0x489328)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/lock_sema.c:164 +0xc9
stopm()
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/proc.c:932 +0xe1
gcstopm()
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/proc.c:1100 +0xc5
schedule()
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/proc.c:1296 +0x4a
goexit0(0xc21004fea0)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/proc.c:1417 +0x102
runtime.mcall(0x26d9d)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/runtime/asm_amd64.s:178 +0x4b
goroutine 1 [chan receive]:
testing.(*B).run(0xc2100513c0, 0x3, 0x5cdd60, 0x1, 0x1, ...)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/testing/benchmark.go:171 +0x6c
testing.RunBenchmarks(0x26d4c8, 0x47a960, 0x8, 0x8)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/testing/benchmark.go:303 +0x6bb
testing.Main(0x26d4c8, 0x47d1a0, 0x29, 0x29, 0x47a960, ...)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/testing/testing.go:411 +0x217
main.main()
    /tmp/builder/go-build150197137/database/sql/_test/_testmain.go:143 +0xdd
goroutine 67 [chan receive]:
database/sql.(*DB).connectionOpener(0xc210053680)
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/database/sql/sql.go:574 +0x5f
created by database/sql.Open
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/database/sql/sql.go:436 +0x348
goroutine 60 [running]:
    goroutine running on other thread; stack unavailable
created by testing.(*B).run
    /Users/builder/workspace/darwin-amd64-race-cheney-36d5461843ce/go/src/pkg/testing/benchmark.go:170 +0x3c
rax     0xe
rbx     0x489328
rcx     0x7fff5fbffb08
rdx     0xffffffffffffffff
rdi     0x1503
rsi     0x0
rbp     0x4845c0
rsp     0x7fff5fbffb08
r8      0x41
r9      0xa9
r10     0x5b9000
r11     0x286
r12     0x0
r13     0x1726d18366f48
r14     0x134641dc2d5c2200
r15     0x0
rip     0x2912b
rflags  0x286
cs      0x7
fs      0x20000000
gs      0x80000
exit status 2
FAIL    database/sql    155.329s
I need to collect more samples, but it looks to me like stop-the-world has been
declared, but another g is spinning preventing the gc from running.
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jan 14, 2014

Comment 5:

Owner changed to @dvyukov.

@dvyukov
Copy link
Member

@dvyukov dvyukov commented Jan 15, 2014

Comment 6:

Issue #7008 has been merged into this issue.

@dvyukov
Copy link
Member

@dvyukov dvyukov commented Jan 15, 2014

Comment 7:

Russ, can you take a look at this?
I think it's also liveness issues.

Owner changed to @rsc.

@rsc
Copy link
Contributor

@rsc rsc commented Apr 3, 2014

Comment 8:

Race detector builds seem okay now. If this is still happening on Monday (after a few
more of my pending CLs land) please file a new bug.

Status changed to TimedOut.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.