The following block of code produces an exception. The testnew.ogg file is 10 seconds, containing pure silence encoded using mode E: http://www.cs.mun.ca/~chris3/testnew.ogg Other files and modes can cause the exception, but many files work fine. #include <stdio.h> #include "vorbis/vorbisfile.h" int main() { OggVorbis_File ov, ov2; FILE *f, *f2; f = fopen("testnew.ogg", "rb"); if (ov_open(f, &ov, NULL, 0) < 0) return 0; f2 = fopen("testnew.ogg", "rb"); if (ov_open(f2, &ov2, NULL, 0) < 0) { ov_clear(&ov); return 0; } ov_clear(&ov2); ov_clear(&ov); return 0; } Compiled under Windows with Borland C++Builder 5. When run, exceptions occur in block.c at one of these lines: 158: if(vb->localstore)free(vb->localstore); 646: v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(double)); Additional minor corrections: mode_D.h 100: {{0}}, mode_E.h 60: {{0}}, 84: {{0}}, The sqrt domain error still appears occasionally, when encoding a 10 second pure sine wave at .4 amplitude using mode D or E, for example. Chris http://www.goldwave.com --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
At 10:48 PM 8/31/00 -0230, you wrote:> >The following block of code produces an exception. The testnew.ogg >file is 10 seconds, containing pure silence encoded using mode E: > http://www.cs.mun.ca/~chris3/testnew.ogg > >Other files and modes can cause the exception, but many files work >fine. ><snip code> > >Compiled under Windows with Borland C++Builder 5. When run, exceptions >occur in block.c at one of these lines: >158: if(vb->localstore)free(vb->localstore); >646: v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(double)); >I'm quite frankly stumped by this one. Looking at the code, I can't see anything which can happen to cause these to have invalid values in the normal flow of code. This leaves memory corruption of some sort. I ran through all this with electric fence (a malloc debugger for unix), and nothing that gets dynamically allocated is being over or underrun. Nor is freed memory being used incorrectly (that test required some extra swap to be added... efence is a REAL memory hog) Your test case runs perfectly (linux/gcc. I'll test MSVC tomorrow, hopefully) no matter what (this is using cvs mainline, though nothing that should affect this sort of thing has changed on the post beta2 branch). It seems to be compiler-specific. As I don't (and nor do any of the other people who know libvorbis internals reasonably well, to my knowledge) have a copy of BCB5, I don't know what we can do at this point. When one can't reproduce the error or see a good reason why it might be happening...>Additional minor corrections: >mode_D.h >100: {{0}}, > >mode_E.h >60: {{0}}, >84: {{0}},Committed these. I seem to remember deliberately not using that because it was causing problems (or at least warnings) on one of the compilers I was testing it on, but I can't reproduce that - maybe I was imagining it.> >The sqrt domain error still appears occasionally, when encoding a >10 second pure sine wave at .4 amplitude using mode D or E, >for example.I ran out of time today to check this one - hopefully I'll get a chance tomorrow. Michael --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
>The sqrt domain error still appears occasionally, when encoding a >10 second pure sine wave at .4 amplitude using mode D or E, >for example.I finally found time to try and investigate this one - but didn't get anywhere. I couldn't reproduce this. Could you send me (offlist) a file that is triggering this problem? However, I also tried the post b2 branch. The big difference here is that everything uses floats instead of doubles. This sounds fine, but appears to cause lots of floating point exceptions, if one enables them. I got sidetracked trying to figure out why exactly this was happening (not terribly hard) and how to fix it properly (much harder). Didn't get terribly far, partially because I don't understand ANY of psy.c (which is where this was happening), so I had to try and figure that out. Hopefully I'll have some more time tomorrow to figure out a good solution, but I suspect I'll need to talk to Monty about it. Michael --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.