Hello!

For some reason the latest versions of lame have crashed on my system when
running on PPC processor. The same code compiled for m68k processor
doesn't crash. I think the problem is probably memory access at invalid
address, but because of the system design, on m68k it luckily doesn't seem
to cause a problem but on a PPC side it really does.

I did some debugging and the problem occurs in L3psycho_anal (psymodel.c).
Earlier versions (like 3.69beta and earlier, I think) work fine but at
least some newer one of the latest ones don't (at least 3.82beta and
3.83beta).

The problem seems to occur here (the reason why this problem occurs is
probably somewhere else though):


/**********************************************************************
*     compute unpredicatibility of next 200 spectral lines            *
**********************************************************************/ 
printf("L3psycho_anal: 20\n");
    for ( j = gfc->cw_lower_index; j < gfc->cw_upper_index; j += 4 )
      {/* calculate unpredictability measure cw */
        FLOAT rn, r1, r2;
        FLOAT numre, numim, den;
        
printf("L3psycho_anal: 20a\n");
        k = (j+2) / 4; 
        
printf("L3psycho_anal: 20b\n");
        { /* square (x1,y1) */
printf("L3psycho_anal: 20b1\n");
printf("L3psycho_anal: gfc = 0x%08x\n", gfc);
printf("L3psycho_anal: gfc->cw_lower_index = %d\n",
       gfc->cw_lower_index);
printf("L3psycho_anal: gfc->cw_upper_index = %d\n",
       gfc->cw_upper_index);
printf("L3psycho_anal: j = %d\n", j);
printf("L3psycho_anal: gfc->energy_s = 0x%08x\n", gfc->energy_s);
printf("L3psycho_anal: k = %d\n", k);
printf("L3psycho_anal: &gfc->energy_s[0][k] = 0x%08x\n",
       &gfc->energy_s[0][k]);
printf("L3psycho_anal: gfc->energy_s[0][k] = %g\n",
               gfc->energy_s[0][k]);
          r1 = gfc->energy_s[0][k];

and the output is like this

L3psycho_anal: gfc = 0x0af2b030
- looks like a valid memory address
L3psycho_anal: gfc->cw_lower_index = -1001465578
- looks like an invalid (or uninitialized?) index...?
L3psycho_anal: gfc->cw_upper_index = 1082653874
- looks like an invalid (or uninitialized?) index...?
L3psycho_anal: j = -1001465578
- copy of the lower index
L3psycho_anal: gfc->energy_s = 0x0af5a6b0
- looks like a valid memory address
L3psycho_anal: k = -250366394
- not a nice value and...
L3psycho_anal: &gfc->energy_s[0][k] = 0xcf447fc8
- ...definitely not in a valid range for energy_s that is

  FLOAT energy_s[3][129];

Any idea? Does this kind of problem occur in any other architecture?
If the problem can't be found, at least inserting some assertions could
be a good idea. I can continue debugging more if needed.

Best Regards,
Kimmo Mustonen

--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to