sdl-mixer problem - unable to shut down and restart mixer - SBCL, XUbuntu 64bit

37 views
Skip to first unread message

stack9...@gmail.com

unread,
Jul 28, 2014, 6:56:09 PM7/28/14
to lispb...@googlegroups.com
Hello.  Does anyone have a problem restarting sdl-mixer after shutdown?  On my system - 64-bit xubuntu, lispbuilder-20140113-svn, running the mixer example works fine -- only once!  Attempting to restart in the same REPL will generally result in a silent system followed by a dead lockup (C-c C-c unresponsive), requiring me to shut down emacs/slime... Ugh.  

If I don't bother shutting the mixer down, I get a silent system, allowing me to work in 'batch' mode in REPL.  It does not lock up, but I have to invoke another SBCL to run the file.  Kind of like using a darned C compiler!

I would appreciate any help.

Elliott Slaughter

unread,
Jul 29, 2014, 12:34:24 AM7/29/14
to lispb...@googlegroups.com
Is this reproducible with any of the sdl-mixer demos? If there is a simple sequence of commands that reproduces it, I'll try to take a look.


--
You received this message because you are subscribed to the Google Groups "Lispbuilder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispbuilder...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict the future is to invent it." - Alan Kay

stack9...@gmail.com

unread,
Jul 29, 2014, 1:08:02 PM7/29/14
to lispb...@googlegroups.com
On my system, the stock mixer demo will work fine the first time, play samples only the second time (no music) and will lock up SBCL tight. 

I am using lispbuilder-20140113-svn (via quicklisp) and SBCL 1.2.1

Thanks, Elliott

stack9...@gmail.com

unread,
Jul 29, 2014, 1:09:23 PM7/29/14
to lispb...@googlegroups.com
Oh, the lockup happens while exiting the mixer demo the second time...

stack9...@gmail.com

unread,
Jul 29, 2014, 9:54:05 PM7/29/14
to lispb...@googlegroups.com
To clarify some more: calling the demo from REPL.  It seems that the uninitializing code leaves something dangling or does an extra free...

Luke Crook

unread,
Jul 30, 2014, 1:12:17 AM7/30/14
to lispb...@googlegroups.com
I'll take a look too. 

I wrote the lisp wrapper by default to open the library if closed, after which the library is held open and not closed again. This is because the developers of these libraries typically don't test opening/closing their libs multiple times within the same process. With languages like C this is never an issue, as the library is typically opened when the process starts, and closed just before the process ends. 

The lisp wrapper may have a bug in that the lib is actually being closed.






On Tuesday, July 29, 2014, <stack9...@gmail.com> wrote:
To clarify some more: calling the demo from REPL.  It seems that the uninitializing code leaves something dangling or does an extra free...

--

Elliott Slaughter

unread,
Aug 6, 2014, 1:20:12 AM8/6/14
to lispb...@googlegroups.com
So I repro'd on Ubuntu 14.04/SBCL 1.1.14. This appears to be two issues:

1. With (sdl-mixer-examples:mixer), when you start it the second time, you have to explicitly resume the music by pressing the M key.

2. When you exit the second time, you drop into LDB with a double free. I'm guessing you see this as a lockup because of SLIME's message model.

This may be worth creating an explicit googlecode bug for since it's taking us this long to get to a fix.

stack9...@gmail.com

unread,
Aug 6, 2014, 1:02:03 PM8/6/14
to lispb...@googlegroups.com
Thanks for the info.

2. When you exit the second time, you drop into LDB with a double free. I'm guessing you see this as a lockup because of SLIME's message model.

Is there a way to gracefully recover from this (or protect running code?)

Elliott Slaughter

unread,
Aug 7, 2014, 3:43:37 PM8/7/14
to lispb...@googlegroups.com
Crashes into LDB are hard crashes, unfortunately; they don't go through the normal condition system, and usually the whole system is hosed enough that you don't even know the state of the system at that point anyway. Typically all you get is a backtrace of hex addresses (no debug info), which leaves you to sorting out the backtrace yourself with nm or something similar.

So basically, you'll probably have to keep running in batch mode until we get a real fix.


--
You received this message because you are subscribed to the Google Groups "Lispbuilder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispbuilder...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stack9...@gmail.com

unread,
Aug 7, 2014, 4:32:19 PM8/7/14
to lispb...@googlegroups.com
Elliott, thanks.

I got both music and samples to work stably in my asteroids game (https://github.com/stacksmith/asteroids).

While in REPL, I am able to start the game, play for a while, quit (shutting down the mixer), and restart. The mixer must always be shut down (by hand if the main loop hasn't terminated, during debugging), as starting the mixer twice leads to silence forever.  I haven't experienced any crashes as in the mixer demo.  Go figure.


Elliott Slaughter

unread,
Sep 3, 2014, 10:17:15 PM9/3/14
to lispb...@googlegroups.com
Does the crash go away if you skip the body of quit-mixer (at line 93 of lispbuilder-sdl-mixer/sdl-mixer/mixer.lisp), e.g. by adding

#+disabled

to the first line? I can't test right now because I'm not at my Linux machine and can't repro on OS X (doesn't crash).


--
You received this message because you are subscribed to the Google Groups "Lispbuilder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispbuilder...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages