How to debug pyglet/opengl bus errors
-
I'm using pyglet for game development, and sometimes encounter "bus errors". They are not consistently repeatable, and whenever I try to do simple debugging (eg move/remove variables, etc), the errors will eventually disappear entirely. I feel like I am encountering the notorious "heisenbug" class of errors. Intuitively, I feel like the problem is likely due to pyglet/opengl/video card interaction, but of course this is only a hunch. So my question is: how do I debug this kind of problem?
-
Answer:
The most straightforward thing to do is to run your game through a debugger. pdb is python's default debugger, but IIRC there are good alternatives, such as bpython. Once an error happens, you'll be in the python's console and be able to debug the problem. Since a "bus error" is, unless I'm not mistaken, something similar to a good old "segmentation fault", I guess you could instead somehow have it drop a core dump and analyze that, which is a less invasive method than running through a debugger... but unless you find quick and easy instruction about how to do that, I wouldn't bother.
EdwardTeach at Game Development Visit the source
Related Q & A:
- How to debug a core file without debug symbols?Best solution by Stack Overflow
- How to debug an HTML page on mobile?Best solution by msdn.microsoft.com
- How to debug HTTP request?Best solution by Server Fault
- How to debug chrome manifest.json?Best solution by Super User
- How to debug subsequent request in Phpstorm?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.