Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
I guess you need some kind of equivalent of the good old "core dump"+gdb. –  Lohoris Dec 15 '11 at 15:33
    
Are you making any OpenGL calls yourself, or just via pyglet calls? –  Kylotan Dec 15 '11 at 16:30
    
@Lohoris well, I did use gdb once, but didn't understand what to do with it; is that all I should be doing in this case? –  EdwardTeach Dec 15 '11 at 19:11
    
@Kylotan all are pyglet calls –  EdwardTeach Dec 15 '11 at 19:12
1  
@Lohoris sounds like an answer :) If you'd like to elaborate a bit in an answer below, and/or point me to some URLs, I'll accept your answer. –  EdwardTeach Dec 16 '11 at 13:23
show 3 more comments

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.