"Floating Point Exception" in Ubuntu 10.04
Thu, 2010-07-01 22:35
Hi guys!
I've installed Hedgewars 0.9.13-1 from the Ubuntu repositories on my Ubuntu 10.04 64 bit system.
The program doesn't start by double-klicking on its icon. No error-message. If I type "hedgewars" into the console, I get this Error-message: "Floating point exception" and the game doesn't start. Nothing else than this appears in the console.
I already tried several times to install and reinstall hedgewars and I tried to use the version of playdeb.net -> same problem.
Help me! Thanks!
keyx
k, I've got a solution!
For some reason, my pulseaudio server, who should be enabled was by default disabled (but I had got sound, strange).
I can enable it per "pulseaudio" in the console and hedgewars works. Just a workaround, I will find out how to implement pulseaudio in my Ubuntu properly.
Thanks!
keyx, my guess is that SDL was failing over to accessing the sound device directly, and, if your sound card was a cheap one that doesn't support hardware mixing, it was already locked by some other app using it.
So, yeah, you would need something to do software mixing.
Such as pulse.
Sorry, I saw you bring it up on chat, but you disconnected before I could ask you to test w/ sound disabled in Hedgewars ini file.
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
why won't pulse just go away. It wins my prize for most annoying thing ever coded.
Pit has finaly returned. FINALY.
Workaround seems to work fine, but I want this to actually be fixed. I tried compiling the latest version of libSDL[1] from source and the problem persists. I just contacted the maintainers of the SDL lib with extensive details including the line of code which causes the crash.
For those interested, the problem is on line 758 of music.c (music->fade_steps = ms/ms_per_step; ) because ms_per_step is zero. Fixing that does avoid the crash, but my sound still didn't work, so there's more to it than just that, but I'm just trying to take things one step at a time.
I hope to work with the libSDL maintainers to get their library fixed. I also want to work with the Hedgewars maintainers if there's any code which needs to be changed there. This game is great, and I want it to work straight out of the box all of the time!
[1] http://www.libsdl.org/projects/SDL_mixer/
In the meantime, here's a patch which will at least stop libSDL from crashing. It's not the best fix, and the sound still doesn't work, but at least the game will start. music.c is in the root directory of the libSDL source.
--- music.c 2010-08-06 14:01:32.664720027 -0400
+++ music.c 2010-08-10 15:28:46.913000349 -0400
@@ -755,7 +755,10 @@
music->fading = MIX_NO_FADING;
}
music->fade_step = 0;
- music->fade_steps = ms/ms_per_step;
+ if(ms_per_step != 0)
+ music->fade_steps = ms/ms_per_step;
+ else
+ music->fade_steps = ms/1000; // avoid divide by zero exception!
/* Play the puppy */
SDL_LockAudio();
@@ -1014,7 +1017,12 @@
SDL_LockAudio();
if ( music_playing) {
- int fade_steps = (ms + ms_per_step - 1)/ms_per_step;
+ int fade_steps = 1;
+ if(ms_per_step != 0)
+ fade_steps = (ms + ms_per_step - 1)/ms_per_step;
+ else
+ fade_steps = 100;
+
if ( music_playing->fading == MIX_NO_FADING ) {
music_playing->fade_step = 0;
} else {