By default, bam stats assumes that a single read covers less than 1024 reference bases.
This type of error appears if a read is longer than that. This is most likely to happen if you have large skipped regions in your cigar ('N's).
You can look for those using something like:
../bin/bam findCigars --noph --cskip --in test.bam --out - |grep -v "^@" |cut -f 6
You can will need to increase the size of the pileup buffer to cover the largest number of bases a single read covers.
Add --bufferSize 3000
Replace 3000 by the appropriate number to handle the largest size of the reference covered by a read.
You can increase this to a large number - it will just take up more memory.
I will update bamUtil so that in the future it will print out a little more information about the first read it encountered as a problem. This will help to figure out what to increase the bufferSize to, however, a future read may require an even larger buffer.
Let me know if that helps or if you have more questions or issues about how to figure out how to update the buffer size.
Mary Kate