We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Fail message:
fatal error: runtime: C malloc failed _cgo_gotypes.go:202 ... github.com/mattn/go-sqlite3._Cfunc_CString({0xc00004f130, 0x4a}) _cgo_gotypes.go:202 +0x1d2 fp=0xc000e663d8 sp=0xc000e662c8 pc=0x101ac2a72 github.com/mattn/go-sqlite3.(*SQLiteDriver).Open(0xc0008eaf60, {0xc00004f130, 0x4a}) /Users/xhd2015/Projects/gopath/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3.go:1456 +0x2a5e fp=0xc000e66920 sp=0xc000e663d8 pc=0x101af06be database/sql.dsnConnector.Connect(...) /Users/xhd2015/.xgo/go-instrument/go1.21.7_Us_xh_in_go_096be049/go1.21.7/src/database/sql/sql.go:758
The line of code: name := C.CString(dsn).
name := C.CString(dsn)
After comparing xgo v1.0.26 with xgo v1.0.25, and do some bisect, found this is related to the new introduced --filepath:
fileValue := funcDecl.File --> v1.0.26 fileValue := funcDecl.FileSyntax.Pos().RelFilename() --> v1.0.25
The actual fileValue for this package.
The stack trace shows that the file holding cgo types is _cgo_gotypes.go.
_cgo_gotypes.go
And by inserting a debug snippet into the go compiler:
relFile := f.Pos().RelFilename() trimFile := TrimFilename(f.Pos().Base()) pkgPath := xgo_ctxt.GetPkgPath() exec.Command("bash", "-c", fmt.Sprintf("echo 'pkg=%s relFile=%s trimFile=%s' >> /tmp/debug.log", pkgPath, relFile, trimFile)).Run()
The log shows:
pkg=github.com/mattn/go-sqlite3 relFile=/var/folders/y8/kmfy7f8s5bb5qfsp0z8h7j5m0000gq/T/go-build1192418818/b174/_cgo_gotypes.go trimFile=_cgo_gotypes.go pkg=github.com/mattn/go-sqlite3 relFile=/var/folders/y8/kmfy7f8s5bb5qfsp0z8h7j5m0000gq/T/go-build1192418818/b174/_cgo_import.go trimFile=_cgo_import.go
Could be possibly introduced the difference between relFile and trimFile. xgo v1.0.26: use trimFile xgo v1.0.25: use relFile
relFile
trimFile
The text was updated successfully, but these errors were encountered:
The cgo names:
_Cgo_ptr _Cgo_use _cgoCheckResult _cgo_runtime_gobytes _cgoCheckPointer _cgo_runtime_gostring _cgoexp_accf84c05a34_callbackTrampoline _cgo_cmalloc
We should add a rule: if a function starts with _, we shoud skip it.
Sorry, something went wrong.
workaround cgo filenames, see #80
a9abdb2
5dfbde8
6ab4a77
ca47e34
This golang issue may be related: golang/go#34968
Searching google: go "runtime: C malloc failed"
No branches or pull requests
Fail message:
fatal error: runtime: C malloc failed _cgo_gotypes.go:202 ... github.com/mattn/go-sqlite3._Cfunc_CString({0xc00004f130, 0x4a}) _cgo_gotypes.go:202 +0x1d2 fp=0xc000e663d8 sp=0xc000e662c8 pc=0x101ac2a72 github.com/mattn/go-sqlite3.(*SQLiteDriver).Open(0xc0008eaf60, {0xc00004f130, 0x4a}) /Users/xhd2015/Projects/gopath/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3.go:1456 +0x2a5e fp=0xc000e66920 sp=0xc000e663d8 pc=0x101af06be database/sql.dsnConnector.Connect(...) /Users/xhd2015/.xgo/go-instrument/go1.21.7_Us_xh_in_go_096be049/go1.21.7/src/database/sql/sql.go:758
The line of code:
name := C.CString(dsn)
.After comparing xgo v1.0.26 with xgo v1.0.25, and do some bisect, found this is related to the new introduced --filepath:
The actual fileValue for this package.
The stack trace shows that the file holding cgo types is
_cgo_gotypes.go
.And by inserting a debug snippet into the go compiler:
The log shows:
Could be possibly introduced the difference between
relFile
andtrimFile
.xgo v1.0.26: use trimFile
xgo v1.0.25: use relFile
The text was updated successfully, but these errors were encountered: