Patch: fix intermittent crash in KHTML Thai Word Break

Pattara Kiatisevi ott-list at thaigate.nii.ac.jp
Tue Mar 1 16:43:27 GMT 2005


On Tuesday 01 March 2005 13:23, Germain Garand wrote:
> Le lundi 28 Février 2005 16:41, Otto Pattara a écrit :
> > On 2005 February 26 Saturday 02:17, Germain Garand wrote:
> > > Le vendredi 25 Février 2005 05:38, Pattara Kiatisevi a écrit :
> > > > Hello,
> > > >
> > > > Regarding the Thai word break patch in KHTML, after testing
> >
> > The backtrace seemed not very informative to me (maybe I need to
> > enable debugging somehow (?) when compiling KHTML).
> >
> > I put some printf in libthai and found that sometimes the input
> > parameter for array size (cache->allocated, in KHTML code) is
> > incredibly large or the  cache->wbrpos array is 0x0. So I
> > suspected there might be something funny about initialization of
> > this "cache" structure. By looking at the code I don't see any
> > mysterious point so I made a fix as in the patch.
> >
> > I will fix the patch to load libthai only in case of viewing Thai
> > web pages.
>
> Hi Otto,
>
> based on the comments on kfm-devel, could you test if resetting the
> statics 'cache' and  'th_brk' to zero in cleanup_thaibreaks() would
> fix the problems you described?

Dear Germain,

Yes I changed the code as you suggested (please see the attached 
patch) and tested. So far it works fine. No crash. 

This is new to me, I thought "delete x" means "free the memory that x 
is pointing to and set x to 0", hmm.

Thank you very much!
Otto


>
> Greetings,
> Germain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newfix-from-3.3.1.diff
Type: text/x-diff
Size: 650 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20050302/c90af8f6/attachment.diff>


More information about the kfm-devel mailing list