Strange bug after recent Go release (cgo, Go-OpenGL, gdb)

14 views
Skip to first unread message

nsf

unread,
Oct 27, 2010, 10:35:08 PM10/27/10
to golan...@googlegroups.com
I've tried to compile my 'gotris' app as usual after the release. And
well, it turns out that every Go-OpenGL based app (Go-SDL works fine)
segfaults.

The most interesting fact here is the following: it runs just fine
under gdb!

See shell log:
---------------------------------------------------------------------
[nsf @ gotris]$ ./gotris
Segmentation fault

[nsf @ gotris]$ gdb ./gotris
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html> This is free software: you are free
to change and redistribute it. There is NO WARRANTY, to the extent
permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/nsf/projects/waytogo/gotris/gotris...
warning: Loadable segment ".interp" outside of ELF segments
done.
(gdb) run
Starting program: /home/nsf/projects/waytogo/gotris/gotris

Program exited normally.
(gdb) quit
---------------------------------------------------------------------

I've tried inserting fmt.Println as the usual way of debugging weird
errors in Go, but it doesn't print anything, e.g.:

func main() {
fmt.Println("hi")
...
}

Doesn't show anything. There are no 'init' functions around as well.
So, I believe the bug is somewhere in the runtime and it is somehow
connected with OpenGL, cgo and debuggers.

Giving the fact that there was some effort regarding improving gdb
support, probably that's the source of the bug.

andy

unread,
Nov 8, 2010, 1:22:48 PM11/8/10
to golang-nuts
Have you had any luck tracing the source of the segmentation faults?
I am experiencing the exact same thing (Go-OpenGL programs run fine in
gdb but segfault when run directly).

nsf

unread,
Nov 8, 2010, 8:13:26 PM11/8/10
to andy, golang-nuts
On Mon, 8 Nov 2010 10:22:48 -0800 (PST)
andy <andy....@gmail.com> wrote:

> Have you had any luck tracing the source of the segmentation faults?
> I am experiencing the exact same thing (Go-OpenGL programs run fine in
> gdb but segfault when run directly).

Nope. I'm too lazy to fix Go's runtime bugs again. Hopefully Go devs
will do something about it.

nsf

unread,
Nov 8, 2010, 10:21:32 PM11/8/10
to andy, golang-nuts
Reply all
Reply to author
Forward
0 new messages