Juce Demo Audio Playback EXC_ARITHMETIC


#1

From the modules branch on Lion, the audio playback demo crashes with EXC_ARITHMETIC. It happens in the TimeSliceThread used for the AudioTransportSource. The crash happens when a file is selected for playback, seemingly as soon as a time slice client is added.


#2

Weird… I’ve still not upgraded to lion yet - could you show me a stack trace?


#3

Yeah, I knew better than to upgrade early and of course now I’m paying the price. I might wipe everything and go back to snow leopard. Anyway, I can’t figure out how to get a textual stack trace in xcode 4, so I’ve attached an image of the audio file preview thread.

[attachment=0]AudioFilePreviewThread.jpg[/attachment]

The message thread is like this:

juce::zeromem
juce::AudioSampleBuffer::clear()
juce::BufferingAudioSource::prepareToPlay
juce::ResamplingAudioSource::prepareToPlay
juce::AudioTransportSource::setSource
AudioDemoPlaybackPage::loadFileIntoTransport


#4

I should note that it doesn’t always happen. A few tries usually can trigger it though.


#5

Ok, thanks, I’ve reproduced it, will get a fix done asap…


#6

Updated to Juce 2.0.4 and it still catches after a few tries with same error.

Main thread trace:

CriticalSection::enter()
GenericScopedLockjuce::CriticalSection::GenericScopedLock(juce::CriticalSection const&)
TimeSliceThread::removeTimeSliceClient(juce::TimeSliceClient*)
BufferingAudioSource::prepareToPlay


#7

Damn, took me ages to reproduce that! Thanks, I just forgot something when doing my last fix. Will check in soon…