Python crashing after libaudioverse.shutdown

11 views
Skip to first unread message

Антон

unread,
May 26, 2016, 2:56:13 PM5/26/16
to libaudioverse
Hi,
I'm using Libaudioverse in a game.
The game itself runs fine, however when it exits Python crashes with the unhelpful "Python has stopped working" error.
According to my logs, it crashes after pyglet.app.exit is called (it's called right after libaudioverse.shutdown), so I'm guessing Python crashes when it's supposed to quit.
Is there some kind of logging facility in libaudioverse I could use to help track this crash (I'm pretty sure Libaudioverse is causing it) down?
Thanks.

Christopher Toth

unread,
May 26, 2016, 3:00:50 PM5/26/16
to libaud...@camlorn.net
Can you remove LAV completely from your game and then test?
The fact that the game runs until the destructive exit call makes me think that something else is scuffed up.
If I remember correctly, LAV will take advantage of Python logging automatically, and so if you're using the standard Python logging facility then you should get LAV log output intermixed with your log.
If none of this helps, feel free to post the code and I'll take a glance.
   - Q
--
You received this message because you are subscribed to the Google Groups "libaudioverse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libaudiovers...@camlorn.net.
To post to this group, send email to libaud...@camlorn.net.
To view this discussion on the web visit https://groups.google.com/a/camlorn.net/d/msgid/libaudioverse/139531d6-643f-4ca4-a3fc-58c23995a26c%40camlorn.net.

Austin Hicks

unread,
May 26, 2016, 4:07:12 PM5/26/16
to libaud...@camlorn.net
Yes, it should already be hooked into the Python logging.  You need to turn the level up to debug, if you haven't.  I must confess that I don't use the Python logging stuff often enough to quote this code offhand, but I can help you figure it out if necessary.

First thing is first. Which version are you using? 0.8.x or the 0.9 alphas?

I suspect that you're probably mistakenly using Libaudioverse after shutdown is called.  If the crash happens after shutdown is called, Libaudioverse should be completely and entirely dead.  Do you use __del__ anywhere?  there may very well be a bug, but we need to rule this sort of thing out first.

Does it always happen without fail?

It is probably best to call libaudioverse.initialize() before pyglet.app.run() and libaudioverse.shutdown() *after* pyglet.app.exit().  This may fix it in your case.  If it does, that doesn't mean there isn't a bug.  But initializing strictly before and shutting down strictly after the event loop helps make sure that you're not mistakenly calling in after shutdown.

Calling shutdown twice may also currently be buggy, so check that.  You must never call shutdown more times than you call initialize (there are good use cases for multiple initializations, but that's neither here nor there).

If none of these fix it, then I probably need to get a hold of your project so I can look at it under a debugger.  It is my experience that 99% of people are not set up to do this for me, and the setup process takes literally half a day or more (thank you, Microsoft!).

Anton Shusharin

unread,
May 27, 2016, 2:06:14 AM5/27/16
to libaud...@camlorn.net
Yeah, turns out this wasn't Libaudioverse.

I was using pywin32 to get information from the user, and when I commented it out it stopped crashing.

Looks like I'll have to write custom virtual gui widgets now.

Chris Norman

unread,
May 27, 2016, 7:28:37 AM5/27/16
to libaud...@camlorn.net

Ooh, when you do, if you fancy sharing the GUI code I would love to have a crack with it!!


It's something I've been thinking about (I have menus, but I'm putting off text boxes and stuff until I can think of something better).


Cheers,

Austin Hicks

unread,
May 27, 2016, 9:37:03 AM5/27/16
to libaud...@camlorn.net
You could just use Wx, but you'll have to duplicate some or all of the Pyglet event handling.  No matter how you slice it, you give up something for accessible controls.  Unfortunately this is true of all the languages I've looked at.  Either you get something optimized for games and don't even have a basic input box without effort and all the screen reader keys for things like spell current menu item don't work, or you get something optimized for Gui and have to reinvent event handling.

If you're not blind or writing games for the blind, then just paint it with OpenGL.  On account that you're not and most sighted people would, I'm assuming that you are.  Also this library hasn't really hit the sighted users yet.

I might or might not do something about this in the long run.  I've thought about it a bit, but it's not a small project and a library for language X game programmers who are blind would have so few users as to be laughable.  Unless it's BGT (in which you can't, even if you wanted to).  SO I probably won't.  Duplicating the Pyglet event handling on top of Wx is the path I'll take, if I ever do a game in Python (or at all. Libaudioverse is more fun).  Duplicating it isn't that hard, probably only a few hundred lines.

I wouldn't wish writing a GUI with Pywin32 directly on my worst enemy.
Reply all
Reply to author
Forward
0 new messages