Paul Telford wrote:
> This looks fairly easy to check for, with something like the patch below.
> This bug is easy to recreate:  start xgalaga, make sure the sound is
> working, pause the game and kill sndserver from a separate window, unpause
> and wait for/cause a sound to play, crash.  I suppose it would be enough
> to simply ignore the signal (which we don't seem to do, the above text
> must be outdated now) but checking the write() return and actually
> disabling sound feels more complete.

I can reproduce the crash and we should fix it, but it does seem that
it's a different problem than the slowdown originally described in this
bug report.

> diff -ru xgalaga-2.0.34.orig/sound.c xgalaga-2.0.34/sound.c
> --- xgalaga-2.0.34.orig/sound.c 2005-05-26 09:21:23.208840000 -0700
> +++ xgalaga-2.0.34/sound.c      2005-05-26 09:44:00.152553680 -0700
> @@ -46,6 +46,7 @@
>           return;
> 
>    signal(SIGCHLD, SIG_IGN);
> +  signal(SIGPIPE, SIG_IGN);
> 
>    if(unixSoundPath[0] == '?')  {
>        audioOK = 0;
> @@ -88,7 +89,11 @@
>    char c;
> 
>    c = k;
> -  if ((playSounds) && (audioOK)) write (soundfd, &c, sizeof (c));
> +  if ((playSounds) && (audioOK)) {
> +         if(write (soundfd, &c, sizeof (c)) == -1) {
> +                 audioOK = 0;
> +         }
> +  }
>  }

I suppose you'd also want to do the latter change in the
maybe_play_sound and kill_sound founctions..

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to