You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by "Kevin A. McGrail" <km...@apache.org> on 2019/06/10 01:29:53 UTC
warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Was working on an RC for 3.4 and fixing raozr2 tests. Noticed odd
output for trunk with the razor2 test.
Anyone got some cycles to look at that?
prove -v razor2.t
razor2.t ..
1..4
# Note: Failures may not be an SpamAssassin bug, as Razor tests can fail
due to problems with the Razor servers.
/usr/bin/perl -T -w ../spamassassin.raw -C log/test_rules_copy
--siteconfigpath log/localrules.tmp -p log/test_default.cf -t <
data/spam/razor2
Checking spam
ok 1
/usr/bin/perl -T -w ../spamassassin.raw -C log/test_rules_copy
--siteconfigpath log/localrules.tmp -p log/test_default.cf
--cf='razor_fork 1' -t < data/spam/razor2
Jun 9 21:28:12.073 [26510] warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Jun 9 21:28:12.073 [26510] warn: Use of uninitialized value in scalar
assignment at ../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Checking spam
ok 2
/usr/bin/perl -T -w ../spamassassin.raw -C log/test_rules_copy
--siteconfigpath log/localrules.tmp -p log/test_default.cf -t <
data/nice/001
Checking for anti-pattern nonspam at razor2.t line 53.
ok 3
/usr/bin/perl -T -w ../spamassassin.raw -C log/test_rules_copy
--siteconfigpath log/localrules.tmp -p log/test_default.cf
--cf='razor_fork 1' -t < data/nice/001
Jun 9 21:28:18.025 [26515] warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Jun 9 21:28:18.025 [26515] warn: Use of uninitialized value in scalar
assignment at ../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Checking for anti-pattern nonspam at razor2.t line 56.
ok 4
ok
All tests successful.
Files=1, Tests=4, 12 wallclock secs ( 0.04 usr 0.00 sys + 10.64 cusr
0.75 csys = 11.43 CPU)
Result: PASS
--
Kevin A. McGrail
Member, Apache Software Foundation
Chair Emeritus Apache SpamAssassin Project
https://www.linkedin.com/in/kmcgrail - 703.798.0171
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by "Kevin A. McGrail" <km...@apache.org>.
On 6/12/2019 9:30 AM, Henrik K wrote:
> Bit of a chicken and egg problem here.
>
> If t/freemail.t is included in release.tar.gz, make test won't work. But
> all tests are supposed to be included, so someone can test the package? How
> can you test the package if rules need to be separately downloaded, should
> "make disttest" emulate downloading the rulespackage then?
>
> Suffering flu right now, so not in my fastest mode..
We've distributed it this way for a while now and no one has ever raised
the issue. I agree it is a potential concern though but I would not
prioritize it.
Feel better.
--
Kevin A. McGrail
Member, Apache Software Foundation
Chair Emeritus Apache SpamAssassin Project
https://www.linkedin.com/in/kmcgrail - 703.798.0171
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by Henrik K <he...@hege.li>.
On Wed, Jun 12, 2019 at 04:30:35PM +0300, Henrik K wrote:
> On Wed, Jun 12, 2019 at 08:44:01AM -0400, Kevin A. McGrail wrote:
> > On 6/12/2019 4:52 AM, Henrik K wrote:
> > > Anyone have any idea what rules release package should contain?
> > >
> > > freemail test doesnt work because Mail-SpamAssassin-4.0.0/rules does not
> > > include any 20_freemail*cf files. As they are not in MANIFEST file.
> > >
> > > Should freemail work out of the box without sa-update run or not? What
> > > about the million other .cf files, what's the criteria?
> > >
> > Do you mean like a release from a distro? As a project, we have a
> > release file and a rules file so you can bootstrap without sa-update. I
> > wouldn't expect the release to function without either sa-update or a
> > bootstrapped rules install.
>
> Bit of a chicken and egg problem here.
>
> If t/freemail.t is included in release.tar.gz, make test won't work. But
> all tests are supposed to be included, so someone can test the package? How
> can you test the package if rules need to be separately downloaded, should
> "make disttest" emulate downloading the rulespackage then?
>
> Suffering flu right now, so not in my fastest mode..
I guess this can be fixed in t/freemail.t by adding internal
freemail_domains gmail.com clause..
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by Henrik K <he...@hege.li>.
On Wed, Jun 12, 2019 at 08:44:01AM -0400, Kevin A. McGrail wrote:
> On 6/12/2019 4:52 AM, Henrik K wrote:
> > Anyone have any idea what rules release package should contain?
> >
> > freemail test doesnt work because Mail-SpamAssassin-4.0.0/rules does not
> > include any 20_freemail*cf files. As they are not in MANIFEST file.
> >
> > Should freemail work out of the box without sa-update run or not? What
> > about the million other .cf files, what's the criteria?
> >
> Do you mean like a release from a distro? As a project, we have a
> release file and a rules file so you can bootstrap without sa-update. I
> wouldn't expect the release to function without either sa-update or a
> bootstrapped rules install.
Bit of a chicken and egg problem here.
If t/freemail.t is included in release.tar.gz, make test won't work. But
all tests are supposed to be included, so someone can test the package? How
can you test the package if rules need to be separately downloaded, should
"make disttest" emulate downloading the rulespackage then?
Suffering flu right now, so not in my fastest mode..
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by Benny Pedersen <me...@junc.eu>.
Kevin A. McGrail skrev den 2019-06-12 14:44:
> Do you mean like a release from a distro? As a project, we have a
> release file and a rules file so you can bootstrap without sa-update.
> I
> wouldn't expect the release to function without either sa-update or a
> bootstrapped rules install.
clamav have atleasst dropped putting cvd's files into tarballs :=)
it could potiential downgrade database, so makes lots of sense to not
put rules into tarballs, enforce sa-update for disstro maintainers makes
more sense
all the best
seen forward to sa 4.0
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by "Kevin A. McGrail" <km...@apache.org>.
On 6/12/2019 4:52 AM, Henrik K wrote:
> Anyone have any idea what rules release package should contain?
>
> freemail test doesnt work because Mail-SpamAssassin-4.0.0/rules does not
> include any 20_freemail*cf files. As they are not in MANIFEST file.
>
> Should freemail work out of the box without sa-update run or not? What
> about the million other .cf files, what's the criteria?
>
Do you mean like a release from a distro? As a project, we have a
release file and a rules file so you can bootstrap without sa-update. I
wouldn't expect the release to function without either sa-update or a
bootstrapped rules install.
--
Kevin A. McGrail
Member, Apache Software Foundation
Chair Emeritus Apache SpamAssassin Project
https://www.linkedin.com/in/kmcgrail - 703.798.0171
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by Henrik K <he...@hege.li>.
I like how regression_tests.cf reads:
# This file contains tests perfomed on `make test`. It should not be
# distributed.
But it's distributed everywhere :-)
On Wed, Jun 12, 2019 at 11:52:11AM +0300, Henrik K wrote:
>
> Anyone have any idea what rules release package should contain?
>
> freemail test doesnt work because Mail-SpamAssassin-4.0.0/rules does not
> include any 20_freemail*cf files. As they are not in MANIFEST file.
>
> Should freemail work out of the box without sa-update run or not? What
> about the million other .cf files, what's the criteria?
>
>
>
> On Mon, Jun 10, 2019 at 11:15:37AM -0400, Kevin A. McGrail wrote:
> > Thanks. There are also some things in make disttest and the xt test that are
> > throwing errors but I'm going to work on an RC without them.
> >
> > After the RC, we can talk about R-T-C, perhaps since I have no expectation RC1
> > would be acceptable.
> >
> > make disttest is throwing these errors for me:
> >
> > Test Summary Report
> > -------------------
> > t/freemail.t (Wstat: 256 Tests: 4 Failed: 1)
> > Failed test: 2
> > Non-zero exit status: 1
> > t/uri_text.t (Wstat: 65280 Tests: 0 Failed: 0)
> > Non-zero exit status: 255
> > Parse errors: Bad plan. You planned 682 tests but ran 0.
> > Files=173, Tests=2353, 820 wallclock secs ( 1.84 usr 0.53 sys + 199.90 cusr
> > 33.76 csys = 236.03 CPU)
> > Result: FAIL
> > Failed 2/173 test programs. 1/2353 subtests failed.
> > make[1]: *** [test_dynamic] Error 255
> > make[1]: Leaving directory `/home/kmcgrail/usr/src/Mail-SpamAssassin/build.tmp/
> > 3.4/Mail-SpamAssassin-3.4.3'
> > make: *** [disttest] Error 2
> >
> >
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by Henrik K <he...@hege.li>.
Anyone have any idea what rules release package should contain?
freemail test doesnt work because Mail-SpamAssassin-4.0.0/rules does not
include any 20_freemail*cf files. As they are not in MANIFEST file.
Should freemail work out of the box without sa-update run or not? What
about the million other .cf files, what's the criteria?
On Mon, Jun 10, 2019 at 11:15:37AM -0400, Kevin A. McGrail wrote:
> Thanks. There are also some things in make disttest and the xt test that are
> throwing errors but I'm going to work on an RC without them.
>
> After the RC, we can talk about R-T-C, perhaps since I have no expectation RC1
> would be acceptable.
>
> make disttest is throwing these errors for me:
>
> Test Summary Report
> -------------------
> t/freemail.t (Wstat: 256 Tests: 4 Failed: 1)
> Failed test: 2
> Non-zero exit status: 1
> t/uri_text.t (Wstat: 65280 Tests: 0 Failed: 0)
> Non-zero exit status: 255
> Parse errors: Bad plan. You planned 682 tests but ran 0.
> Files=173, Tests=2353, 820 wallclock secs ( 1.84 usr 0.53 sys + 199.90 cusr
> 33.76 csys = 236.03 CPU)
> Result: FAIL
> Failed 2/173 test programs. 1/2353 subtests failed.
> make[1]: *** [test_dynamic] Error 255
> make[1]: Leaving directory `/home/kmcgrail/usr/src/Mail-SpamAssassin/build.tmp/
> 3.4/Mail-SpamAssassin-3.4.3'
> make: *** [disttest] Error 2
>
>
Re: warn: Use of uninitialized value in vec at ../lib/Mail/SpamAssassin/SubProcBackChannel.pm
line 104. & warn: Use of uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by "Kevin A. McGrail" <km...@apache.org>.
Thanks. There are also some things in make disttest and the xt test that
are throwing errors but I'm going to work on an RC without them.
After the RC, we can talk about R-T-C, perhaps since I have no expectation
RC1 would be acceptable.
make disttest is throwing these errors for me:
Test Summary Report
-------------------
t/freemail.t (Wstat: 256 Tests: 4 Failed: 1)
Failed test: 2
Non-zero exit status: 1
t/uri_text.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 682 tests but ran 0.
Files=173, Tests=2353, 820 wallclock secs ( 1.84 usr 0.53 sys + 199.90
cusr 33.76 csys = 236.03 CPU)
Result: FAIL
Failed 2/173 test programs. 1/2353 subtests failed.
make[1]: *** [test_dynamic] Error 255
make[1]: Leaving directory
`/home/kmcgrail/usr/src/Mail-SpamAssassin/build.tmp/3.4/Mail-SpamAssassin-3.4.3'
make: *** [disttest] Error 2
And the xt tests:
xt/60_perlcritic.t ..
1..114
ok 1 - Test::Perl::Critic for "../blib/script/sa-awl"
ok 2 - Test::Perl::Critic for "../blib/script/sa-check_spamd"
ok 3 - Test::Perl::Critic for "../blib/script/sa-compile"
ok 4 - Test::Perl::Critic for "../blib/script/sa-learn"
not ok 5 - Test::Perl::Critic for "../blib/script/sa-update"
# Failed test 'Test::Perl::Critic for "../blib/script/sa-update"'
# at /usr/share/perl5/vendor_perl/Test/Perl/Critic.pm line 110.
#
# Perl::Critic found these violations in "../blib/script/sa-update":
# "return" statement with explicit "undef" at line 1637, column 5.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
# "return" statement with explicit "undef" at line 1650, column 5.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
ok 6 - Test::Perl::Critic for "../blib/script/spamassassin"
ok 7 - Test::Perl::Critic for "../blib/script/spamd"
ok 8 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin.pm"
ok 9 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/AICache.pm"
ok 10 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/ArchiveIterator.pm"
ok 11 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/AsyncLoop.pm"
ok 12 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/AutoWhitelist.pm"
ok 13 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Bayes.pm"
ok 14 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/BayesStore.pm"
ok 15 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Client.pm"
ok 16 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Conf.pm"
ok 17 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Constants.pm"
ok 18 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/DBBasedAddrList.pm"
ok 19 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Dns.pm"
ok 20 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/DnsResolver.pm"
ok 21 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/HTML.pm"
ok 22 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Locales.pm"
ok 23 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Locker.pm"
ok 24 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Logger.pm"
ok 25 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/MailingList.pm"
ok 26 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Message.pm"
ok 27 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/NetSet.pm"
ok 28 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/PerMsgLearner.pm"
not ok 29 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/PerMsgStatus.pm"
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/PerMsgStatus.pm"'
# at /usr/share/perl5/vendor_perl/Test/Perl/Critic.pm line 110.
#
# Perl::Critic found these violations in
"../blib/lib/Mail/SpamAssassin/PerMsgStatus.pm":
# Loop iterator is not lexical at line 789, column 5.
# Variables::RequireLexicalLoopIterators (Severity: 5)
# This policy asks you to use `my'-style lexical loop iterator
variables:
#
# foreach my $zed (...) {
# ...
# }
#
# Unless you use `my', `for'/`foreach' loops use a global variable with
# its value `local' to the block. In other words,
#
# foreach $zed (...) {
# ...
# }
#
# is more-or-less equivalent to
#
# {
# local $zed
# foreach $zed (...) {
# ...
# }
# }
#
# This may not seem like a big deal until you see code like
#
# my $bicycle;
# for $bicycle (@things_attached_to_the_bike_rack) {
# if (
# $bicycle->is_red()
# and $bicycle->has_baseball_card_in_spokes()
# and $bicycle->has_bent_kickstand()
# ) {
# $bicycle->remove_lock();
#
# last;
# }
# }
#
# if ( $bicycle and $bicycle->is_unlocked() ) {
# ride_home($bicycle);
# }
#
# which is not going to allow you to arrive in time for dinner with your
# family because the `$bicycle' outside the loop is not changed by the
# loop. You may have unlocked your bicycle, but you can't remember which
# one it was.
#
# Lexical loop variables were introduced in Perl 5.004. This policy does
# not report violations on code which explicitly specifies an earlier
# version of Perl (e.g. `require 5.002;').
ok 30 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/PersistentAddrList.pm"
ok 31 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Plugin.pm"
ok 32 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/PluginHandler.pm"
ok 33 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/RegistryBoundaries.pm"
ok 34 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Reporter.pm"
ok 35 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/SQLBasedAddrList.pm"
ok 36 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/SpamdForkScaling.pm"
ok 37 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/SubProcBackChannel.pm"
ok 38 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Timeout.pm"
not ok 39 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Util.pm"
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Util.pm"'
# at /usr/share/perl5/vendor_perl/Test/Perl/Critic.pm line 110.
#
# Perl::Critic found these violations in
"../blib/lib/Mail/SpamAssassin/Util.pm":
# "return" statement with explicit "undef" at line 1862, column 3.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
# "return" statement with explicit "undef" at line 1869, column 3.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
# "return" statement with explicit "undef" at line 1899, column 5.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
# "return" statement with explicit "undef" at line 1916, column 5.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
# "return" statement with explicit "undef" at line 1920, column 5.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
# "return" statement with explicit "undef" at line 1939, column 3.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
# "return" statement with explicit "undef" at line 1944, column 5.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
ok 40 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Bayes/CombineChi.pm"
ok 41 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Bayes/CombineNaiveBayes.pm"
ok 42 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/BDB.pm"
ok 43 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/DBM.pm"
ok 44 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/MySQL.pm"
ok 45 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm"
ok 46 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/Redis.pm"
ok 47 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/SDBM.pm"
ok 48 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/SQL.pm"
ok 49 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Conf/LDAP.pm"
not ok 50 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Conf/Parser.pm"
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Conf/Parser.pm"'
# at /usr/share/perl5/vendor_perl/Test/Perl/Critic.pm line 110.
#
# Perl::Critic found these violations in
"../blib/lib/Mail/SpamAssassin/Conf/Parser.pm":
# "return" statement with explicit "undef" at line 1134, column 5.
# Subroutines::ProhibitExplicitReturnUndef (Severity: 5)
# Returning `undef' upon failure from a subroutine is pretty common. But
# if the subroutine is called in list context, an explicit `return
undef;'
# statement will return a one-element list containing `(undef)'. Now if
# that list is subsequently put in a boolean context to test for
failure,
# then it evaluates to true. But you probably wanted it to be false.
#
# sub read_file {
# my $file = shift;
# -f $file || return undef; #file doesn't exist!
#
# #Continue reading file...
# }
#
# #and later...
#
# if ( my @data = read_file($filename) ){
#
# # if $filename doesn't exist,
# # @data will be (undef),
# # but I'll still be in here!
#
# process(@data);
# }
# else{
#
# # This is my error handling code.
# # I probably want to be in here
# # if $filname doesn't exist.
#
# die "$filename not found";
# }
#
# The solution is to just use a bare `return' statement whenever you
want
# to return failure. In list context, Perl will then give you an empty
# list (which is false), and `undef' in scalar context (which is also
# false).
#
# sub read_file {
# my $file = shift;
# -f $file || return; #DWIM!
#
# #Continue reading file...
# }
ok 51 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Conf/SQL.pm"
ok 52 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Locker/Flock.pm"
ok 53 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Locker/UnixNFSSafe.pm"
ok 54 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Locker/Win32.pm"
ok 55 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Logger/File.pm"
ok 56 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Logger/Stderr.pm"
ok 57 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Logger/Syslog.pm"
ok 58 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Message/Metadata.pm"
ok 59 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Message/Node.pm"
ok 60 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Plugin/ASN.pm"
ok 61 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Plugin/AWL.pm"
ok 62 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/AccessDB.pm"
ok 63 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/AntiVirus.pm"
ok 64 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/AskDNS.pm"
ok 65 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/AutoLearnThreshold.pm"
ok 66 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Bayes.pm"
ok 67 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/BodyEval.pm"
ok 68 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm"
ok 69 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Check.pm"
ok 70 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Plugin/DCC.pm"
ok 71 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm"
not ok 72 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/DNSEval.pm"
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/DNSEval.pm"'
# at /usr/share/perl5/vendor_perl/Test/Perl/Critic.pm line 110.
#
# Perl::Critic found these violations in
"../blib/lib/Mail/SpamAssassin/Plugin/DNSEval.pm":
# Loop iterator is not lexical at line 550, column 3.
# Variables::RequireLexicalLoopIterators (Severity: 5)
# This policy asks you to use `my'-style lexical loop iterator
variables:
#
# foreach my $zed (...) {
# ...
# }
#
# Unless you use `my', `for'/`foreach' loops use a global variable with
# its value `local' to the block. In other words,
#
# foreach $zed (...) {
# ...
# }
#
# is more-or-less equivalent to
#
# {
# local $zed
# foreach $zed (...) {
# ...
# }
# }
#
# This may not seem like a big deal until you see code like
#
# my $bicycle;
# for $bicycle (@things_attached_to_the_bike_rack) {
# if (
# $bicycle->is_red()
# and $bicycle->has_baseball_card_in_spokes()
# and $bicycle->has_bent_kickstand()
# ) {
# $bicycle->remove_lock();
#
# last;
# }
# }
#
# if ( $bicycle and $bicycle->is_unlocked() ) {
# ride_home($bicycle);
# }
#
# which is not going to allow you to arrive in time for dinner with your
# family because the `$bicycle' outside the loop is not changed by the
# loop. You may have unlocked your bicycle, but you can't remember which
# one it was.
#
# Lexical loop variables were introduced in Perl 5.004. This policy does
# not report violations on code which explicitly specifies an earlier
# version of Perl (e.g. `require 5.002;').
ok 73 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/FreeMail.pm"
ok 74 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/FromNameSpoof.pm"
ok 75 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/HTMLEval.pm"
ok 76 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/HTTPSMismatch.pm"
ok 77 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/HashBL.pm"
ok 78 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Hashcash.pm"
ok 79 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/HeaderEval.pm"
ok 80 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/ImageInfo.pm"
ok 81 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/MIMEEval.pm"
ok 82 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/MIMEHeader.pm"
ok 83 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/OneLineBodyRuleType.pm"
ok 84 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/P595Body.pm"
ok 85 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/PDFInfo.pm"
ok 86 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/PhishTag.pm"
ok 87 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Phishing.pm"
ok 88 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Pyzor.pm"
ok 89 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Razor2.pm"
ok 90 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm"
ok 91 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/RelayEval.pm"
ok 92 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm"
ok 93 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/ResourceLimits.pm"
ok 94 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Reuse.pm"
ok 95 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Rule2XSBody.pm"
ok 96 - Test::Perl::Critic for "../blib/lib/Mail/SpamAssassin/Plugin/SPF.pm"
ok 97 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Shortcircuit.pm"
ok 98 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/SpamCop.pm"
ok 99 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Test.pm"
ok 100 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/TextCat.pm"
ok 101 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/TxRep.pm"
ok 102 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm"
ok 103 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/URIDetail.pm"
ok 104 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/URIEval.pm"
ok 105 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/URILocalBL.pm"
ok 106 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/VBounce.pm"
ok 107 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/WLBLEval.pm"
ok 108 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/WhiteListSubject.pm"
ok 109 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Util/DependencyInfo.pm"
ok 110 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Util/Progress.pm"
ok 111 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Util/ScopedTimer.pm"
ok 112 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Util/TieOneStringHash.pm"
ok 113 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Util/TinyRedis.pm"
ok 114 - Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Message/Metadata/Received.pm"
# Looks like you failed 5 tests of 114.
Dubious, test returned 5 (wstat 1280, 0x500)
Failed 5/114 subtests
Test Summary Report
-------------------
xt/60_perlcritic.t (Wstat: 1280 Tests: 114 Failed: 5)
Failed tests: 5, 29, 39, 50, 72
Non-zero exit status: 5
Files=1, Tests=114, 105 wallclock secs ( 0.10 usr 0.02 sys + 104.51 cusr
0.38 csys = 105.01 CPU)
Result: FAIL
--
Kevin A. McGrail
Member, Apache Software Foundation
Chair Emeritus Apache SpamAssassin Project
https://www.linkedin.com/in/kmcgrail - 703.798.0171
On Mon, Jun 10, 2019 at 3:42 AM Henrik K <he...@hege.li> wrote:
> On Mon, Jun 10, 2019 at 08:12:52AM +0200, Giovanni Bechis wrote:
> > On 6/10/19 3:29 AM, Kevin A. McGrail wrote:
> > > Was working on an RC for 3.4 and fixing raozr2 tests. Noticed odd
> > > output for trunk with the razor2 test.
> > >
> > > Anyone got some cycles to look at that?
> > >
> > Works fine without any warning with Perl 5.28.2, with which Perl version
> are you running tests ?
> > Giovanni
>
> Was missing some (apparently unneeded) selector initialization for
> subproc-backchannel-thingy. Testing few versions it seems, somewhere
> around
> 5.20 perl stopped complaining about uninitialized "vec" argument.
>
> Sending lib/Mail/SpamAssassin/Plugin/Pyzor.pm
> Sending lib/Mail/SpamAssassin/Plugin/Razor2.pm
> Transmitting file data ..done
> Committing transaction...
> Committed revision 1860926.
>
>
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by Henrik K <he...@hege.li>.
On Mon, Jun 10, 2019 at 08:12:52AM +0200, Giovanni Bechis wrote:
> On 6/10/19 3:29 AM, Kevin A. McGrail wrote:
> > Was working on an RC for 3.4 and fixing raozr2 tests. Noticed odd
> > output for trunk with the razor2 test.
> >
> > Anyone got some cycles to look at that?
> >
> Works fine without any warning with Perl 5.28.2, with which Perl version are you running tests ?
> Giovanni
Was missing some (apparently unneeded) selector initialization for
subproc-backchannel-thingy. Testing few versions it seems, somewhere around
5.20 perl stopped complaining about uninitialized "vec" argument.
Sending lib/Mail/SpamAssassin/Plugin/Pyzor.pm
Sending lib/Mail/SpamAssassin/Plugin/Razor2.pm
Transmitting file data ..done
Committing transaction...
Committed revision 1860926.
Re: warn: Use of uninitialized value in vec at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104. & warn: Use of
uninitialized value in scalar assignment at
../lib/Mail/SpamAssassin/SubProcBackChannel.pm line 104.
Posted by Giovanni Bechis <gi...@paclan.it>.
On 6/10/19 3:29 AM, Kevin A. McGrail wrote:
> Was working on an RC for 3.4 and fixing raozr2 tests. Noticed odd
> output for trunk with the razor2 test.
>
> Anyone got some cycles to look at that?
>
Works fine without any warning with Perl 5.28.2, with which Perl version are you running tests ?
Giovanni