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

panic: runtime error: cgo argument has Go pointer to Go pointer #1

Closed
agrinman opened this issue Jun 1, 2016 · 1 comment
Closed

Comments

@agrinman
Copy link

agrinman commented Jun 1, 2016

Hi Nik,

I believe as of Go1.6 there is a change to the way Go pointers can be passed to C code, which is causing the below runtime panic. The description of the change is here: https://golang.org/doc/go1.6#cgo.

One temporary fix is to turn-off this runtime check with GODEBUG=cgocheck=0, but I think it might be better to fix the issues directly in the code. I'm not sure how much work it is to fix or if the fix will sacrifice performance. What do you think?

Btw, your wrapper is awesome, thanks for creating it!


`panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]:
panic(0x4175e0, 0xc82010f460)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/Nik-U/pbc.makeUncheckedElement(0xc820116028, 0xc82010e001, 0x0, 0x346940)
/go/src/github.com/Nik-U/pbc/element.go:122 +0x15e
github.com/Nik-U/pbc.makeCheckedElement(0xc820116028, 0x0, 0x2800370, 0xc820116028)
/go/src/github.com/Nik-U/pbc/element.go:138 +0x34
github.com/Nik-U/pbc.(*Pairing).NewG1(0xc820116028, 0xc820116028)
/go/src/github.com/Nik-U/pbc/pairing.go:128 +0x39`

@Nik-U
Copy link
Owner

Nik-U commented Aug 17, 2016

Hi Alex,

Thanks for the report. I've added Go 1.6 (and Go 1.7) compatibility in d3a011d. Thankfully, no performance or interface sacrifices were required.

@Nik-U Nik-U closed this as completed Aug 17, 2016
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

No branches or pull requests

2 participants