[Tremor] Segfault problems with tremor

Segher Boessenkool segher at kernel.crashing.org
Thu Nov 11 16:23:35 PST 2004


> int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){
>   memset(vb,0,sizeof(*vb));
>   vb->vd=v;
>   vb->localalloc=0;
>   vb->localstore=NULL;
>
>   return(0);
> }
>
> Specifically,   the memset(vb,0,sizeof(*vb));
> This is NOT wiping the supplied vorbis_block structure; it is only 
> wiping the
> first 4 bytes of it - the size of a pointer on the PPC - so the "struct
> alloc_chain*" pointer, "reap"  is pointing at some random value, as 
> well as
> most of the rest of the structure.

sizeof*vb == sizeof(vorbis_block) != 4 so this is not a problem in the 
code.
GCC (any version, but certainly something as old as 3.3) has no problem 
with
this either, as far as I know.  Maybe GCC doesn't inline it and uclibc 
has
a bug, although I'd doubt that as well.

Can you show generated assembler code for this, or something else 
(debugger
output or such) to show the problem happening?


Segher



More information about the Tremor mailing list