[vorbis-dev] More information on exception

Michael Smith msmith at labyrinth.net.au
Fri Sep 1 08:57:46 PDT 2000



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 at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list