-
Notifications
You must be signed in to change notification settings - Fork 75
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
runtime: garbage collector found invalid heap pointer #14
Comments
Thanks for reporting this issue. This looks like a valid problem that we'll need to fix. I've never run into it myself because I never tried non-zero pointer offsets. |
My understanding of C is limited but something like this seems to work: diff --git a/v2.1/gl/package.go b/v2.1/gl/package.go
index 5656428..dd2f17d 100644
--- a/v2.1/gl/package.go
+++ b/v2.1/gl/package.go
@@ -10266,6 +10266,9 @@ package gl
// static void glowVertexAttribPointer(GPVERTEXATTRIBPOINTER fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer) {
// (*fnptr)(index, size, type, normalized, stride, pointer);
// }
+// static void glowVertexAttribPointerOffset(GPVERTEXATTRIBPOINTER fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, intptr_t pointer) {
+// (*fnptr)(index, size, type, normalized, stride, (void *) pointer);
+// }
// static void glowVertexAttribPointerARB(GPVERTEXATTRIBPOINTERARB fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer) {
// (*fnptr)(index, size, type, normalized, stride, pointer);
// }
@@ -26334,6 +26337,10 @@ func VertexAttribParameteriAMD(index uint32, pname uint32, param int32) {
func VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, pointer unsafe.Pointer) {
C.glowVertexAttribPointer(gpVertexAttribPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), pointer)
}
+func VertexAttribPointerOffset(index uint32, size int32, xtype uint32, normalized bool, stride int32, pointer uintptr) {
+ C.glowVertexAttribPointerOffset(gpVertexAttribPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), (C.intptr_t)(pointer))
+}
+
func VertexAttribPointerARB(index uint32, size int32, xtype uint32, normalized bool, stride int32, pointer unsafe.Pointer) {
C.glowVertexAttribPointerARB(gpVertexAttribPointerARB, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), pointer)
} |
Ping. I guess these issues have since been dealt with, is that true @shurcooL? |
As far as I know, there was no action take to deal with this. I think I missed @Thinkofname's reply and forgot about this issue. To resolve it, we'll need a reproduce case to confirm it's still an issue, and then try the fix @Thinkofname suggested. |
Ultimately a duplicate of #80, and the relevant discussion is there, so I'm going to close this issue. |
This randomly happens when calling gl.VertexAttribPointer with an offset other than zero, in this case 6. I'm assuming its because Go expects unsafe.Pointer to be pointing to a valid address instead of an offset. Any way to fix/work around?
go version go1.4.2 linux/amd64
The text was updated successfully, but these errors were encountered: