Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 20929
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: ks [...] ptc.spbu.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Strange "Success" error message.
Date: Thu, 10 Aug 2006 09:45:16 +0400
To: bug-XML-LibXML [...] rt.cpan.org
From: Konstantin Statodubtsev <ks [...] ptc.spbu.ru>
Hello. Some times I'm getting following error when trying to use XML::LibXML->parse_file inside my mod_perl2 app: Couldn't create file parser context for file "/var/www/ro/trunk/html/xsl/main.xsl": Success at /usr/lib/perl5/XML/LibXML.pm line 518. There's no more diagnostics and I'm very confused with such "A error: Success" message. This error appears very rarely (may be once per 10k requests). XSL file is static and doesn't change between requests. With XML::LibXML 1.58 the probability of this error was several times higher. My application is run under mod_perl2 and threaded version of apache2 and has may be 3rq/sec at peak loads. I wasn't able to reproduce this error while passing same arguments which produced error, so may be it is some kind of race condition or buffer overflow? If you need me to run patched version of XML::LibXML or libxml2 to get more debug output then I'm ready to execute all your instructions to help :) OS is Debian GNU/Linux Etch (testing) CPU is Intel p3 Software versions: ii libxml2 2.6.26.dfsg-3 GNOME XML library ii libxml-libxml-perl 1.59-2 Perl module for using the GNOME libxml2 libr ii libxml-libxml-common-perl 0.13-5 Perl module for common routines & constants ii perl 5.8.8-6.1 Larry Wall's Practical Extraction and Report ii perl-base 5.8.8-6.1 The Pathologically Eclectic Rubbish Lister ii perl-modules 5.8.8-6.1 Core Perl modules ii libc6 2.3.6-15 GNU C Library: Shared libraries ii libapache2-mod-perl2 2.0.2-2 Integration of perl with the Apache2 web ser ii apache2-mpm-worker 2.0.55-4 high speed threaded model for Apache2 -- MBR, Konstantin Starodubtsev
On čt 10.srp.2006 01:45:33, ks@ptc.spbu.ru wrote: Show quoted text
> Hello. > Some times I'm getting following error when trying to use
XML::LibXML- Show quoted text
> >parse_file inside my mod_perl2 app:
> > Couldn't create file parser context for file > "/var/www/ro/trunk/html/xsl/main.xsl": Success at > /usr/lib/perl5/XML/LibXML.pm line 518. > There's no more diagnostics and I'm very confused with such "A error: > Success" message.
The "Success" part of the error message comes from a call to standard C strerror(errno), and indicates in this case that errno was 0, from which I only guess that it was not a usual I/O failure that caused the problem. Show quoted text
> This error appears very rarely (may be once per 10k requests). > XSL file is static and doesn't change between requests. > I wasn't able to reproduce this error while passing same arguments > which produced error, so may be it is some kind of race condition or > buffer overflow?
Might be anything like that, but in that case I would suspect the problem is in libxml2, perl, mod_perl, or apache rather than in XML:LibXML. Show quoted text
> If you need me to run patched version of XML::LibXML or libxml2 to
get Show quoted text
> more > debug output then I'm ready to execute all your instructions to help > :)
I have no patch to offer but you can do some experiments yourself. The error is issued when xmlCreateURLParseCtxt from parser.c (libxml2) returns NULL. Have a look at the function and maybe add some debug output to it. There are only two cases when it does return NULL (1/ memory allocation error, which should be reported, 2/ xmlLoadExternalEntity returns NULL). Add some more debug output to xmlLoadExternalEntity (xmlIO.c). Compare the debug outputs from a successful run and a failure. That could give us some hints. -- Petr
From: shane [...] eznettools.com
I believe I am experiencing the same error. When running apache/mod_perl in single user mode I get the following consistent behavior after a clean server start. 1st Request: XML parse and XSLT transform works. 2nd Request: Always fails to parse with the "parser context" error 3rd Request: works fine As far as I can tell all subsequent requests work as well. I haven't tracked this down but I have attached a tar file containing a perl script, sample xsl, and xml files. The perl script generates a C application that emulates a mod_perl environment and produces the same symptoms as I have been experiencing. System Info: Perl 5.8.5 Apache 1.3.29 XML::LibXML 1.62 (latest) XML::LibXSLT 1.62 libxml 2.6.27 libxslt 1.1.20 Thanks, Shane Corgatelli EZ-NetTools
Download libxml_check.tgz
application/x-compressed-tar 1.5k

Message body not shown because it is not plain text.

The libxml_check test case you provided (nice work BTW) gives: Results of 3 simulated mod_perl requests: (GOOD XSLT) Hello, World! (GOOD XSLT) Hello, World! (GOOD XSLT) Hello, World! This is with libxml2-2.6.28 - 2.6.30 and SVN XML::LibXML (pre 1.64). So I'm closing this for now since it "works for me", although I do not recall fixing anything related. Either libxml2 was fixed or your setup differs substantially from mine (linux / SuSE 10.2). If you happen to still experience the same bug with the above versions of libxml2 and XML::LibXML, feel free to reopen it. -- Petr