Re: [Audacity-devel] Floating point crash repeating less than a sample of audio
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Martyn S. <mar...@gm...> - 2013-10-13 22:55:36
|
Thanks Steve for the quick diagnosis of this one! We should fix this post-2.0.5. Def avoid a divide-by-zero! Not relevant to this bug, or the release process, and quite academic... I notice that this section of code (EffectRepeat::PromptUser(), lines 57-81) is probably pretty redundant. Written in 2003 when we counted samples with a 32-bit int, tracks had a maximum length of 2^31 - 1, hence the check to make sure they don't get too long (working out maxCount and applying it in lines 97-8). Since we updated sampleCount to a 64-bit int, the chances of overflow are tiny (and I suspect current machines couldn't do that before the user get bored!). And so the constant 2147483647 no longer seems relevant in checking availSamples, I think it should be much more. For these very long lengths I believe that we would start to fail (in a number of places) at a number of samples around 2^53, due to the use of 'double' to represent 'time' http://en.wikipedia.org/wiki/Double-precision_floating-point_format, and our assumption that we can convert back and forth from 'time' to 'sampleCount' without error fails beyond 2^53 samples. (Did I get that right? I believe Richard is the expert here.) So we should do something like - int availSamples = 2147483647 - trackLen; + sampleCount availSamples = 2^52 - trackLen; (correcting the size of the other variables) if we want people to be able to 'repeat' stuff beyond 13 hours @ 44.1kHz sampling rate, or 35 mins @ 1MHz sampling rate, there may be reasonable use-cases for wanting to do that. Is it worth doing? TTFN Martyn On 13/10/2013 14:20, Steve the Fiddle wrote: > On 13 October 2013 07:44, Steve the Fiddle <ste...@gm...> wrote: >> On 13 October 2013 04:49, Gale (Audacity Team) <ga...@au...> wrote: >>> FWIW, reported on the Forum: >>> http://forum.audacityteam.org/viewtopic.php?f=48&t=75165 . >>> >>> I can make it happen thus on Windows and Linux: >>> >>> 1 Generate Tone >>> 2 Zoom in to maximum >>> 3 drag-select a small distance in the waveform without drawing >>> a selection there (that is, the selection will only be in the Timeline) >>> 4 Effect > Repeat. >>> >>> None of the other effects I've tried crash. >> >> Certainly not a release blocker imho. The issue is also reproducible >> on Audacity 1.3.12 so it's been around for at least 5 years but is so >> obscure that it's not been reported 'till now. I'd say around P4 and >> mark it "Cherry" (it looks to me like a simple divide by zero error). > > Added to bugzilla as bug 669. > > Steve > >> >> Steve >> >> >>> >>> >>> Gale > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > audacity-devel mailing list > aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-devel > |