Skip to content
New issue

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

Fix callback handle pointers #5

Merged
merged 1 commit into from
Apr 26, 2016

Conversation

mtrmac
Copy link
Contributor

@mtrmac mtrmac commented Apr 26, 2016

Use pointers to the relevant data structures which live as long as the callbacks can be called, not pointers to local variables which go away immediately.

(This is noticeable e.g. on CentOS 7, already in go test. It is quite suprising that this has worked just fine on other platforms so far. :) )

Use pointers to the relevant data structures which live as long as the
callbacks can be called, not pointers to local variables which go away
immediately.
@proglottis proglottis merged commit c2302e1 into proglottis:master Apr 26, 2016
@proglottis
Copy link
Owner

proglottis commented Apr 26, 2016

Whoops, merged this and then realised it breaks the 1.6 cgo checks.

panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
    panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 22 [running]:
panic(0x416f680, 0xc82007c7e0)
    /usr/local/Cellar/go/1.6.1/libexec/src/runtime/panic.go:464 +0x3e6
testing.tRunner.func1(0xc8200a41b0)
    /usr/local/Cellar/go/1.6.1/libexec/src/testing/testing.go:467 +0x192
panic(0x416f680, 0xc82007c7e0)
    /usr/local/Cellar/go/1.6.1/libexec/src/runtime/panic.go:426 +0x4e9
github.com/proglottis/gpgme._cgoCheckPointer0(0x4135aa0, 0xc8200a6270, 0xc82007c7d0, 0x1, 0x1, 0x4124b60)
    ??:0 +0x4d
github.com/proglottis/gpgme.NewDataReader(0x50445d8, 0xc820060330, 0x429a818, 0x0, 0x0)
    /Users/james/Development/go/src/github.com/proglottis/gpgme/data.go:109 +0x3c8
github.com/proglottis/gpgme.TestDataNewDataReader(0xc8200a41b0)
    /Users/james/Development/go/src/github.com/proglottis/gpgme/data_test.go:70 +0xfc
testing.tRunner(0xc8200a41b0, 0x427e4e8)
    /usr/local/Cellar/go/1.6.1/libexec/src/testing/testing.go:473 +0x98
created by testing.RunTests
    /usr/local/Cellar/go/1.6.1/libexec/src/testing/testing.go:582 +0x892
exit status 2
FAIL    github.com/proglottis/gpgme 0.017s

Looking into it now.

proglottis added a commit that referenced this pull request Apr 26, 2016
This is to get around the go 1.6 CGO rules raised in #5
@mtrmac
Copy link
Contributor Author

mtrmac commented Apr 30, 2016

Sorry for not noticing that, and thanks for the fix. But see #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants