You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2006/05/16 19:28:55 UTC

[Bug 4901] New: fix 'dns: sendto() failed:' error

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901

           Summary: fix 'dns: sendto() failed:' error
           Product: Spamassassin
           Version: 3.1.1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Libraries
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: jm@jmason.org


Subject: Re: SA 99,9% CPU and freeze
From: Mark Martinec <Mark.Martinec+sa.ijs.si>
Date: Tue, 16 May 2006 18:55:25 +0200
To: users.spamassassin.apache.org

> > [1353] warn: dns: sendto() failed:  at
> > /usr/lib/perl5/site_perl/5.8.3/Mail/SpamAssassin/DnsResolver.pm line 340.

The error report in sub bgsend does not show the failure reason
because it mistakenly reports $@ instead of $!, as far as I can tell.
Also, send() returns undef on error according to docs,
a false return does not necessarily indicate an error.

Looks like the code should be changed to:

--- DnsResolver.pm~     Fri Mar 10 20:29:55 2006
+++ DnsResolver.pm      Tue May 16 18:41:12 2006
@@ -337,6 +337,6 @@
   my $data = $pkt->data;
   $self->connect_sock_if_reqd();
-  if (!$self->{sock}->send ($pkt->data, 0)) {
-    warn "dns: sendto() failed: $@";
+  if (!defined($self->{sock}->send ($pkt->data, 0))) {
+    warn "dns: sendto() failed: $!";
     return;
   }


Btw, perhaps calling dbg() instead of warn would less likely
go by unnoticed?

  Mark



--------EOM

patch against 3.1.0 to follow.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] [review] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 1 vote?               |ready for commit




------- Additional Comments From felicity@apache.org  2006-05-23 22:41 -------
Hrm.  Ok, fair enough then I guess.

+1

(In reply to comment #6)
> (In reply to comment #5)
> 
> > The patch generally looks good, but is there a reason to use $! and not
> $resolver->errorstring ?  
> > Something similar to the code in the Net::DNS POD:
> > 
> >              warn "query failed: ", $res->errorstring, "\n";
> 
> Yes... we don't use the Net::DNS resolver here.  Instead we write directly to
> the socket.
> 





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] [review] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901





------- Additional Comments From spamassassin@dostech.ca  2006-05-23 05:29 -------
(In reply to comment #5)

> The patch generally looks good, but is there a reason to use $! and not
$resolver->errorstring ?  
> Something similar to the code in the Net::DNS POD:
> 
>              warn "query failed: ", $res->errorstring, "\n";

Yes... we don't use the Net::DNS resolver here.  Instead we write directly to
the socket.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] [review] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From felicity@apache.org  2006-05-24 17:13 -------
Sending        lib/Mail/SpamAssassin/DnsResolver.pm
Transmitting file data .
Committed revision 409209.

:)



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] [review] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901


spamassassin@dostech.ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |needs 1 vote?




------- Additional Comments From spamassassin@dostech.ca  2006-05-22 03:15 -------
Theo... is that a vote?

+1 for 3.1.2



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] [review] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901





------- Additional Comments From jm@jmason.org  2006-05-22 08:47 -------
theo _did_ change the summary line to include [review], so probably meant to
vote +1. still, better to get that explicitly ;)



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901





------- Additional Comments From jm@jmason.org  2006-05-16 17:30 -------
Created an attachment (id=3517)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3517&action=view)
patch against 310




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] [review] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|fix 'dns: sendto() failed:' |[review] fix 'dns: sendto()
                   |error                       |failed:' error
   Target Milestone|Undefined                   |3.1.2




------- Additional Comments From felicity@apache.org  2006-05-16 17:31 -------
let's put this into 3.1.2



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4901] [review] fix 'dns: sendto() failed:' error

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4901





------- Additional Comments From felicity@apache.org  2006-05-22 14:41 -------
(In reply to comment #4)
> theo _did_ change the summary line to include [review], so probably meant to
> vote +1. still, better to get that explicitly ;)

Actually I was just moving it to the 3.1.2 queue, and since it had a patch I added in the review state.  I 
was planning to review and vote shortly thereafter but got distracted by other things.  :(

The patch generally looks good, but is there a reason to use $! and not $resolver->errorstring ?  
Something similar to the code in the Net::DNS POD:

             warn "query failed: ", $res->errorstring, "\n";




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.