Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Pkg-alsa-devel] Bug#539454: libasound2: Division by zero in pcm_rate.c when period_size->min == 0
       [not found] <1249093791.23117.18.camel@dark-knight>
@ 2009-08-06 19:40 ` Elimar Riesebieter
  2009-08-10  7:56   ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Elimar Riesebieter @ 2009-08-06 19:40 UTC (permalink / raw)
  To: John Lindgren, 539454; +Cc: alsa-devel, control

forwarded 539454 alsa-devel@alsa-project.org
tags 539454 + patch

thanks

Hi,

this is Debian bug 539454. It would be better to fix it in general.
Patching the Debian Package isn't a reasonable solution.

Thanks
Elimar


* John Lindgren [090731 22:29 -0400]
> 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.

Patch against native 1.0.20:

diff -Naurd a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
--- a/src/pcm/pcm_rate.c	2009-05-06 09:07:23.000000000 +0200
+++ b/src/pcm/pcm_rate.c	2009-08-06 21:34:23.000000000 +0200
@@ -186,7 +186,7 @@
 		if (!snd_interval_checkempty(period_size) &&
 		    period_size->openmin && period_size->openmax &&
 		    period_size->min + 1 == period_size->max) {
-		    	if ((buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {
+			if (period_size->min > 0 && (buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {
 		    		snd_interval_set_value(period_size, period_size->min);
 		    	} else if ((buffer_size->max / period_size->max) * period_size->max == buffer_size->max) {
 		    		snd_interval_set_value(period_size, period_size->max);


-- 
  Experience is something you don't get until 
  just after you need it!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Pkg-alsa-devel] Bug#539454: libasound2: Division by zero in pcm_rate.c when period_size->min == 0
  2009-08-06 19:40 ` [Pkg-alsa-devel] Bug#539454: libasound2: Division by zero in pcm_rate.c when period_size->min == 0 Elimar Riesebieter
@ 2009-08-10  7:56   ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-08-10  7:56 UTC (permalink / raw)
  To: Elimar Riesebieter; +Cc: 539454, alsa-devel, control, John Lindgren

At Thu, 6 Aug 2009 21:40:04 +0200,
Elimar Riesebieter wrote:
> 
> forwarded 539454 alsa-devel@alsa-project.org
> tags 539454 + patch
> 
> thanks
> 
> Hi,
> 
> this is Debian bug 539454. It would be better to fix it in general.
> Patching the Debian Package isn't a reasonable solution.

Thanks, applied now to GIT tree.


Takashi

> 
> Thanks
> Elimar
> 
> 
> * John Lindgren [090731 22:29 -0400]
> > 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.
> 
> Patch against native 1.0.20:
> 
> diff -Naurd a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
> --- a/src/pcm/pcm_rate.c	2009-05-06 09:07:23.000000000 +0200
> +++ b/src/pcm/pcm_rate.c	2009-08-06 21:34:23.000000000 +0200
> @@ -186,7 +186,7 @@
>  		if (!snd_interval_checkempty(period_size) &&
>  		    period_size->openmin && period_size->openmax &&
>  		    period_size->min + 1 == period_size->max) {
> -		    	if ((buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {
> +			if (period_size->min > 0 && (buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {
>  		    		snd_interval_set_value(period_size, period_size->min);
>  		    	} else if ((buffer_size->max / period_size->max) * period_size->max == buffer_size->max) {
>  		    		snd_interval_set_value(period_size, period_size->max);
> 
> 
> -- 
>   Experience is something you don't get until 
>   just after you need it!
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-10  7:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1249093791.23117.18.camel@dark-knight>
2009-08-06 19:40 ` [Pkg-alsa-devel] Bug#539454: libasound2: Division by zero in pcm_rate.c when period_size->min == 0 Elimar Riesebieter
2009-08-10  7:56   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox