GithubHelp home page GithubHelp logo

Panic from renderer.DrawPoint about go-sdl2 HOT 7 CLOSED

veandco avatar veandco commented on July 16, 2024
Panic from renderer.DrawPoint

from go-sdl2.

Comments (7)

aqiank avatar aqiank commented on July 16, 2024

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.

EvanTheB avatar EvanTheB commented on July 16, 2024

go version go1.3 linux/amd64
I am on debian jessie/sid

from go-sdl2.

aqiank avatar aqiank commented on July 16, 2024

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.

EvanTheB avatar EvanTheB commented on July 16, 2024

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.

EvanTheB avatar EvanTheB commented on July 16, 2024

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.

aqiank avatar aqiank commented on July 16, 2024

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.

EvanTheB avatar EvanTheB commented on July 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.