Skip Menu |

This queue is for tickets about the Mail-SPF CPAN distribution.

Report information
The Basics
Id: 39099
Status: open
Priority: 0/
Queue: Mail-SPF

People
Owner: Nobody in particular
Requestors: schubert [...] jla.rutgers.edu
Cc: Dan [...] DWright.Org
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: v2.8.0



Subject: 'Build test' fails for Mail-SPF-v2.006 on Solaris 9 with perl 5.6.1
Date: Mon, 08 Sep 2008 13:53:38 -0400
To: bug-Mail-SPF [...] rt.cpan.org
From: Brian Schubert <schubert [...] jla.rutgers.edu>
Package: Mail-SPF-v2.006 Perl version: 5.6.1 Operating System: Solaris 9 sparc 'Build test' fails with the following output: ./Build test Copying lib/Mail/SPF/Record.pm -> blib/lib/Mail/SPF/Record.pm Copying lib/Mail/SPF/Mech/IP6.pm -> blib/lib/Mail/SPF/Mech/IP6.pm Copying lib/Mail/SPF/MacroString.pm -> blib/lib/Mail/SPF/MacroString.pm Copying lib/Mail/SPF/Mech/MX.pm -> blib/lib/Mail/SPF/Mech/MX.pm Copying lib/Mail/SPF/Mod/Redirect.pm -> blib/lib/Mail/SPF/Mod/Redirect.pm Copying lib/Mail/SPF/Mech/A.pm -> blib/lib/Mail/SPF/Mech/A.pm Copying lib/Mail/SPF.pm -> blib/lib/Mail/SPF.pm Copying lib/Mail/SPF/Mod.pm -> blib/lib/Mail/SPF/Mod.pm Copying lib/Mail/SPF/Exception.pm -> blib/lib/Mail/SPF/Exception.pm Copying lib/Mail/SPF/Mech/Include.pm -> blib/lib/Mail/SPF/Mech/Include.pm Copying lib/Mail/SPF/Term.pm -> blib/lib/Mail/SPF/Term.pm Copying lib/Mail/SPF/Mech/PTR.pm -> blib/lib/Mail/SPF/Mech/PTR.pm Copying lib/Mail/SPF/v1/Record.pm -> blib/lib/Mail/SPF/v1/Record.pm Copying lib/Mail/SPF/Mech/Exists.pm -> blib/lib/Mail/SPF/Mech/Exists.pm Copying lib/Mail/SPF/Server.pm -> blib/lib/Mail/SPF/Server.pm Copying lib/Mail/SPF/SenderIPAddrMech.pm -> blib/lib/Mail/SPF/SenderIPAddrMech.pm Copying lib/Mail/SPF/Mod/Exp.pm -> blib/lib/Mail/SPF/Mod/Exp.pm Copying lib/Mail/SPF/Result.pm -> blib/lib/Mail/SPF/Result.pm Copying lib/Mail/SPF/Mech/All.pm -> blib/lib/Mail/SPF/Mech/All.pm Copying lib/Mail/SPF/Mech/IP4.pm -> blib/lib/Mail/SPF/Mech/IP4.pm Copying lib/Mail/SPF/Request.pm -> blib/lib/Mail/SPF/Request.pm Copying lib/Mail/SPF/v2/Record.pm -> blib/lib/Mail/SPF/v2/Record.pm Copying lib/Mail/SPF/Base.pm -> blib/lib/Mail/SPF/Base.pm Copying lib/Mail/SPF/Mech.pm -> blib/lib/Mail/SPF/Mech.pm Copying lib/Mail/SPF/Util.pm -> blib/lib/Mail/SPF/Util.pm Copying bin/spfquery -> blib/script/spfquery Deleting blib/script/spfquery.bak Copying sbin/spfd -> blib/sbin/spfd t/00.00-class-misc..Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib t/00.00-class-misc..ok t/00.01-class-util..Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib t/00.01-class-util..ok t/00.02-class-request.Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib t/00.02-class-request.ok t/00.03-class-result.Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib t/00.03-class-result.NOK 6 # Failed test 'Param-rethrown result object isa Mail::SPF::Result' # at t/00.03-class-result.t line 40. # Param-rethrown result object isn't a reference Can't locate object method "server" via package "Can't locate object method "throw" via package "Can't locate object method "code" via package "Mail::SPF::Result" (perhaps you forgot to load "Mail::SPF::Result"?) at /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib/lib/Mail/SPF/Result.pm line 217. " (perhaps you forgot to load "Can't locate object method "code" via package "Mail::SPF::Result" (perhaps you forgot to load "Mail::SPF::Result"?) at /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib/lib/Mail/SPF/Result.pm line 217. "?) at t/00.03-class-result.t line 37. " (perhaps you forgot to load "Can't locate object method "throw" via package "Can't locate object method "code" via package "Mail::SPF::Result" (perhaps you forgot to load "Mail::SPF::Result"?) at /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib/lib/Mail/SPF/Result.pm line 217. " (perhaps you forgot to load "Can't locate object method "code" via package "Mail::SPF::Result" (perhaps you forgot to load "Mail::SPF::Result"?) at /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib/lib/Mail/SPF/Result.pm line 217. "?) at t/00.03-class-result.t line 37. "?) at t/00.03-class-result.t line 41. # Looks like you planned 20 tests but only ran 6. # Looks like you failed 1 test of 6 run. # Looks like your test died just after 6. t/00.03-class-result.dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 6-20 Failed 15/20 tests, 25.00% okay t/00.04-class-server.Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib t/00.04-class-server.ok t/00.05-class-macrostring.Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib t/00.05-class-macrostring.ok t/00.99-class-misc..Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib t/00.99-class-misc..ok t/10.00-rfc4408.....Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib skipped: Mail::SPF::Test required for testing Mail::SPF's RFC compliance t/10.01-rfc4406.....Using /usr/local/src/rpm-packages/BUILD/Mail-SPF-v2.006/blib skipped: Mail::SPF::Test required for testing Mail::SPF's RFC compliance t/90-author-pod-validation.skipped: Test::Pod 1.00 required for testing POD validity Failed Test Status Wstat Total Fail Failed List of Failed -------------------------------------------------------------------------------- t/00.03-class-result.t 255 65280 20 15 75.00% 6-20 3 tests skipped. Failed 1/10 test scripts, 90.00% okay. 15/132 subtests failed, 88.64% okay. Thank you, Brian Schubert
I apologize for my very, very late response. It seems like something went wrong with how your Perl threw a Mail::SPF result object and caught it via eval(). Are you still experiencing this?
Hello, I'm seeing this same issue: root@rt# perl -Mblib t/00.03-class-result.t ... not ok 6 - Param-rethrown result object isa Mail::SPF::Result # Failed test 'Param-rethrown result object isa Mail::SPF::Result' # at t/00.03-class-result.t line 40. # Param-rethrown result object isn't a 'Mail::SPF::Result' it's a '' Can't locate object method "server" via package "Can't locate object method "throw" via package "Can't locate object method "code" via package "Mail::SPF::Result" at /root/.cpan/build/Mail-SPF-v2.007/blib/lib/Mail/SPF/Result.pm line 217. " (perhaps you forgot to load "Can't locate object method "code" via package "Mail::SPF::Result" at /root/.cpan/build/Mail-SPF-v2.007/blib/lib/Mail/SPF/Result.pm line 217. Looking in the code of t/00.03-class-result.t, I see this: 35 eval { 36 eval { throw Mail::SPF::Result('server', 'request', 'result text') }; sub throw() is calling $self->new() (where $self='Mail::SPF::Result') $self->new() is calling $self->code() $self->code() doesn't seem to be implemented in Mail::SPF::Result. Instead, the pod states: "This method is abstract and must be implemented by sub-classes of Mail::SPF::Result." It looks like according to CPAN Testers, version 2.007 has 298 pass reports. So, clearly I'm missing something. But I'm not sure what it is, or why this is failing for me. Any help?
Dan & Brian, On 2011-02-18 20:34:30, DWRIGHT wrote: Show quoted text
> Looking in the code of t/00.03-class-result.t, I see this: > > 35 eval { > 36 eval { throw Mail::SPF::Result('server', 'request', > 'result text') }; > > > sub throw() is calling $self->new() (where $self='Mail::SPF::Result') > > $self->new() is calling $self->code()
Dan, this is the step that I'm unable to follow. Where do you see that? Mail::SPF::Result::new() doesn't call code() anywhere. Dan & Brian, can you still reproduce this? If so, what are your current Perl versions?
I made a change to t/00.03-class-result.t that hopefully fixes this weird error: http://search.cpan.org/diff?from=Mail-SPF-v2.007&to=Mail-SPF-v2.8.0#t/00.03-class-result.t or http://lnk.nu/search.cpan.org/1wt7 Please let me know if you can still reproduce this with 2.007 but not with 2.008.
CC: julian [...] mehnle.net
Subject: Re: [rt.cpan.org #39099] 'Build test' fails for Mail-SPF-v2.006 on Solaris 9 with perl 5.6.1
Date: Mon, 30 Jan 2012 15:35:57 -0500
To: bug-Mail-SPF [...] rt.cpan.org
From: Daniel Wright <Dan [...] DWright.Org>
On Jan 30, 2012, at 2:30 AM, Julian Mehnle via RT wrote: Show quoted text
>> $self->new() is calling $self->code()
> > Dan, this is the step that I'm unable to follow. Where do you see that? > Mail::SPF::Result::new() doesn't call code() anywhere. > > Dan & Brian, can you still reproduce this? If so, what are your current > Perl versions?
Hello, Yes. I can still reproduce it in version 2.8.0. This is perl, v5.8.0 built for i386-freebsd The problem appears to be in this code from the test file 00.03-class-result.t: 35 eval { 36 eval { throw Mail::SPF::Result('server', 'request', 'result text') }; 37 $@->throw('other server', 'other request', 'other text'); 38 }; 39 my $result = $@; 40 41 isa_ok($result, 'Mail::SPF::Result', 'Param-rethrown result object'); 42 is($result->server, 'other server', 'Param-rethrown result server()'); Please take a look at this perl debugger output: root@rt# perl -d -Mblib t/00.03-class-result.t Loading DB routines from perl5db.pl version 1.19 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. 1..20 ok 1 - use Mail::SPF::Result; main::(t/00.03-class-result.t:20): my $result = eval { Mail::SPF::Result->new('dummy server', 'dummy request', 'result text') }; DB<1> b 37 DB<2> c ok 2 - Basic result object isa Mail::SPF::Result ok 3 - Basic result server() ok 4 - Basic result request() ok 5 - Basic result text() main::(t/00.03-class-result.t:37): $@->throw('other server', 'other request', 'other text'); DB<2> x $@ 0 'Can\'t locate object method "code" via package "Mail::SPF::Result" at /root/.cpan/build/Mail-SPF-v2.8.0/blib/lib/Mail/SPF/Result.pm line 217. ' Your call to throw in line 36 is failing and assigning the following text to $@: 'Can\'t locate object method "code" via package "Mail::SPF::Result" at /root/.cpan/build/Mail-SPF-v2.8.0/blib/lib/Mail/SPF/Result.pm line 217.' Then line 37 is trying to find a package name matching that entire string and call the method "throw" on it. That fails, which ends up with a very long and confusing error message about not being able to call "throw" on that package. The whole error gets thrown into $@ again, and that gets assigned to $result in line 39. Then in line 41, it fails the isa test because it's a string, not a blessed object. Then in line 42, everything crashes because the method "server" is called on the very long string which Perl thinks is a package name. But this time, there's no eval block, so the entire test file crashes. As for why the initial throw() died in line 36.. take a look at the stack backtrace I got from the Perl debugger below. This is from inside Mail::SPF::Result::name() right before it crashes on the above referenced line 217: DB<2> T @ = Mail::SPF::Result::name(ref(Mail::SPF::Result)) called from file `/root/.cpan/build/Mail-SPF-v2.8.0/blib/lib/Mail/SPF/Result.pm' line 336 $ = Mail::SPF::Result::stringify(ref(Mail::SPF::Result), undef, '') called from file `/usr/local/lib/perl5/5.8.0/perl5db.pl' line 3131 $ = DB::dbdie(ref(Mail::SPF::Result)) called from file `/root/.cpan/build/Mail-SPF-v2.8.0/blib/lib/Mail/SPF/Result.pm' line 197 . = Mail::SPF::Result::throw('Mail::SPF::Result', 'server', 'request', 'result text') called from file `t/00.03-class-result.t' line 36 . = eval {...} called from file `t/00.03-class-result.t' line 36 . = eval {...} called from file `t/00.03-class-result.t' line 35 At first I thought that somehow this call to die was calling $self to be stringified: 197 die($Error::THROWN = $self); But then I realized that DB::dbdie() is a replacement for the real die() added by the perl debugger. So, it's possible we have a bit of a Heisenbug. What I do know for certain is that somehow name() is getting called when you call throw() and that is calling the abstract method code(). Looking at your comments in your code, it seems this potential failure condition was anticipated: 213 # This method being implemented here does not make it any less abstract, 214 # because the code() method it uses is still abstract. 215 sub name { 216 my ($self) = @_; 217 return $self->code; 218 } Again, I'm completely baffled why this is passing for other people. My recommendation is to create a fully-implemented mock subclass for Result and test that rather than trying to make method calls on the abstract base class. Let me know if there's anything else you need me to test. Thanks, -Dan
The problem seems to be that the Mail::SPF::Result object gets stringified, which calls the "name" method, which calls the "code" method. I don't understand why the stringification is happening in your case, but I have a hunch the reason is specific to Perl 5.8.0 and certain older Perls.