{"action":"created","issue":{"url":"https://api.github.com/repos/sbinet/go-clang/issues/17","repository_url":"https://api.github.com/repos/sbinet/go-clang","labels_url":"https://api.github.com/repos/sbinet/go-clang/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/sbinet/go-clang/issues/17/comments","events_url":"https://api.github.com/repos/sbinet/go-clang/issues/17/events","html_url":"https://github.com/sbinet/go-clang/issues/17","id":138526115,"number":17,"title":"Go 1.6 - panic: runtime error: cgo argument has Go pointer to Go pointer","user":{"login":"dzan","id":342674,"avatar_url":"https://avatars.githubusercontent.com/u/342674?v=3","gravatar_id":"","url":"https://api.github.com/users/dzan","html_url":"https://github.com/dzan","followers_url":"https://api.github.com/users/dzan/followers","following_url":"https://api.github.com/users/dzan/following{/other_user}","gists_url":"https://api.github.com/users/dzan/gists{/gist_id}","starred_url":"https://api.github.com/users/dzan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzan/subscriptions","organizations_url":"https://api.github.com/users/dzan/orgs","repos_url":"https://api.github.com/users/dzan/repos","events_url":"https://api.github.com/users/dzan/events{/privacy}","received_events_url":"https://api.github.com/users/dzan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"assignees":[{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-03-04T17:01:01Z","updated_at":"2016-09-04T01:53:35Z","closed_at":null,"body":"Hi,\r\n\r\nhttps://github.com/sbinet/go-clang/blob/master/cursor.go#L798\r\n\r\nit seems like this line causes issues when passed a closure if building with go 1.6. Using `GODEBUG=cgocheck=0` when running works but that's not really a good idea. Passing it a closure is the only way to actually pass arguments to your visitor I think, e.g.\r\n\r\n````go\r\n// collectMatchKind collects all or one element name(s) in the sub AST-tree rooted at\r\n// the provided cursor.\r\nfunc collectMatchKind(entityCursor clang.Cursor, kind clang.CursorKind,\r\n        collectAll bool) (names []string) {\r\n\r\n        // Invoke the visitor with this closure.\r\n        entityCursor.Visit(func(cursor, parent clang.Cursor) (\r\n                status clang.ChildVisitResult) {\r\n\r\n                if cursor.Kind() == kind {\r\n                        names = append(names, cursor.DisplayName())\r\n                        if !collectAll {\r\n                                return clang.CVR_Break\r\n                        }\r\n                }\r\n                return clang.CVR_Continue\r\n        })\r\n        return // named\r\n}\r\n````\r\n\r\n````\r\npanic: runtime error: cgo argument has Go pointer to Go pointer\r\n\r\ngoroutine 1 [running]:\r\npanic(0x42247c0, 0xc82000eae0)\r\n        /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6\r\ngithub.com/sbinet/go-clang._cgoCheckPointer0(0x41c8c80, 0xc82002c050, 0xc82000ead0, 0x1, 0x1, 0xc82002c048)\r\n        ??:0 +0x4d\r\ngithub.com/sbinet/go-clang.Cursor.Visit(0xb, 0x6e24080, 0x1, 0x6095c30, 0xc820014ec0, 0x4236f20)\r\n        /Users/dzan/Source/go/src/github.com/sbinet/go-clang/cursor.go:798 +0x12f\r\nmain.collectMatchKind(0xb, 0x6e24080, 0x1, 0x6095c30, 0x28, 0x0, 0x0, 0x0)\r\n````"},"comment":{"url":"https://api.github.com/repos/sbinet/go-clang/issues/comments/244579634","html_url":"https://github.com/sbinet/go-clang/issues/17#issuecomment-244579634","issue_url":"https://api.github.com/repos/sbinet/go-clang/issues/17","id":244579634,"user":{"login":"doppioandante","id":491850,"avatar_url":"https://avatars.githubusercontent.com/u/491850?v=3","gravatar_id":"","url":"https://api.github.com/users/doppioandante","html_url":"https://github.com/doppioandante","followers_url":"https://api.github.com/users/doppioandante/followers","following_url":"https://api.github.com/users/doppioandante/following{/other_user}","gists_url":"https://api.github.com/users/doppioandante/gists{/gist_id}","starred_url":"https://api.github.com/users/doppioandante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doppioandante/subscriptions","organizations_url":"https://api.github.com/users/doppioandante/orgs","repos_url":"https://api.github.com/users/doppioandante/repos","events_url":"https://api.github.com/users/doppioandante/events{/privacy}","received_events_url":"https://api.github.com/users/doppioandante/received_events","type":"User","site_admin":false},"created_at":"2016-09-04T01:53:35Z","updated_at":"2016-09-04T01:53:35Z","body":"Hello, any update on this? How can I work around this?\r\nIs it difficult to fix?"}}
{"actor":{"display_login":"doppioandante"}}