{"action":"created","issue":{"url":"https://api.github.com/repos/veandco/go-sdl2/issues/78","labels_url":"https://api.github.com/repos/veandco/go-sdl2/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/veandco/go-sdl2/issues/78/comments","events_url":"https://api.github.com/repos/veandco/go-sdl2/issues/78/events","html_url":"https://github.com/veandco/go-sdl2/issues/78","id":53528800,"number":78,"title":"Exception 0xc0000005 0x1 0x333249 0x6c7bec77 PC=0x6c7bec77 signal arrived during cgo execution","user":{"login":"brunoqc","id":24027,"avatar_url":"https://avatars.githubusercontent.com/u/24027?v=3","gravatar_id":"","url":"https://api.github.com/users/brunoqc","html_url":"https://github.com/brunoqc","followers_url":"https://api.github.com/users/brunoqc/followers","following_url":"https://api.github.com/users/brunoqc/following{/other_user}","gists_url":"https://api.github.com/users/brunoqc/gists{/gist_id}","starred_url":"https://api.github.com/users/brunoqc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunoqc/subscriptions","organizations_url":"https://api.github.com/users/brunoqc/orgs","repos_url":"https://api.github.com/users/brunoqc/repos","events_url":"https://api.github.com/users/brunoqc/events{/privacy}","received_events_url":"https://api.github.com/users/brunoqc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-06T15:56:20Z","updated_at":"2015-01-06T17:06:22Z","closed_at":null,"body":"I have this intermittent problem. Sometimes it crashes on launch.\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"runtime\"\r\n\r\n\t\"github.com/veandco/go-sdl2/sdl\"\r\n\t\"github.com/veandco/go-sdl2/sdl_ttf\"\r\n)\r\n\r\nfunc main() {\r\n\truntime.LockOSThread()\r\n\tdefer runtime.UnlockOSThread()\r\n\r\n\tttf.Init()\r\n\r\n\tfont, errOpen := ttf.OpenFont(\"Ubuntu-B.ttf\", 300)\r\n\tif errOpen != nil {\r\n\t\tpanic(errOpen)\r\n\t}\r\n\tdefer font.Close()\r\n\r\n\twindow, err := sdl.CreateWindow(\"test\", sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED,\r\n\t\t800, 600, sdl.WINDOW_SHOWN)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tdefer window.Destroy()\r\n\r\n\tsurface := window.GetSurface()\r\n\r\n\tfontSurface := font.RenderText_Shaded(\"123\", sdl.Color{R: 255, G: 165, B: 0, A: 255}, sdl.Color{R: 0, G: 0, B: 0, A: 255})\r\n\trect := sdl.Rect{surface.W/2 - fontSurface.W/2, surface.H/2 - fontSurface.H/2, 800, 800}\r\n\tfontSurface.Blit(nil, surface, &rect)\r\n\tfontSurface.Free()\r\n\r\n\tvar event sdl.Event\r\n\trunning := true\r\n\r\n\tfor running {\r\n\t\tfor event = sdl.PollEvent(); event != nil; event = sdl.PollEvent() {\r\n\t\t\tswitch t := event.(type) {\r\n\t\t\tcase *sdl.QuitEvent:\r\n\t\t\t\trunning = false\r\n\t\t\tcase *sdl.MouseMotionEvent:\r\n\t\t\t\tfmt.Printf(\"[%d ms] MouseMotion\\ttype:%d\\tid:%d\\tx:%d\\ty:%d\\txrel:%d\\tyrel:%d\\n\",\r\n\t\t\t\t\tt.Timestamp, t.Type, t.Which, t.X, t.Y, t.XRel, t.YRel)\r\n\t\t\tcase *sdl.MouseButtonEvent:\r\n\t\t\t\tfmt.Printf(\"[%d ms] MouseButton\\ttype:%d\\tid:%d\\tx:%d\\ty:%d\\tbutton:%d\\tstate:%d\\n\",\r\n\t\t\t\t\tt.Timestamp, t.Type, t.Which, t.X, t.Y, t.Button, t.State)\r\n\t\t\tcase *sdl.MouseWheelEvent:\r\n\t\t\t\tfmt.Printf(\"[%d ms] MouseWheel\\ttype:%d\\tid:%d\\tx:%d\\ty:%d\\n\",\r\n\t\t\t\t\tt.Timestamp, t.Type, t.Which, t.X, t.Y)\r\n\t\t\tcase *sdl.KeyUpEvent:\r\n\t\t\t\tfmt.Printf(\"[%d ms] Keyboard\\ttype:%d\\tsym:%c\\tmodifiers:%d\\tstate:%d\\trepeat:%d\\n\",\r\n\t\t\t\t\tt.Timestamp, t.Type, t.Keysym.Sym, t.Keysym.Mod, t.State, t.Repeat)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twindow.UpdateSurface()\r\n\t\tsdl.Delay(1000 / 30)\r\n\t}\r\n}\r\n```\r\n\r\n```\r\nException 0xc0000005 0x1 0x333249 0x6c7bec77\r\nPC=0x6c7bec77\r\nsignal arrived during cgo execution\r\n\r\ngithub.com/veandco/go-sdl2/sdl_ttf._Cfunc_SDL_free(0x8ce750)\r\n        d:/dev/go/gopath/src/github.com/veandco/go-sdl2/sdl_ttf/:44 +0x4c\r\ngithub.com/veandco/go-sdl2/sdl_ttf.(*Font).RenderText_Shaded(0xc082034018, 0x517010, 0x3, 0xff000000ff00a5ff, 0x2829a0)\r\n        d:/dev/go/gopath/src/github.com/veandco/go-sdl2/sdl_ttf/sdl_ttf.go:110 +0x11c\r\nmain.main()\r\n        D:/Dev/go/Tests/sdl2crash/sdl2.go:32 +0x24b\r\n\r\ngoroutine 17 [syscall, locked to thread]:\r\nruntime.goexit()\r\n        c:/go/src/runtime/asm_amd64.s:2232 +0x1\r\nrax     0x8ce740\r\nrbx     0x8\r\nrcx     0x6c85fb60\r\nrdx     0x333231\r\nrdi     0xc082025d00\r\nrsi     0x5bfa60\r\nrbp     0x22feb0\r\nrsp     0x22fdf0\r\nr8      0x1c00bf0e2bb52254\r\nr9      0x1c00bf0e2c420994\r\nr10     0x8c0158\r\nr11     0x280000\r\nr12     0xff\r\nr13     0x0\r\nr14     0x0\r\nr15     0x0\r\nrip     0x6c7bec77\r\nrflags  0x10293\r\ncs      0x33\r\nfs      0x53\r\ngs      0x2b\r\n```"},"comment":{"url":"https://api.github.com/repos/veandco/go-sdl2/issues/comments/68895122","html_url":"https://github.com/veandco/go-sdl2/issues/78#issuecomment-68895122","issue_url":"https://api.github.com/repos/veandco/go-sdl2/issues/78","id":68895122,"user":{"login":"jackyb","id":1069338,"avatar_url":"https://avatars.githubusercontent.com/u/1069338?v=3","gravatar_id":"","url":"https://api.github.com/users/jackyb","html_url":"https://github.com/jackyb","followers_url":"https://api.github.com/users/jackyb/followers","following_url":"https://api.github.com/users/jackyb/following{/other_user}","gists_url":"https://api.github.com/users/jackyb/gists{/gist_id}","starred_url":"https://api.github.com/users/jackyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackyb/subscriptions","organizations_url":"https://api.github.com/users/jackyb/orgs","repos_url":"https://api.github.com/users/jackyb/repos","events_url":"https://api.github.com/users/jackyb/events{/privacy}","received_events_url":"https://api.github.com/users/jackyb/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T17:06:22Z","updated_at":"2015-01-06T17:06:22Z","body":"Yes, does it help?"}}