Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 4501
Status: resolved
Left: 0 min
Priority: 0/0
Queue: XML-Twig

Owner: Nobody
Requestors: ed [...] membled.com
Cc:
AdminCc:

Severity: Normal
Broken in:
  • 3.09
  • 3.11
Fixed in: 3.11



X History Display mode: Brief headersFull headers
#   Wed Nov 26 15:31:29 2003 EDAVIS - Ticket created  
Subject: Setting $SIG{__DIE__} breaks parse()
[text/plain 652b]

use XML::Twig;
local $SIG{__DIE__} = sub {
my $msg = shift;
print STDERR "dying! $msg\n"; exit 1;
};
new XML::Twig()->parse('<a />');

dies with the error

dying! Can't use string ("<a />") as a symbol ref while "strict refs"
in use at
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/XML/Parser/Expat.pm
line 456.

As far as I know this is a minimal test case. I can reproduce it with
perl 5.8.0 and 5.8.2, XML::Twig 3.09 and 3.11. Can you reproduce it?

It looks like it could be a bug in XML::Parser or perl, but having
narrowed it down this far I thought I should contact you first of all.

#   Wed Nov 26 17:09:24 2003 ed[...]membled.com - Correspondence added  
Date: Wed, 26 Nov 2003 22:02:52 +0000 (GMT)
From: Ed Avis <ed[...]membled.com>
To: XML-Twig <bug-XML-Twig[...]rt.cpan.org>
Subject: Re: [cpan #4501] AutoReply: Setting $SIG{__DIE__} breaks parse()
[text/plain 416b]
After some more investigation I narrowed this bug down to

use XML::Parser;
local $SIG{__DIE__} = sub {
my $msg = shift;
print STDERR "dying! $msg\n"; exit 1;
};
new XML::Parser()->parse('<a />');

So it is not an XML::Twig bug except in so far as XML::Twig is built
on XML::Parser.

The good news is that this seems to be fixed with XML::Parser 2.34.

--
Ed Avis <ed[...]membled.com>



#   Mon Dec 01 07:49:44 2003 guest - Correspondence added  
[text/plain 568b]
[ed[...]membled.com - Wed Nov 26 17:09:24 2003]:

> After some more investigation I narrowed this bug down to
>
> use XML::Parser;
> local $SIG{__DIE__} = sub {
> my $msg = shift;
> print STDERR "dying! $msg\n"; exit 1;
> };
> new XML::Parser()->parse('<a />');
>
> So it is not an XML::Twig bug except in so far as XML::Twig is built
> on XML::Parser.
>
> The good news is that this seems to be fixed with XML::Parser 2.34.

This is a good thing, as I was not able to reproduce the bug (I use
XML::Parser 2.34).

Can I close the bug?


#   Mon Dec 01 08:20:11 2003 guest - Correspondence added  
From: ed[...]membled.com
[text/plain 448b]
If you feel that this is morally a bug in XML::Twig as well as
XML::Parser (even though the XML::Twig code itself is not at fault) then
you could make XML::Twig require XML::Parser-2.34 or later. If this is
the version you develop with, then there is some sense in doing that anyway.

If you think that there is no bug in XML::Twig (even though I was able
to reproduce the problem with a script that uses only XML::Twig) then
please close the bug.
#   Fri Jan 23 10:41:20 2004 MIROD - Fixed in 3.11 added  
#   Fri Jan 23 10:41:20 2004 MIROD - Status changed from 'new' to 'resolved'  
#   Fri Jan 23 10:43:34 2004 MIROD - Correspondence added  
[text/plain 296b]
[guest - Mon Dec 1 08:20:11 2003]:

> If you think that there is no bug in XML::Twig (even though I was able
> to reproduce the problem with a script that uses only XML::Twig) then
> please close the bug.

I added an entry in the FAQ at
http://xmltwig.com/xmltwig/XML-Twig-FAQ.html#Q15
__
Mirod
#   Fri Jan 23 10:43:34 2004 RT_System - Status changed from 'resolved' to 'open'  
#   Fri Jan 23 10:45:34 2004 MIROD - Status changed from 'open' to 'resolved'