Re: forever loop in IHTMLTxtRange::findText

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"obayan" <obayan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DD22E4AD-98C3-40BC-9D17-FB0E1690AEB1@xxxxxxxxxxxxxxxx
To highlight a page is a cause of forever loop in IHTMLTxtRange::findText
and
CPU 100%. http://www.kt.rim.or.jp/~kbk/regex/regex.html[^] is one of the
pages, and a search key is "perl" to make the loop. It seems to be a bug,
because MSN Toolbar has same problem, e.g. open the page, input "perl" in
the
box, push the highlight button, and it hangs up the IE. But nothing tells
about it in MSDN. If you have any information about this, please let me
know.
The following is the source code.

while(lpTxtRange->findText(search,0,lFlags,
(VARIANT_BOOL*)&bFound),bFound) {
newhtml.Empty();
lpTxtRange->get_htmlText(&html);
newhtml.Append(");
newhtml.Append((LPCTSTR)searchID);
newhtml.Append("' style='");
newhtml.Append((LPCTSTR)matchStyle);
newhtml.Append("'>");
if(searchText==" ") newhtml.Append(" ;");
else newhtml.AppendBSTR(html);
newhtml.Append("");
lpTxtRange->pasteHTML(newhtml);
lpTxtRange->moveStart((BSTR)CComBSTR("Character"),1,&t);
lpTxtRange->moveEnd((BSTR)CComBSTR("Textedit"),1,&t);
}

Unfortunately I cannot help you with the problem, but I can confirm that I
have run into the same bug a number of times. In other words, a call to
IHTMLTxtRange::findText hangs forever with 100% CPU.

I was also able to hang IE on your example page by clicking Find Next until
the last instance of 'perl'. After the last instance, it hangs with 100%
CPU. This makes sense since IE probably uses the same
IHTMLTxtRange::findText implementation in its Find dialog.

Regards,
Sami


.



Relevant Pages

  • tar gone wild under perl
    ... I am having a problem with tar suddenly taking 100% of the cpu and never ... This is perl, ... Is this a bug in FreeBSD, Apache, or Perl? ...
    (comp.unix.bsd.freebsd.misc)
  • Re: How to kill zombies ..
    ... CPU, that process also hangs and can't bestopped anymore. ... If there is a bug in OSSTTY, we are of course interested in get it it fixed. ...
    (comp.sys.tandem)
  • Re: RFC: starting a kernel-testers group for newbies
    ... with hpet=disable in the boot command line) ... And when it hangs I can see only _one_ "Switched to high resolution mode ... Switched to high resolution mode on CPU 1 ...
    (Linux-Kernel)
  • [PATCH] fix boot-time hangs from PREEMPT_RCU and NO_HZ
    ... in order to prevent boot-time hangs when running with PREEMPT_RCU ... Preemptible RCU can get stuck if a CPU goes idle and NO_HZ is set. ...
    (Linux-Kernel)
  • Re: Why does Perl use more resource than Php?
    ... A Perl app that means a large number ... >> require less CPU for a similar app, so the language may well be ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)