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

cgo, gdb, Go-OpenGL related bug #1262

Closed
nsf opened this issue Nov 9, 2010 · 8 comments
Closed

cgo, gdb, Go-OpenGL related bug #1262

nsf opened this issue Nov 9, 2010 · 8 comments

Comments

@nsf
Copy link

nsf commented Nov 9, 2010

Go version: release.2010-11-02, Machine: linux x86.

For some reason each Go-OpenGL app segfaults on the very beginning (doesn't enter main()
function). However, runs fine under gdb. Go-SDL works fine (just mentioning it, because
almost all Go-OpenGL apps use Go-SDL).

See the mailing list as well:
http://groups.google.com/group/golang-nuts/browse_thread/thread/e4357d10080c1aa5
@gopherbot
Copy link

Comment 1 by gith.tech:

• I believe SDL uses dlopen(), instead of "CGO_LDFLAGS=-lGL"
• I see this with nVidia but not MESA.
• Along with gdb, both strace ltrace work without a segfault.
Perhaps there is some weird obfuscation code in the nVidia GL.  What's common with gdb
and strace, a fork() ?

@adg
Copy link
Contributor

adg commented Nov 22, 2010

Comment 2:

Can you please provide a test case?
It's very hard to diagnose these issues without test cases.

@adg
Copy link
Contributor

adg commented Nov 22, 2010

Comment 3:

Status changed to WaitingForReply.

@nsf
Copy link
Author

nsf commented Nov 23, 2010

Comment 4:

Sure.
------------------------------------------------
package main
import "gl"
import "fmt"
func main() {
    fmt.Println("Hi")
    gl.Init()
}
------------------------------------------------
The most interesting part, that it doesn't even print this "Hi" line. Simply segfaults.
Runs fine under the debugger.

@gopherbot
Copy link

Comment 5 by gith.tech:

This appears to be a problem with nVidia 260 / linux 2.6.36.
Reverting to nVidia 256 / linux 2.6.34 worked for me.

@rsc
Copy link
Contributor

rsc commented Dec 16, 2010

Comment 6:

Can you try with the latest cgo and see if it makes a difference.

@nsf
Copy link
Author

nsf commented Dec 16, 2010

Comment 7:

Same thing. Works under gdb, strace, etc. Without any tools segfaults..

@rsc
Copy link
Contributor

rsc commented Jan 6, 2011

Comment 8:

The fact that reverting to nVidia 256 makes it work suggests that this is not a Go
problem.
Running under gdb or strace may affect where the stack gets mapped or may serialize the
program so that there is no actual simultaneous execution across threads.

Status changed to WontFix.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants