| Store | Cart

Re: Problem timing out XML::LibXML parse_html_string call

From: Bjoern Hoehrmann <derh...@gmx.net>
Wed, 04 Feb 2009 00:12:16 +0100
* Sam Tregar wrote:
>Thanks!  This does indeed work.  I'm still in the market for a safer>solution if anyone has one, but this will do for now.

The fault here lies with libxml2 which goes into an infinite loop, at
least as far as I can tell from running your document through xmllint.
The library reports an error "Excessive depth in document" before it
goes into the loop, perhaps you can wait for this error and abort if
you get it. The proper solution would be to file a bug with libxml2
and use a fixed version. It may also be possible to run the parsing
code in a separate thread or process, and kill it as desired. Though
mixing Perl and threads and XS can easily become problematic.
-- 
Björn Höhrmann · mailto:bjo...@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Recent Messages in this Thread
Sam Tregar Feb 03, 2009 07:44 pm
Aaron Crane Feb 03, 2009 09:11 pm
Sam Tregar Feb 03, 2009 11:04 pm
Bjoern Hoehrmann Feb 03, 2009 11:12 pm
Messages in this thread