[Pkg-alsa-devel] Bug#539454: libasound2: Division by zero in pcm_rate.c when period_size->min == 0

John Lindgren john.lindgren at tds.net
Sat Aug 1 02:29:51 UTC 2009


Package: libasound2
Version: 1.0.20-2
Severity: important
Tags: patch


System: Dell Inspiron 1200
Card: Intel ICH6
Chip: SigmaTel STAC9752,53


Steps to reproduce:

1. Disable dmix: mv /usr/share/alsa/cards/ICH4.conf /usr/share/alsa/cards/ICH4.conf.0
2. Restart ALSA: /etc/rcS.d/S50alsa-utils restart
3. Clear Audacity configuration: rm -r ~/.audacity*
4. Run Audacity 1.3.7-3 in Valgrind: valgrind --tool=none audacity
5. Choose "OK" in the "Audacity First Run" dialog.


Valgrind output:

==26237== Process terminating with default action of signal 8 (SIGFPE)
==26237==  Integer divide by zero at address 0x64D1CD56
==26237==    at 0x4CAD600: snd_pcm_rate_hw_refine_cchange (pcm_rate.c:189)
==26237==    by 0x4C97B2E: snd1_pcm_hw_refine_slave (pcm_params.c:2182)
==26237==    by 0x4CAD7D5: snd_pcm_rate_hw_refine (pcm_rate.c:222)
==26237==    by 0x4C96015: snd_pcm_hw_refine (pcm_params.c:2264)
==26237==    by 0x4CA116B: snd1_pcm_generic_hw_refine (pcm_generic.c:98)
==26237==    by 0x4C97B0D: snd1_pcm_hw_refine_slave (pcm_params.c:2158)
==26237==    by 0x4CC0E25: snd_pcm_lfloat_hw_refine (pcm_lfloat.c:261)
==26237==    by 0x4C96015: snd_pcm_hw_refine (pcm_params.c:2264)
==26237==    by 0x4C99068: sndrv_pcm_hw_params (pcm_params.c:2290)
==26237==    by 0x4CB209C: snd_pcm_plug_hw_params (pcm_plug.c:1045)
==26237==    by 0x4C9921D: sndrv_pcm_hw_params (pcm_params.c:2299)
==26237==    by 0x4C947B0: snd_pcm_hw_params (pcm.c:822)


Diagnosis:

pcm_rate.c:189 reads:

        if ((buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {

When using the ICH4 driver without dmix, period_size->min == 0. Handle
this by changing pcm_rate.c:189 to:

        if (period_size->min > 0 && (buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {

With this change, Audacity starts without problems.


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libasound2 depends on:
ii  libc6                         2.9-12     GNU C Library: Shared libraries

libasound2 recommends no packages.

Versions of packages libasound2 suggests:
pn  libasound2-plugins            <none>     (no description available)

-- no debconf information






More information about the Pkg-alsa-devel mailing list