Comments (7)
Can you tell me what OS you are running this on and which version of Go you are using? It doesn't seem to crash on mine.
from go-sdl2.
go version go1.3 linux/amd64
I am on debian jessie/sid
from go-sdl2.
Hm..it still doesn't panic. What happens if you put, say, sdl.Delay(16) inside frame update? Does the issue still appear?
from go-sdl2.
Yes I still get the issue. updated to
go version go1.3.1 linux/amd64
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x7fe7753971c9]
runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fe7753971c9
runtime.throw(0x7df645)
/usr/lib/go/src/pkg/runtime/panic.c:520 +0x69
runtime: unexpected return pc for runtime.sigpanic called from 0x7fe7753971c9
runtime.sigpanic()
/usr/lib/go/src/pkg/runtime/os_linux.c:222 +0x3d
I cant really decipher these lines. I think signal is a SEGV seg fault, unexpected return pc? Is the crash being thrown by a system call or something? Maybe should kick this up to a go bug...
from go-sdl2.
OK so I had some assistance from the #go-nuts forum:
james4k: you will need to call runtime.LockOSThread() on whatever goroutine you are doing your GL calls on
james4k: and do all of your GL calls in that goroutine
james4k: GL maintains its state per-thread, while Go's runtime will execute its goroutines on a number of OS threads
The problem seems fixed, this "runtime.LockOSThread()" requirement probably needs to go somewhere prominent, at least until the doc is happening. Maybe in the readme?
from go-sdl2.
Thanks for finding the solution, Evan. Could you create two minimal examples (one that crashes and one that doesn't) and describe how you fixed the problem? I'll add the solution to the readme.
from go-sdl2.
Sorry about the silence, I moved cities and got a new job! I have not been able to replicate the issue on my new computer.
from go-sdl2.
Related Issues (20)
- No way to get enter key event when using sdl.WaitEvent() HOT 1
- WASI Support
- Not compatible with Go 1.21.0 HOT 7
- SDL/SDL.h: No such file or directory HOT 2
- How to ship release version HOT 4
- Surface panics on color conversions due to nonidiomatic color models HOT 4
- Windows release crashing likely because C.CString deallocated with C.SDL_free HOT 3
- Getting an errror when compiling to wasm HOT 2
- impossible type switch case: sdl.QuitEvent HOT 4
- Cannot find -lsdl2 HOT 10
- SDL_AudioStreamAvailable not correctly wrapped HOT 2
- Missing functions in gamecontroller.go HOT 6
- Readme Example Fix typo HOT 2
- Running readme example yields 30% CPU usage HOT 13
- Fails to link with musl libc HOT 1
- feature req: img.LoadSizedSVG HOT 2
- SdlSetTextureScaleMode HOT 7
- Window Doesn't Show HOT 4
- How to SDL on 64bit Windows Instructions Unclear
- (suggestion) Convert sdl.Rect Fields from int32 to int HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sdl2.