I'm running into a crash on Leopard that I don't get on Tiger. Recording to an m4a file, I am only able to record about 3 hours of audio before I get a crash. The relevant part of the crash log looks like this:
#0 0x901ff9f1 in malloc_error_break
#1 0x901fa9df in szone_error
#2 0x90122ff6 in allocate_pages
#3 0x901237e2 in large_and_huge_malloc
#4 0x9011a948 in szone_malloc
#5 0x9011a738 in malloc_zone_malloc
#6 0x9011a6cc in malloc
#7 0x9008c598 in operator new
#8 0x90aba67e in std::vector<long long, std::allocator<long long> >::_M_insert_aux
#9 0x90ab8c6a in MP4AudioFile::WritePackets
#10 0x90a6a6b1 in AudioFileWritePackets
My initial guess is that the vector is growing too large. So, doing a bit of research the max_size of std::vector<long long> is 536870911. I'm not sure what the vector is being used for, but at the point of the crash I've written 67108864 packets of audio. The max vector size is less than 10 time greater than the number of packets I've written so it is conceivable that I have run into the limit.
In my test case I'm writing silence in a tight loop so I don't have to wait.
If nobody has any suggestions or insights I'll file a bug. Clearly the call to AudioFileWritePackets should be returning an error and not crashing.