[gs-bugs] [Bug 692246] font cache infinite loop

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Sat Jun 11 19:24:54 UTC 2011


--- Comment #6 from Shailesh Mistry <shailesh.mistry at talktalk.net> 2011-06-11 19:24:53 UTC ---
The root cause of this bug is 2 fold

1) The capacity of the hash table is independent of the cache freeing
2) A number of "while" conditionals exist that can loop indefinitely

The value of cmax (# of chached chars) is used in gx_char_cache_alloc to
calculate the size of hash table to make. However the cache freeing mechanism
is based on bmax. This bug results because bmax still has enough space to make
a new entry for the hash table but the table is full so the while conditional
in gx_lookup_cached_char cannot find the requested char and also cannot find an
empty slot to store the new char in.

This can be resolved by :-

1) remove cmax and calculate the hash table size using a function of bmax

2) update gx_lookup_cached_char so that the while loop will break out if the
table is full and return 0 to indicate the requested char was not found

3) update alloc_char_in_chunk so that the while loop will free the current
entry pointed to if the table is full and/or purge a set percentage to make

4) update gx_add_cached_char so that the while loop will break out if the table
is full and also purge a set percentage to make some room

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list