banthar / Go-SDL

Go bindings for SDL
218 stars 68 forks source link

Uncaught exception in OSX 10.8.4 when trying to run the tests #64

Open agis opened 11 years ago

agis commented 11 years ago

Doing a $ go run test.go gives the following output:

2013-09-21 23:06:54.233 test[81015:303] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1000) creating CGSWindow on line 259'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff8834fb06 __exceptionPreprocess + 198
        1   libobjc.A.dylib                     0x00007fff87ae23f0 objc_exception_throw + 43
        2   CoreFoundation                      0x00007fff8834f8dc +[NSException raise:format:] + 204
        3   AppKit                              0x00007fff90c54b49 _NSCreateWindowWithOpaqueShape2 + 655
        4   AppKit                              0x00007fff90c53340 -[NSWindow _commonAwake] + 2002
        5   AppKit                              0x00007fff90c11d82 -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 1763
        6   AppKit                              0x00007fff90c10ecf -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1568
        7   AppKit                              0x00007fff90c1089f -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
        8   libSDL-1.2.0.dylib                  0x0000000000211a8d -[SDL_QuartzWindow initWithContentRect:styleMask:backing:defer:] + 279
        9   libSDL-1.2.0.dylib                  0x000000000020f49b QZ_SetVideoMode + 1409
        10  libSDL-1.2.0.dylib                  0x0000000000206789 SDL_SetVideoMode + 907
        11  test                                0x0000000000077349 _cgo_0b5699797723_Cfunc_SDL_SetVideoMode + 28
        12  test                                0x000000000002287f runtime.asmcgocall + 95
)
libc++abi.dylib: terminate called throwing an exception
SIGABRT: abort
PC=0x7fff87f07212
signal arrived during cgo execution

github.com/banthar/Go-SDL/sdl._Cfunc_SDL_SetVideoMode(0x1e000000280, 0x1000000020, 0x0)
        github.com/banthar/Go-SDL/sdl/_obj/_cgo_defun.c:669 +0x2f
github.com/banthar/Go-SDL/sdl.SetVideoMode(0x280, 0x1e0, 0x20, 0x10, 0x0, ...)
        github.com/banthar/Go-SDL/sdl/_obj/_cgo_gotypes.go:451 +0x44
main.main()
        /Users/agis/dev/chip-8/src/github.com/banthar/Go-SDL/test/test.go:58 +0x15d

goroutine 2 [syscall]:
rax     0x0
rbx     0x6
rcx     0x7fff5fbfe1b8
rdx     0x0
rdi     0x303
rsi     0x6
rbp     0x7fff5fbfe1e0
rsp     0x7fff5fbfe1b8
r8      0x7fff76c84278
r9      0x7fff5fbfe1c0
r10     0x20000000
r11     0x206
r12     0x7fff5fbfe340
r13     0xf
r14     0x7fff76c85180
r15     0x7fff5fbfe220
rip     0x7fff87f07212
rflags  0x206
cs      0x7
fs      0x0
gs      0x0
exit status 2

I've installed sdl using brew and then Xquartz.

netpoetica commented 10 years ago

I get this same issue when trying to run SDL examples in go-gl/examples, and I have also installed SDL and SDL_image video brew.

➜ go version go1.2rc2 darwin/amd64

➜  sdl git:(master) brew info sdl
sdl: stable 1.2.15, HEAD
http://www.libsdl.org/
/usr/local/Cellar/sdl/1.2.15 (223 files, 2.1M) *
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/sdl.rb
==> Options
--universal
    Build a universal binary
--with-x11-driver
    Compile with support for X11 video driver

➜  sdl git:(master) brew info SDL_image
SDL_image: stable 1.2.12
http://www.libsdl.org/projects/SDL_image
/usr/local/Cellar/SDL_image/1.2.12 (8 files, 136K)
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/sdl_image.rb
==> Dependencies
Required: sdl
==> Options
--universal
    Build a universal binary