breaks go 1.6 cgo pointer rules
Bug #1535157 reported by
Michael Hudson-Doyle
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
go-unityscopes |
Fix Released
|
High
|
James Henstridge |
Bug Description
Several tests fail with Go 1.6 with "Panic: runtime error: cgo argument has Go pointer to Go pointer", which is talking about the rules described here: http://
All of the panics seem to be at this call:
http://
but I certainly don't know if there are more of them hiding.
(this bug is at least part of why unity-scopes-snappy ftbfs with the go 1.6 beta2 package I made, as seen at https:/
Related branches
lp:~jamesh/go-unityscopes/go-1.6-compat
- dobey (community): Approve
-
Diff: 851 lines (+176/-121)22 files modifiedactivationresponse.cpp (+5/-5)
activationresponse.go (+1/-1)
childscope.cpp (+3/-4)
childscope.go (+2/-3)
column_layout.cpp (+3/-9)
column_layout.go (+1/-6)
department.cpp (+7/-13)
department.go (+12/-4)
helpers.cpp (+15/-3)
helpers.go (+49/-0)
helpers.h (+5/-1)
metadata.cpp (+7/-8)
metadata.go (+7/-7)
query.cpp (+3/-3)
query.go (+5/-5)
reply.cpp (+8/-10)
reply.go (+6/-7)
result.cpp (+2/-2)
result.go (+2/-3)
shim.cpp (+3/-2)
shim.h (+29/-24)
unityscope.go (+1/-1)
Changed in go-unityscopes: | |
assignee: | nobody → James Henstridge (jamesh) |
importance: | Undecided → High |
status: | New → In Progress |
Changed in go-unityscopes: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
What we want to do is pass a string down to the C/C++ wrapper without copying the data: the APIs don't take C strings, so we'd need to make yet another copy if using C.CString(), and would also need to deal with memory management of that copy.
The function doesn't hold a reference to the memory past when it returns.