darkwood001 / odbc

Automatically exported from code.google.com/p/odbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed. #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I don't know how to reproduce.

go-magica-web.go:148 (my file) is :
if err := db.QueryRow("select getdate()").Scan(&timeNow); err != nil {

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

go-magica-web: pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion 
`mutex->__data.__owner == 0' failed.
SIGABRT: abort
PC=0xb775f424
signal arrived during cgo execution

runtime.cgocall(0x804b7e0, 0x86ffcc3c)
        /usr/local/go/src/pkg/runtime/cgocall.c:149 +0x10c fp=0x86ffcc30
code.google.com/p/odbc/api._Cfunc_SQLNumResultCols(0x827c0e38, 0x97374a20, 0x1)
        code.google.com/p/odbc/api/_obj/_cgo_defun.c:187 +0x31 fp=0x86ffcc3c
code.google.com/p/odbc/api.SQLNumResultCols(0x827c0e38, 0x97374a20, 0x0)
        /opt/go/go-magica-web/GOPATH/src/code.google.com/p/odbc/api/zapi_unix.go:98 +0x30 fp=0x86ffcc4c
code.google.com/p/odbc.(*ODBCStmt).BindColumns(0x97428210, 0x88beb60, 0x0)
        /opt/go/go-magica-web/GOPATH/src/code.google.com/p/odbc/odbcstmt.go:124 +0x42 fp=0x86ffcc90
code.google.com/p/odbc.(*Stmt).Query(0x97375fc0, 0x88beb60, 0x0, 0x0, 0x0, ...)
        /opt/go/go-magica-web/GOPATH/src/code.google.com/p/odbc/stmt.go:91 +0x1dd fp=0x86ffccbc
database/sql.rowsiFromStatement(0xb72d3d38, 0x9734c6c0, 0xb72d3d10, 0x97375fc0, 
0x0, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:1409 +0x1ea fp=0x86ffcd28
database/sql.(*DB).queryConn(0x9734c580, 0x9734c6c0, 0x973749d8, 0x83d2138, 
0x10, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:953 +0x30a fp=0x86ffcda4
database/sql.(*DB).query(0x9734c580, 0x83d2138, 0x10, 0x0, 0x0, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:913 +0xaa fp=0x86ffcdd8
database/sql.(*DB).Query(0x9734c580, 0x83d2138, 0x10, 0x0, 0x0, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:899 +0x6b fp=0x86ffce10
database/sql.(*DB).QueryRow(0x9734c580, 0x83d2138, 0x10, 0x0, 0x0, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:977 +0x50 fp=0x86ffce44
main.SqlNow(0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /opt/go/go-magica-web/go-magica-web.go:148 +0xd1 fp=0x86ffcea8
main.TickAtTime(0x97351800, 0x8440f18)
        /opt/go/go-magica-web/go-magica-web.go:177 +0x2b fp=0x86ffcfc4
runtime.goexit()
        /usr/local/go/src/pkg/runtime/proc.c:1394 fp=0x86ffcfc8
created by main.main
        /opt/go/go-magica-web/go-magica-web.go:2242 +0x80c

goroutine 1 [IO wait]:
net.runtime_pollWait(0xb72d4cf4, 0x72, 0x0)
        /usr/local/go/src/pkg/runtime/netpoll.goc:116 +0x5e
net.(*pollDesc).Wait(0x97351b78, 0x72, 0xb72d3878, 0xb)
        /usr/local/go/src/pkg/net/fd_poll_runtime.go:81 +0x32
net.(*pollDesc).WaitRead(0x97351b78, 0xb, 0xb72d3878)
        /usr/local/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(*netFD).accept(0x97351b40, 0x844195c, 0x0, 0xb72d3878, 0xb)
        /usr/local/go/src/pkg/net/fd_unix.go:382 +0x227
net.(*TCPListener).AcceptTCP(0x9737ae30, 0x8098c83, 0x86fe8c44, 0x8098c83)
        /usr/local/go/src/pkg/net/tcpsock_posix.go:233 +0x41
net.(*TCPListener).Accept(0x9737ae30, 0xb72d5a70, 0x973874f0, 0x974558c0, 0x0)
        /usr/local/go/src/pkg/net/tcpsock_posix.go:243 +0x28
net/http.(*Server).Serve(0x97353f30, 0xb72d4ed8, 0x9737ae30, 0x0, 0x0)
        /usr/local/go/src/pkg/net/http/server.go:1622 +0x75
net/http.(*Server).ListenAndServe(0x97353f30, 0x97353f30, 0xb72d4e88)
        /usr/local/go/src/pkg/net/http/server.go:1612 +0x83
net/http.ListenAndServe(0x9737ae08, 0x5, 0xb72d4e88, 0x97353db0, 0x1, ...)
        /usr/local/go/src/pkg/net/http/server.go:1677 +0x5f
main.main()
        /opt/go/go-magica-web/go-magica-web.go:2321 +0x12b5

goroutine 3 [syscall]:
runtime.goexit()
        /usr/local/go/src/pkg/runtime/proc.c:1394

goroutine 4 [chan receive]:
github.com/cupcake/raven-go.(*Client).worker(0x972f5960)
        /opt/go/go-magica-web/GOPATH/src/github.com/cupcake/raven-go/client.go:265 +0x3b
created by github.com/cupcake/raven-go.NewClient
        /opt/go/go-magica-web/GOPATH/src/github.com/cupcake/raven-go/client.go:202 +0xc7

goroutine 5 [chan receive]:
main.func·004()
        /opt/go/go-magica-web/go-magica-web.go:2226 +0x3d
created by main.main
        /opt/go/go-magica-web/go-magica-web.go:2231 +0x6c0

goroutine 9 [sleep]:
time.Sleep(0x3d431c00, 0x4e92)
        /usr/local/go/src/pkg/runtime/time.goc:31 +0x39
main.TickAtTime(0x97351840, 0x8440f1c)
        /opt/go/go-magica-web/go-magica-web.go:209 +0x529
created by main.main
        /opt/go/go-magica-web/go-magica-web.go:2246 +0x868

goroutine 10 [runnable]:
code.google.com/p/odbc/api._Cfunc_SQLNumResultCols(0x825cd8f0, 0x974423e0, 0x0)
        code.google.com/p/odbc/api/_obj/_cgo_defun.c:187 +0x31
code.google.com/p/odbc/api.SQLNumResultCols(0x825cd8f0, 0x974423e0, 0x9741da60)
        /opt/go/go-magica-web/GOPATH/src/code.google.com/p/odbc/api/zapi_unix.go:98 +0x30
code.google.com/p/odbc.(*ODBCStmt).BindColumns(0x974283f0, 0x97374b38, 0x1)
        /opt/go/go-magica-web/GOPATH/src/code.google.com/p/odbc/odbcstmt.go:124 +0x42
code.google.com/p/odbc.(*Stmt).Query(0x97375160, 0x97374b38, 0x1, 0x1, 0x0, ...)
        /opt/go/go-magica-web/GOPATH/src/code.google.com/p/odbc/stmt.go:91 +0x1dd
database/sql.rowsiFromStatement(0xb72d3d38, 0x9734c740, 0xb72d3d10, 0x97375160, 
0x86ff8e48, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:1409 +0x1ea
database/sql.(*DB).queryConn(0x9734c640, 0x9734c740, 0x97374b18, 0x846c7c8, 
0x14e, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:953 +0x30a
database/sql.(*DB).query(0x9734c640, 0x846c7c8, 0x14e, 0x86ff8e48, 0x1, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:913 +0xaa
database/sql.(*DB).Query(0x9734c640, 0x846c7c8, 0x14e, 0x86ff8e48, 0x1, ...)
        /usr/local/go/src/pkg/database/sql/sql.go:899 +0x6b
main.SuivisV2(0x0, 0x0, 0x0, 0x0)
        /opt/go/go-magica-web/go-magica-web.go:1857 +0x521
main.RefreshSuivisHourly2(0x97353750)
        /opt/go/go-magica-web/go-magica-web.go:237 +0x4e
main.func·007()
        /opt/go/go-magica-web/go-magica-web.go:2253 +0xea
created by main.main
        /opt/go/go-magica-web/go-magica-web.go:2259 +0x8a0

goroutine 11 [syscall]:
github.com/alecthomas/gozmq._C2func_zmq_recvmsg(0x88f3f90, 0x97451680, 0x0, 
0x0, 0x9a, ...)
        github.com/alecthomas/gozmq/_obj/_cgo_defun.c:363 +0x31
github.com/alecthomas/gozmq.(*Socket).Recv(0x972c7398, 0x0, 0x0, 0x0, 0x0, ...)
        /opt/go/go-magica-web/GOPATH/src/github.com/alecthomas/gozmq/zmq_3_x.go:191 +0xdf
main.func·008()
        /opt/go/go-magica-web/go-magica-web.go:2265 +0x36
created by main.main
        /opt/go/go-magica-web/go-magica-web.go:2269 +0x8ca

goroutine 13 [IO wait]:
net.runtime_pollWait(0xb72d4d60, 0x72, 0x0)
        /usr/local/go/src/pkg/runtime/netpoll.goc:116 +0x5e
net.(*pollDesc).Wait(0x97351938, 0x72, 0xb72d3878, 0xb)
        /usr/local/go/src/pkg/net/fd_poll_runtime.go:81 +0x32
net.(*pollDesc).WaitRead(0x97351938, 0xb, 0xb72d3878)
        /usr/local/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(*netFD).Read(0x97351900, 0x9740a400, 0x400, 0x400, 0x0, ...)
        /usr/local/go/src/pkg/net/fd_unix.go:204 +0x231
net.(*conn).Read(0x9737ad38, 0x9740a400, 0x400, 0x400, 0x0, ...)
        /usr/local/go/src/pkg/net/net.go:122 +0xa8
main.ListenC(0x9737ad38, 0x97353750)
        /opt/go/go-magica-web/go-magica-web.go:1582 +0x82
created by main.main
        /opt/go/go-magica-web/go-magica-web.go:2286 +0xae7

goroutine 14 [select]:
main.(*hub).run(0x88b9530)
        /opt/go/go-magica-web/hub.go:28 +0x1b8
created by main.main
        /opt/go/go-magica-web/go-magica-web.go:2295 +0xbbf

goroutine 2759 [chan receive]:
database/sql.(*DB).connectionOpener(0x9734c640)
        /usr/local/go/src/pkg/database/sql/sql.go:574 +0x3b
created by database/sql.Open
        /usr/local/go/src/pkg/database/sql/sql.go:436 +0x1c7

goroutine 2758 [chan receive]:
database/sql.(*DB).connectionOpener(0x9734c580)
        /usr/local/go/src/pkg/database/sql/sql.go:574 +0x3b
created by database/sql.Open
        /usr/local/go/src/pkg/database/sql/sql.go:436 +0x1c7

goroutine 895 [select]:
github.com/fzzy/sockjs-go/sockjs.(*legacySession).backend(0x972d4c80)
        /opt/go/go-magica-web/GOPATH/src/github.com/fzzy/sockjs-go/sockjs/session.go:141 +0x24e
created by github.com/fzzy/sockjs-go/sockjs.(*legacySession).init
        /opt/go/go-magica-web/GOPATH/src/github.com/fzzy/sockjs-go/sockjs/session.go:133 +0x153

eax     0x0
ebx     0x6d4c
ecx     0x57bd
edx     0x6
edi     0xb766cff4
esi     0x0
ebp     0x57bd
esp     0x814fce54
eip     0xb775f424
eflags  0x202
cs      0x73
fs      0x0
gs      0x33

What version of the product are you using? On what operating system?
go version go1.2 linux/386
Ubuntu 12.04.4 LTS (32-bits)

Please provide any additional information below.

Original issue reported on code.google.com by bigras.b...@gmail.com on 18 Feb 2014 at 4:18

GoogleCodeExporter commented 9 years ago
If you provide instructions to reproduce it here (on my pc), I will 
investigate. Otherwise I don't have enough information to go by (I am not Linux 
expert either, I use Windows myself).

Alternatively ask whatever questions you have. I might be able to give you some 
suggestions.

It looks like your program received signal:

SIGABRT: abort
PC=0xb775f424
signal arrived during cgo execution

because it does not use mutexes properly:

go-magica-web: pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion 
`mutex->__data.__owner == 0' failed.

Googling I find this: 
http://stackoverflow.com/questions/1105745/pthread-mutex-assertion-error

Go does not come with pthread_mutex_lock.c file. I suspect it is part of 
stdlibs on Linux.

Alex

Original comment by alex.bra...@gmail.com on 18 Feb 2014 at 11:09