Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: TODDR [...] cpan.org
Cc:
AdminCc:

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



Subject: t/46err_column.t broken on centos/redhat 4
t/46err_column.t is broken on centos/redhat 4 On this system, libxml is as follows: libxml2-devel-2.6.16-12.8 libxml2-2.6.16-12.8 I'm not sure, but I'm guessing that this version of the library causes $@ to be a string not an object. I get this in $@ during that test (diags added to show $@): # :1: parser error : attributes construct error # " attr9="value2" attr10="value2" attr11="value2" attr12="value2" attr13="value2" # ^ # :1: parser error : Couldn't find end of Start Tag foo line 1 # " attr9="value2" attr10="value2" attr11="value2" attr12="value2" attr13="value2" # ^ # :1: parser error : Extra content at the end of the document # " attr9="value2" attr10="value2" attr11="value2" attr12="value2" attr13="value2" # ^ at t/46err_column.t line 17 Can't call method "column" on an undefined value at t/46err_column.t line 24. This could possibly indicate some unexpected exit in the xs that isn't being handled. If this is just an issue with an old LibXML, could we first test that $@ is a object before we do this test? SKIP: { skip('parse_string returned a string not an XML::LibXML::Error object', 1) if(!ref $@); is ($@->column(), 203, "Column is OK."); }
Hi Todd, On Fri Jun 24 00:23:32 2011, TODDR wrote: Show quoted text
> t/46err_column.t is broken on centos/redhat 4 > > On this system, libxml is as follows: > libxml2-devel-2.6.16-12.8 > libxml2-2.6.16-12.8 > > I'm not sure, but I'm guessing that this version of the library causes > $@ to be a string not an object. I get this in $@ during that test > (diags added to show $@): >
What is your modified t/46err_column.t ? Can you try upgrading libxml2 from source? Show quoted text
> # :1: parser error : attributes construct error > # " attr9="value2" attr10="value2" attr11="value2" attr12="value2" > attr13="value2" > # > ^ > # :1: parser error : Couldn't find end of Start Tag foo line 1 > # " attr9="value2" attr10="value2" attr11="value2" attr12="value2" > attr13="value2" > # > ^ > # :1: parser error : Extra content at the end of the document > # " attr9="value2" attr10="value2" attr11="value2" attr12="value2" > attr13="value2" > # > ^ at t/46err_column.t line 17 > Can't call method "column" on an undefined value at t/46err_column.t > line 24. > > This could possibly indicate some unexpected exit in the xs that isn't > being handled. If this is just an issue with an old LibXML, could we > first test that $@ is a object > before we do this test? > > SKIP: { > skip('parse_string returned a string not an XML::LibXML::Error > object', 1) if(!ref $@);
Show quoted text
> is ($@->column(), 203, "Column is OK."); > }
Well, I want to make sure that we always throw an object expression, and not just skip it like that. Can you further try to isolate the problem? In the meanwhile, I can try installing CentOS 4 in a VM. Is this x86-32 or x86-64? Regards, -- Shlomi Fish
On Fri Jun 24 08:02:46 2011, SHLOMIF wrote: Show quoted text
> Hi Todd, > > On Fri Jun 24 00:23:32 2011, TODDR wrote:
> > t/46err_column.t is broken on centos/redhat 4 > > > > On this system, libxml is as follows: > > libxml2-devel-2.6.16-12.8 > > libxml2-2.6.16-12.8 > > > > I'm not sure, but I'm guessing that this version of the library causes > > $@ to be a string not an object. I get this in $@ during that test > > (diags added to show $@): > >
> > What is your modified t/46err_column.t ? > > Can you try upgrading libxml2 from source?
Maybe but I can tell you that Centos/Redhat 4 32 & 64 all have this problem. CentHat 5-6 do not. I would prefer to consider this a bug with the distro and attempt to correct it either with skips in the test or finding the bug. I do note that the problem Also, I am testing against perl 5.14.1 installed to a custom prefix so as not to interfere with the local OS. Show quoted text
> Well, I want to make sure that we always throw an object expression, and > not just skip it like that. Can you further try to isolate the problem?
I'm open to ideas, the problem appears to be happening in the XS I would guess how do I easily debug there?
Reviewing the error handling in parse_string, I note that the code historically didn't assume the error would be an object since they were doing a chomp if not ref. The debugging I could do shows this to definitely be an error that happens inside _parse_string. Probably the library just doesn't handle the error messaging as an object at this library version. if ($err) { chomp $err unless ref $err; $self->_cleanup_callbacks(); croak $err; }
Show quoted text
> Probably the library just doesn't handle the error > messaging as an object at this library version.
This is my suggested patch to work around this.
Subject: XML-LibXML-1.74.patch.txt
Author: Todd Rinaldo <toddr@cpan.org> Date: Thu Jun 23 23:21:22 2011 -0500 old libxml returns a string on error not an object. Skip object testing. diff --git a/t/46err_column.t b/t/46err_column.t index dff11ed..e2d62b5 100644 --- a/t/46err_column.t +++ b/t/46err_column.t @@ -20,4 +20,7 @@ eval { }; # TEST -is ($@->column(), 203, "Column is OK."); +SKIP: { + skip('parse_string returned a string not an XML::LibXML::Error object', 1) if(!ref $@); + is ($@->column(), 203, "Column is OK."); +}
On Wed Jul 06 18:25:46 2011, TODDR wrote: Show quoted text
> > Probably the library just doesn't handle the error > > messaging as an object at this library version.
> > This is my suggested patch to work around this.
Thanks! A modified version of this patch is in the repository: https://bitbucket.org/shlomif/perl-xml-libxml It will be released as part of XML-LibXML-1.79 later on. Regards, -- Shlomi Fish
I'm resolving this bug to avoid clutter. It will be uploaded to CPAN later on today. Regards, -- Shlomi Fish On Thu Jul 07 04:48:57 2011, SHLOMIF wrote: Show quoted text
> On Wed Jul 06 18:25:46 2011, TODDR wrote:
> > > Probably the library just doesn't handle the error > > > messaging as an object at this library version.
> > > > This is my suggested patch to work around this.
> > Thanks! A modified version of this patch is in the repository: > > https://bitbucket.org/shlomif/perl-xml-libxml > > It will be released as part of XML-LibXML-1.79 later on. > > Regards, > > -- Shlomi Fish