mattgallagher / AudioStreamer

A streaming audio player class (AudioStreamer) for Mac OS X and iPhone.
http://cocoawithlove.com
1.93k stars 553 forks source link

stop method causes EXC_BAD_ACCESS on some rare cases #16

Open mayoneez opened 14 years ago

mayoneez commented 14 years ago

When I play a short part (less than a second) of a lot of songs in a row and always stop the currently playing song with the stop method, sometimes the method will crash the program.

The crash happens in this call (inside the while loop):

    [NSThread sleepForTimeInterval:0.1];

I haven't managed to reproduce this systematically but I get the same crash about every other time I ran the program. On some cases the debugger will be caught in a loop and app will not crash but hangs up. Activating a breakpoint on that particular line doesn't produce a break.

Anyone else having the same problem?

mayoneez commented 14 years ago

More info: Seems to happen only on the simulator. Haven't been able to reproduce it on the device.

mayoneez commented 14 years ago

I debugged a bit more and got this message in the console:

"AudioQueue changed state in unexpected way."

After about 5 clicks after that (i.e. starting 5 new songs) the app crashed.

mayoneez commented 14 years ago

After more debugging, it turns out that the handlePropertyChangeForQueue gets called when the object is in state AS_AUDIO_QUEUE_CREATION_FAILED:

"AudioQueue changed state in unexpected way. state = 8"

After a couple of plays after that, app crashes and before crash I saw this in the console:

"(967,0xb0185000) malloc: * error for object 0xe705aa0: incorrect checksum for freed object - object was probably modified after being freed. * set a breakpoint in malloc_error_break to debug"

ghost commented 11 years ago

hello, please did you manage to resolve this issue , im facing the same problem. Thnaks