Page 1 of 1

Crash on exit [Mac OS X]

Posted: Thu Oct 20, 2011 8:21 pm
by Teddy
Hi everybody

I think it's an already well known bug, but I just wanted to ask, whether my workaround I found for this is legal or not.
So, the problem is, that Orxonox crashes on Mac OS X every time you want to end it the normal way (via menu) and not with Command-Q.
As I run through this with the debugger I found out, that it somehow hangs up, while performing the alutExit() command.
So I asked my friend google what the problem could be and I found out that alutInit and alutExit aren't really necessary, if you handle the initialization yourself (what's being done in Orxonox).
After removing alutInitWithoutContext(NULL, NULL) and alutExit() in the SoundManager.cc file, it didn't crash anymore and I could exit the game with the menu.

So, is it legal to remove these functions or is there anything else that could make alutExit crash?

Thx for your reply
Teddy

Re: Crash on exit [Mac OS X]

Posted: Thu Oct 20, 2011 10:12 pm
by x3n
I cannot answer your question directly, but I remember that we had some trouble with sound on mac anyway, so it might well be possible that this is a known problem. Since this is probably not a new issue, you could try to see if it also happens in the (old) mac_osx2 branch.

After all you could just commit it and we test it on our systems (linux, windows) and see if it works.

Re: Crash on exit [Mac OS X]

Posted: Fri Oct 21, 2011 3:09 pm
by Teddy
The mac_osx2 branch does crash at the same line of code.
I commited my change and I hope it won't crash on the other systems.

Re: Crash on exit [Mac OS X]

Posted: Sat Oct 22, 2011 9:27 am
by x3n
I tested it on Windows: It seems to work (at least I hear sound and it doesn't crash), but I get a warning during startup of Orxonox:
Status: Loading sound
Warning (internal): [sound] MIME Type retrieval failed: The operation was invalid in the current ALUT state
I have yet to test it on Linux... actually I compiled it yesterday, but then I forgot to run it :D

Re: Crash on exit [Mac OS X]

Posted: Sat Oct 22, 2011 1:26 pm
by x3n
Update: The same behavior on Linux (some Tardis-like box at ETH)

Re: Crash on exit [Mac OS X]

Posted: Sat Oct 22, 2011 1:31 pm
by Teddy
Well, I get this warning too, but at least it doesn't crash anymore.
I also got an email from Reto Grieder telling me to use

Code: Select all

#if !defined(ORXONOX_PLATFORM_APPLE)
#endif
instead of just normally outcommenting the whole thing and I just did so.

Anyway, thx for testing :)

Re: Crash on exit [Mac OS X]

Posted: Sat Oct 22, 2011 1:34 pm
by x3n
Yeah I just noticed your last commit, works fine. Thanks!

Re: Crash on exit [Mac OS X]

Posted: Mon Oct 24, 2011 4:07 am
by 1337
Just to add my mustard:
thx Teddy

(proverbs are so funny when translated literally...)

Re: Crash on exit [Mac OS X]

Posted: Tue Oct 25, 2011 8:10 am
by x3n
Actually we should have a look into this warning because simply ignoring it might be wrong. And if we can fix it, we could also remove the #if again. Since you changed the initialization of alut, we may have to call another function to allow the MIME type retrieval.

Re: Crash on exit [Mac OS X]

Posted: Tue Oct 25, 2011 1:15 pm
by 1337
I totally agree.
However last time I tried to fix this (or something very similar, it's been a while) with Kevin, we never got on a green twig after hours.
There was more to it though, I just don't remember anymore. And of course, we didn't write it down either...