mattn / go-oci8

Oracle driver for Go using database/sql
https://mattn.kaoriya.net/
MIT License
630 stars 212 forks source link

go 1.11.1 with go-oci8,oracle 11.2 instance client on rhel6.9x64 crashed! #307

Closed eyeits closed 5 years ago

eyeits commented 5 years ago

fatal error: unexpected signal during runtime execution [signal SIGSEGV: segmentation violation code=0x1 addr=0x5 pc=0x7ff7f8562d25]

runtime stack: runtime.throw(0x116b537, 0x2a) /alphawolf/code/linux/go/src/runtime/panic.go:608 +0x72 runtime.sigpanic() /alphawolf/code/linux/go/src/runtime/signal_unix.go:374 +0x2f2

goroutine 19966 [syscall]: runtime.cgocall(0xeb47d0, 0xc007195760, 0x29) /alphawolf/code/linux/go/src/runtime/cgocall.go:128 +0x5e fp=0xc007195728 sp=0xc0071956f0 pc=0x41001e github.com/mattn/go-oci8._Cfunc_WrapOCIParamGet(0x0, 0x7ff700000004, 0x7ff7d80b12d8, 0x2, 0x0, 0x0) _cgo_gotypes.go:1112 +0x4d fp=0xc007195760 sp=0xc007195728 pc=0xa1620d github.com/mattn/go-oci8.(OCI8Rows).ColumnTypeScanType.func1(0x0, 0x4, 0x7ff7d80b12d8, 0xc000000002, 0x0, 0x0) /alphawolf/code/go/src/github.com/mattn/go-oci8/rows.go:426 +0xa4 fp=0xc0071957b0 sp=0xc007195760 pc=0xa25924 github.com/mattn/go-oci8.(OCI8Rows).ColumnTypeScanType(0xc00050c780, 0x1, 0xc00050c780, 0x7ff7f052a180) /alphawolf/code/go/src/github.com/mattn/go-oci8/rows.go:426 +0x6f fp=0xc007195908 sp=0xc0071957b0 pc=0xa1d75f database/sql.rowsColumnInfoSetupConnLocked(0x1298da0, 0xc00050c780, 0xc004ed1e20, 0x2, 0x2) /alphawolf/code/linux/go/src/database/sql/sql.go:2841 +0x170 fp=0xc007195990 sp=0xc007195908 pc=0x510880 database/sql.(Rows).ColumnTypes(0xc0059d2600, 0x0, 0x0, 0x0, 0x0, 0x0) /alphawolf/code/linux/go/src/database/sql/sql.go:2769 +0xf3 fp=0xc0071959d0 sp=0xc007195990 pc=0x510503 alphawolf.com/eyeits/impls.(DbClient).GetRowsData(0xc001d30580, 0xc0059d2600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /alphawolf/code/go/src/alphawolf.com/eyeits/impls/dbclient.go:272 +0xf5 fp=0xc007195be8 sp=0xc0071959d0 pc=0xe12b95 alphawolf.com/eyeits/impls.(DbClient).Execute(0xc001d30580, 0xc0299720c0, 0xbc, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /alphawolf/code/go/src/alphawolf.com/eyeits/impls/dbclient.go:163 +0x2e4 fp=0xc007195ca8 sp=0xc007195be8 pc=0xe11394 alphawolf.com/eyeits/impls.(DbConn).run(0xc002231730, 0x0) /alphawolf/code/go/src/alphawolf.com/eyeits/impls/dbconn.go:149 +0x3d9 fp=0xc007195fd0 sp=0xc007195ca8 pc=0xe16a49 runtime.goexit() /alphawolf/code/linux/go/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc007195fd8 sp=0xc007195fd0 pc=0x4676b1 created by alphawolf.com/eyeits/impls.(*DbConn).Start /alphawolf/code/go/src/alphawolf.com/eyeits/impls/dbconn.go:77 +0x1d0

MichaelS11 commented 5 years ago

Could you please provide SQL and simple code to reproduce this?

Also, are you running the newest version of go-oci8?

eyeits commented 5 years ago

Has been running for nearly a month, SQL is more but more fixed, crashed once today, unable to locate specific sql, oci8 is about a month ago github version.

MichaelS11 commented 5 years ago

Suggest upgrading to newest go-oci8 and seeing if it happens again. Too much has changed over last month to find the issue otherwise.

eyeits commented 5 years ago

Thank you for your timely reply. I'll update OCI8 and try again.

awssee commented 5 years ago

I'm using the latest version of go-oci8. Always crush when use goroutines. Am I using it correctly?

Oracle 11.2.0.4.0 - 64bit & Win 10 64bit.

main.txt log.txt

MichaelS11 commented 5 years ago

@eyeits Can this be closed?

MichaelS11 commented 5 years ago

@awssee Suggest Googling "golang sql tutorial". If you are still having issues after that, please open your own issue.

awssee commented 5 years ago

Found the problem. No longer crash after move sql.Open to main function. Thanks @MichaelS11