[squeak-dev] Conditions for infinite recursion in TTCFont>>ascent

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Conditions for infinite recursion in TTCFont>>ascent

Jerome Peace
[squeak-dev] Q: Is it all right for TTCfonts to have non-integer heights?

Hi Yoshiki,

Thanks for the reply and the clues. :-)

Yoshiki Ohshima yoshiki at vpri.org
Thu Jul 31 22:45:58 UTC 2008

> >  In the Squeak world, it is ok if it works^^;
>
> I know. But I doesn't quite.
> TTCFont>>ascent has a code hole
>  that leads to infinite recursion under certain conditions.
> There are several different versions of TTCFont>>ascent.
> AFAIK all the ones currently in use including oplc/3.8 have this property.
> Ralph Johnson patched around this in 3.10.
> To prevent the certain condition, fallback fonts are limited to strikefonts.
>  IMO this is unsatisfactory and undesirable.

Youshiki:>  Could you tell me the certain condition?

See Mantis:
0006664: TTCFont>ascent can be infinitely recursive.
http://bugs.squeak.org/view.php?id=6664
for all the gory details.

For strikefonts ascent is just a variable accessor wherever it is used.
This should probably be the case for TTCFonts too.
(i.e. ascent should be the straight forward calculation
 without involving the fall back font.
For some reason a caluclation for ascent involves
 the calculation of the fixed fonts ascent.
Which means a calculation of the fixed fonts basefont ascent.
If we and the basefont are the same, kaboom, infinite recursion.
If ascent were just a calculation
 and the picking of the maximum height happened elsewhere
 that would be IMO be the elegant fix.

In 3.9 - 3.10  I wrote a test which set up these conditions,
then left them there in the image.

(Not intentionally, but my friend Puck holds
 I just wrote a better test than I had imagined.
 And caught this second bug as well.
 I'm afraid Puck likes the tests that smoke the image best. :-)

On the second pass of testing everything blew up on the poor harvesters.
Thus finding the recursion bug.

> So if you could give this matter a little more serious thought
>  and help my quest for understanding with a clue or two?
> It would be appreciated.


Youshiki:> Sorry if my previous message sounded ignorant.

I asked the question non-urgently.
Your first response led to the second, which has been helpful.

Thank you.

Yours in curiosity and service, --Jerome Peace