Comments (6)
Update / FYI:
We executed our application (which uses this module) with the -gcflags=all=-d=checkptr
arguments, which reported two issues with unsafe pointers. One in initDriver
in driver.go and one in Conn.setAutoCommitAttr
in tx.go.
By applying the changes from asifjalil/cli@2598d7f into a local fork of this module, we got rid of the unsafe pointer warnings. Our application builds and runs fine with the modified go_ibm_db fork, but since the fatal error: invalid pointer found on stack
error is very rare we'll need much more testing before we can say for sure it solved our problems.
from go_ibm_db.
@eriklupander Could you please provide script/steps to reproduce this issue would be helpful. Thanks.
from go_ibm_db.
Hi,
the actual error with fatal error: invalid pointer found on stack
is very hard to reproduce, it happens so rarely I cannot really create a program that certainly would reproduce the problem.
However, you can easily check the go_ibm_db module's codebase for bad pointer usage by entering the /testdata folder and run:
go run -gcflags=all=-d=checkptr main.go
This results in (truncated) running locally on my Mac:
fatal error: checkptr: pointer arithmetic computed bad pointer value
goroutine 1 [running, locked to thread]:
runtime.throw({0x10012a140?, 0x1000cfe40?})
/usr/local/opt/go/libexec/src/runtime/panic.go:1047 +0x5d fp=0xc000066c38 sp=0xc000066c08 pc=0x10003491d
runtime.checkptrArithmetic(0x1?, {0x0?, 0x1001f0000?, 0x10034a9a8?})
/usr/local/opt/go/libexec/src/runtime/checkptr.go:52 +0xbb fp=0xc000066c68 sp=0xc000066c38 pc=0x10000919b
github.com/ibmdb/go_ibm_db.initDriver()
/Users/<username>/golang/pkg/mod/github.com/ibmdb/[email protected]/driver.go:37 +0xb2 fp=0xc000066ce0 sp=0xc000066c68 pc=0x1000c6952
github.com/ibmdb/go_ibm_db.init.0()
/Users/<username>/golang/pkg/mod/github.com/ibmdb/[email protected]/driver.go:62 +0x3f fp=0xc000066d20 sp=0xc000066ce0 pc=0x1000c6b9f
runtime.doInit(0x1001e78a0)
from go_ibm_db.
@eriklupander
We are seeing the checkptr issue because this is a new feature added in Go 1.14
-d=checkptr as a compile-time option for adding instrumentation to check that Go code is following unsafe.Pointer safety rules dynamically. This can be disabled with -gcflags=all=-d=checkptr=0.
go run -gcflags=all=-d=checkptr=0 main.go
from go_ibm_db.
Thanks for your answer.
The issue is that the code in driver.go and tx.go seems to be incorrect given that the checkptr check detects an issue. Turning off the checkptr check doesn't solve the root issue which is that we're getting those "invalid pointer found on stack" panics.
After applying the same fixes (in our local fork of this module) as in asifjalil/cli@2598d7f we have not seen any more panics and the checkptr check runs without complaining.
from go_ibm_db.
Fix for this issue has been delivered using PR #215. Closing the issue now. Thanks.
from go_ibm_db.
Related Issues (20)
- The gbk encoded Chinese field may be truncated when read in the utf8 operating environment HOT 1
- SQL_DECIMAL type uses comma as separator, not period, so it can't convert to float64 HOT 5
- [CRITICAL] - double byte characters are truncated for CHAR columns HOT 1
- Driver support sql.Named or not? HOT 2
- DECIMAL Precision is lost by binding variables by inserting string HOT 4
- Get Clob CLI0131E Invalid string or buffer lengt HOT 2
- Does go_ibm_db support informix HOT 1
- Support go_ibm_db driver with UBI 9 and openssl 3.0 HOT 6
- Adding Dynamic Cursor Functionalities HOT 1
- Add env var to override cli driver download url
- DB2 Connection TCP/IP Error HOT 13
- fatal error: 'sqlcli1.h' file not found on macOS HOT 1
- fatal error: 'sqlcli1.h' file not found on macOS HOT 2
- Dockerfile issue HOT 14
- Golang DB2 driver issue HOT 1
- The go_ibm_db driver cannot be registered sql: unknown driver "go_ibm_db" (forgotten import?) HOT 7
- Decimal value by instering as string BUG HOT 4
- How to use this in a makefile for CI/CD (sqlcli1.h: No such file or directory) HOT 7
- @akhilravuri1 @vmathur12 @bimalkjha I am facing the same issue. what should I do? I an using alpine go. HOT 1
- Error Executing Go Program: SQLDriverConnect: {HY000} [IBM][CLI Driver] SQL1042C An unexpected system error occurred. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go_ibm_db.