Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 67231
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: Scott.Stricker [...] NGC.com
Cc:
AdminCc:

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



Subject: Perlcritic crashes when evaluating a file
Date: Mon, 4 Apr 2011 19:22:27 +0000
To: "bug-Perl-Critic [...] rt.cpan.org" <bug-Perl-Critic [...] rt.cpan.org>
From: "Stricker, Scott (IS)" <scott.stricker [...] ngc.com>
Running perlcritic 1.115 in an activestate perl 5.12.3 (1204) on a windows xp pro SP3 machine. When I run perlcritic against the attached file, I get the following... Fatal error while critiquing "C:\h\HCS\website\COF_Root\Scripts\HCSTracks_AJAX.pl": Exception::Fatal::Internal: A problem with the Perl::Critic code was found, a.k.a. a bug. 3rd arg to Violation->new() must be a PPI::Element Mon Apr 4 19:05:34 2011 Trace begun at C:\Perl\site\lib\Perl\Critic\Violation.pm line 65 Perl::Critic::Violation::new('Perl::Critic::Violation', 'Missing "NAME" section in POD', 'ARRAY(0x2abcfc4)', undef, 2) called at C:\Perl\site\lib\Perl\Critic\Policy\Documentation\RequirePodSections.pm line 345 Perl::Critic::Policy::Documentation::RequirePodSections::violates('Perl::Critic::Policy::Documentation::RequirePodSections=HASH(0x31aae74)', 'Perl::Critic::Document=HASH(0x317aecc)', 'Perl::Critic::Document=HASH(0x317aecc)') called at C:\Perl\site\lib\Perl\Critic.pm line 183 Perl::Critic::_critique('Perl::Critic::Policy::Documentation::RequirePodSections=HASH(0x31aae74)', 'Perl::Critic::Document=HASH(0x317aecc)') called at C:\Perl\site\lib\Perl\Critic.pm line 135 Perl::Critic::_gather_violations('Perl::Critic=HASH(0x315b3ec)', 'Perl::Critic::Document=HASH(0x317aecc)') called at C:\Perl\site\lib\Perl\Critic.pm line 118 Perl::Critic::critique('Perl::Critic=HASH(0x315b3ec)', 'C:\h\HCS\website\COF_Root\Scripts\HCSTracks_AJAX.pl') called at C:\Perl\site\lib\Perl\Critic\Command.pm line 249 eval {...} at C:\Perl\site\lib\Perl\Critic\Command.pm line 257 Perl::Critic::Command::_critique('HASH(0x1fecf0c)', 'C:\h\HCS\website\COF_Root\Scripts\HCSTracks_AJAX.pl') called at C:\Perl\site\lib\Perl\Critic\Command.pm line 71 Perl::Critic::Command::run at C:\Perl\site\bin\perlcritic line 27 I'm guessing that perlcritic has trouble with =pod Code to be commented out line1 Line2 =cut I've got another file that I replaced a goto around a block of code with =pod, =cut and perlcritic started aborting on that file also. Note that I sent most of this info to 'jeff@imaginative-software.com' last week, but have not heard anything back. Don't know if it was appropriate to send to him vs. this address so am sending again. Thanks E. Scott Stricker

Message body is not shown because sender requested not to inline it.

On Mon Apr 04 15:22:46 2011, stricsc wrote: Show quoted text
> Running perlcritic 1.115 in an activestate perl 5.12.3 (1204) on a > windows xp pro SP3 machine. > > When I run perlcritic against the attached file, I get the > following... > Fatal error while critiquing > "C:\h\HCS\website\COF_Root\Scripts\HCSTracks_AJAX.pl": > Exception::Fatal::Internal: A problem with the Perl::Critic code > was found, a.k.a. a bug. > > 3rd arg to Violation->new() must be a PPI::Element > > Mon Apr 4 19:05:34 2011 > > Trace begun at C:\Perl\site\lib\Perl\Critic\Violation.pm line 65 > Perl::Critic::Violation::new('Perl::Critic::Violation', 'Missing > "NAME" section in POD', 'ARRAY(0x2abcfc4)', undef, 2) called at > C:\Perl\site\lib\Perl\Critic\Policy\Documentation\RequirePodSections.pm > line 345 >
Perl::Critic::Policy::Documentation::RequirePodSections::violates('Perl::Critic::Policy::Documentation::RequirePodSections=HASH(0x31aae74)', Show quoted text
> 'Perl::Critic::Document=HASH(0x317aecc)', > 'Perl::Critic::Document=HASH(0x317aecc)') called at > C:\Perl\site\lib\Perl\Critic.pm line 183 >
Perl::Critic::_critique('Perl::Critic::Policy::Documentation::RequirePodSections=HASH(0x31aae74)', Show quoted text
> 'Perl::Critic::Document=HASH(0x317aecc)') called at > C:\Perl\site\lib\Perl\Critic.pm line 135 > Perl::Critic::_gather_violations('Perl::Critic=HASH(0x315b3ec)', > 'Perl::Critic::Document=HASH(0x317aecc)') called at > C:\Perl\site\lib\Perl\Critic.pm line 118 > Perl::Critic::critique('Perl::Critic=HASH(0x315b3ec)', > 'C:\h\HCS\website\COF_Root\Scripts\HCSTracks_AJAX.pl') called at > C:\Perl\site\lib\Perl\Critic\Command.pm line 249 > eval {...} at C:\Perl\site\lib\Perl\Critic\Command.pm line 257 > Perl::Critic::Command::_critique('HASH(0x1fecf0c)', > 'C:\h\HCS\website\COF_Root\Scripts\HCSTracks_AJAX.pl') called at > C:\Perl\site\lib\Perl\Critic\Command.pm line 71 > Perl::Critic::Command::run at C:\Perl\site\bin\perlcritic line 27 > > > I'm guessing that perlcritic has trouble with > > =pod > Code to be commented out line1 > Line2 > =cut > > I've got another file that I replaced a goto around a block of code > with =pod, =cut and perlcritic started aborting on that file also. > Note that I sent most of this info to > 'jeff@imaginative-software.com' last week, but have not heard anything > back. Don't know if it was appropriate to send to him vs. this > address so am sending again. > > Thanks > > > E. Scott Stricker > > >
Thank you for reporting the problem. This was introduced with RT #59268, which requested more latitude on the placement of the '## no critic (RequirePodSections)'. Unfortunately the enhancement code failed to take into account the fact that the POD might not include a '-head1' at all. My apologies. The fix has been committed as SVN revision 4063. The diff file for Perl::Critic::Policy::Documentation::RequirePodSections is attached.
Subject: rt67231.diff
Index: lib/Perl/Critic/Policy/Documentation/RequirePodSections.pm =================================================================== --- lib/Perl/Critic/Policy/Documentation/RequirePodSections.pm (revision 4061) +++ lib/Perl/Critic/Policy/Documentation/RequirePodSections.pm (working copy) @@ -342,7 +342,10 @@ my $desc = qq{Missing "$required" section in POD}; # Report any violations against POD of record rather than whole # document (the point of RT #59268) - push @violations, $self->violation( $desc, $EXPL, $pod_of_record ); + # But if there are no =head1 records at all, rat out the + # first pod found, as being better than blowing up. RT #67231 + push @violations, $self->violation( $desc, $EXPL, + $pod_of_record || $pods_ref->[0] ); } }