emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

infinite loop in alsa_write


From: Andrea Russo
Subject: infinite loop in alsa_write
Date: Tue, 06 Mar 2007 01:30:25 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux)

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the address@hidden mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

If I type `M-: (play-sound-file "/usr/share/sounds/gaim/receive.wav")
<RET>'

Emacs enters an infinite loop in the C function `alsa_write'.

I attacched the `bt full' output.

>From what I have seen, the infinite loop happens because the condition
in the while loop at line 1210 of src/sound.c is never false:

  while (nwritten < nbytes)
    {
      err = snd_pcm_writei (p->handle,
                            buffer + nwritten,
                            (nbytes - nwritten)/fact);
      if (err < 0)...
      else
        nwritten += err * fact;
    }

As it can be seen from the backtrace, the value of variable `err' is 0
and this happen for every iteration of the loop; so the last
expression of the loop becomes always:

        nwritten += 0 * fact;

Given that the value of `nwritten' is 468 and the value of `nbytes' is
470, the loop condition never becomes false.

I think the reason that makes `snd_pcm_writei' returns 0 is that its
third argument, the expression `(nbytes - nwritten)/fact' being passed
as a `snd_pcm_uframes_t' type, which is really an unsigned long, gives
a result of 0.

Here is also the content of the local variable `p':

(gdb) print *p
$2199 = {
  handle = 0x872ac50,
  hwparams = 0x0,
  swparams = 0x0,
  period_size = 470
}

I hope this is enough information.  If not, I am willing to
investigate further under your guidance.

Thanks,
Andrea Russo.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/local/share/emacs/22.0.94/etc/DEBUG for instructions.


In GNU Emacs 22.0.94.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2007-03-02 on onosendai
X server distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--without-toolkit-scroll-bars' '--with-gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Debugger

Minor modes in effect:
  recentf-mode: t
  icomplete-mode: t
  gud-tooltip-mode: t
  which-function-mode: t
  iswitchb-mode: t
  desktop-save-mode: t
  jabber-activity-mode: t
  display-battery-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
h h q s s l s n n n n n n n n C-c w W q q C-x r j g
C-M-a C-M-e C-M-a C-x C-a C-s C-x C-a C-s C-x C-a C-s
C-x C-a C-s C-x C-a C-s C-x C-a C-s C-x C-a C-s C-x
C-a C-s C-x C-a C-s C-x C-a C-s C-x C-a C-s C-x C-a
C-s C-x C-a C-d C-x C-a C-r M-! M-p RET C-x o C-x o
C-x o b a c k t r a <tab> RET C-x 1 C-c C-e M-x r e
p o r <tab> b RET

Recent messages:
Wrote /home/andy/.newsrc.eld
Saving /home/andy/.newsrc.eld...done
(No changes need to be saved) [2 times]
Wrote /home/andy/.w3m-session-backup
Command: step 1 [12 times]
Command: clear sound.c:1212
Command: cont
(Shell command succeeded with no output)
Completed
Loading emacsbug...done

Attachment: bt.out
Description: Binary data

--
Reclama i tuoi diritti digitali, elimina il DRM.  Approfondisci su
http://www.no1984.org
Reclaim your digital rights, eliminate DRM.  Learn more at
http://www.defectivebydesign.org/what_is_drm

reply via email to

[Prev in Thread] Current Thread [Next in Thread]