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 2014/10/24 11:39:44 UTC

[Bug 7094] New: Spamassassin hangs with 100% CPU for a specific email content

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7094

            Bug ID: 7094
           Summary: Spamassassin hangs with 100% CPU for a specific email
                    content
           Product: Spamassassin
           Version: 3.3.1
          Hardware: HP
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: spamassassin
          Assignee: dev@spamassassin.apache.org
          Reporter: senthil.gv@gmail.com

The Spamassassin hangs for a specific spam email with 100% CPU

Email content is as follows:
-------------------------------------------------------------
-------------------------------------------------------------

Received: from mail2.aecgi.com (unknown [188.244.205.201])
    by hpeprint.com (Postfix) with ESMTP id D7960D9489A
    for <bh...@hpeprint.com>; Sun,  5 Oct 2014 10:39:29 +0000 (UTC)
X-DKIM: OpenDKIM Filter v2.1.3 hpeprint.com D7960D9489A
Authentication-Results: hpeprint.com; dkim=none (no signature);
    dkim-adsp=none
Message-ID: <61...@aecgi.com>
Date: Sun, 5 Oct 2014 14:39:31 +0400
From: Drusy P. <hi...@aecgi.com>
MIME-Version: 1.0
To: Bhsbulldogs_09 <bh...@hpeprint.com>
Subject: SOME JUNK SUBJECT -Bhsbulldogs_09..
Content-Type: text/html; charset=iso-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable
X-printerIdentifier:
[{"printerAddress":"bhsbulldogs_09@hpeprint.com","messageId":36191212,"shardCode":"11S"}]

<html><body><span style=3D"color:#FCFCFC; font-size:1px">Own and he =
noticed terry. Leaving the women were trying. Since this to sit =
with.<br>Maybe we might as much.</span><table width=3D"610"><tr><td><div =
style=3D"color:#FCE7BF; font-family:arial, sans-serif, new york; =
font-size:1px">3G&isin;<span style=3D"color:#117A34; =
font-size:22pt">&#1216;</span>&sup1;vZ<span style=3D"color:#117A34; =
font-size:22pt">N</span>3&#174;b<span style=3D"color:#117A34; =
font-size:22pt">&#262;</span>&#212;&Ccedil;n<span =
style=3D"color:#117A34; font-size:22pt">R</span>&Psi;&#238;2<span =
style=3D"color:#117A34; font-size:22pt">&#398;</span>&or;&#231;9<span =
style=3D"color:#117A34; font-size:22pt">A</span>xF&#226;<span =
style=3D"color:#117A34; font-size:22pt">S</span>gD3<span =
style=3D"color:#117A34; font-size:22pt">&#917;</span>E8&#232;<span =
style=3D"color:#117A34; font-size:22pt"> </span>r5&uArr;<span =
style=3D"color:#117A34; font-size:22pt">S</span>&#186;Zh<span =
style=3D"color:#117A34; font-size:22pt">&#282;</span>x&#241;&ldquo;<span =
style=3D"color:#117A34; font-size:22pt">X</span>Of&#253;<span =
style=3D"color:#117A34; font-size:22pt">&#220;</span>d&#238;E<span =
style=3D"color:#117A34; font-size:22pt">&#506;</span>IC&sum;<span =
style=3D"color:#117A34; =
font-size:22pt">&#315;</span>r&epsilon;&curren;<span =
style=3D"color:#117A34; font-size:22pt"> =
</span>&sup;&Atilde;&asymp;<span style=3D"color:#117A34; =
font-size:22pt">S</span>SI&#166;<span style=3D"color:#117A34; =
font-size:22pt">T</span>21&para;<span style=3D"color:#117A34; =
font-size:22pt">&#1040;</span>TZ&rsaquo;<span style=3D"color:#117A34; =
font-size:22pt">M</span>Y&hArr;V<span style=3D"color:#117A34; =
font-size:22pt">&#304;</span>&uArr;&#172;v<span style=3D"color:#117A34; =
font-size:22pt">N</span>U&#180;x<span style=3D"color:#117A34; =
font-size:22pt">&#260;</span>g&#174;BWell as though they moved =
close</div><span style=3D"color:#F8FCF6; font-size:4px">Paige sighed =
when did this</span><span style=3D"color:#F2E3BF; font-size:21px"><a =
href=3D"http://&#1075;&#1097;&#1081;&#1082;&#1091;&#1092;&#1093;&#46;&#10=
93;&#1089;&#1076;&#1082;&#46;&#1088;&#1092;?xlntwegm&ihzenl"><b><span =
style=3D"color:#F9E1B7; font-size:3px">NX</span>&#262;&#xA0;L =
&#204;&#8201;C &#488;&#Xa0;&#160;&nbsp;&#294;&#xa0;&#200;&ensp;&#340; =
E<span style=3D"color:#FBEABA; =
font-size:1px">kxxos</span>!</b></a></span></td></tr></table><span =
style=3D"color:#F8FAF1">Both and those words as much.<br>Maddie shook =
her feel like. Izzy turned on that much. Uncle terry leaned her feel =
better. When his shoulder as well. Connor waited until it meant you =
need.<br>Ruthie came with one for john asked.</span></body></html>

-------------------------------------------------------------
-------------------------------------------------------------
Command used to reproduce the issue locally: (email-1.txt holds the above
content)
     nohup spamassassin  -D < /home/vm_root/senthil/amavisdHighCPU/email-1.txt
&

-------------------------------------------------------------
-------------------------------------------------------------
top command result showing 100% CPU

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
22016 vm_root   20   0  222m  60m 3448 R 100.0  1.0   4:33.68 spamassassin
-------------------------------------------------------------
-------------------------------------------------------------
Last few lines of Spamassassin Debug Logs are as follows:

Oct 24 14:51:30.070 [22087] dbg: spf: already checked for Received-SPF headers,
proceeding with DNS based checks
Oct 24 14:51:30.070 [22087] dbg: FreeMail: RULE (__freemail_reply)
check_freemail_replyto
Oct 24 14:51:30.070 [22087] dbg: FreeMail: From address: hioioe@aecgi.com
Oct 24 14:51:30.070 [22087] dbg: FreeMail: No Reply-To and From is not
freemail, skipping check
Oct 24 14:51:30.070 [22087] dbg: spf: already checked for Received-SPF headers,
proceeding with DNS based checks
Oct 24 14:51:30.072 [22087] dbg: spf: already checked for Received-SPF headers,
proceeding with DNS based checks
Oct 24 14:51:30.073 [22087] dbg: spf: already checked for Received-SPF headers,
proceeding with DNS based checks
Oct 24 14:51:30.073 [22087] dbg: FreeMail: RULE (__smf_freemail_hdr_replyto)
check_freemail_header
Oct 24 14:51:30.073 [22087] dbg: FreeMail: header Reply-To:addr not found from
mail
Oct 24 14:51:30.074 [22087] dbg: FreeMail: RULE (FREEMAIL_REPLYTO_END_DIGIT)
check_freemail_header regex:\d@
Oct 24 14:51:30.074 [22087] dbg: FreeMail: header Reply-To not found from mail
Oct 24 14:51:30.075 [22087] dbg: FreeMail: RULE (__freemail_replyto)
check_freemail_replyto
Oct 24 14:51:30.075 [22087] dbg: FreeMail: From address: hioioe@aecgi.com
Oct 24 14:51:30.075 [22087] dbg: FreeMail: Reply-To is not freemail, skipping
check
Oct 24 14:51:30.077 [22087] dbg: FreeMail: RULE (__freemail_hdr_replyto)
check_freemail_header
Oct 24 14:51:30.077 [22087] dbg: FreeMail: header Reply-To not found from mail
Oct 24 14:51:30.077 [22087] dbg: spf: cannot get Envelope-From, cannot use SPF
Oct 24 14:51:30.077 [22087] dbg: spf: def_spf_whitelist_from: could not find
useable envelope sender
Oct 24 14:51:30.077 [22087] dbg: spf: already checked for Received-SPF headers,
proceeding with DNS based checks
Oct 24 14:51:30.078 [22087] dbg: spf: already checked for Received-SPF headers,
proceeding with DNS based checks
Oct 24 14:51:30.078 [22087] dbg: FreeMail: RULE (FREEMAIL_ENVFROM_END_DIGIT)
check_freemail_header regex:\d@
Oct 24 14:51:30.078 [22087] dbg: FreeMail: header EnvelopeFrom not found from
mail
Oct 24 14:51:30.078 [22087] dbg: spf: already checked for Received-SPF headers,
proceeding with DNS based checks
Oct 24 14:51:30.079 [22087] dbg: spf: spf_whitelist_from: could not find
useable envelope sender
Oct 24 14:51:30.080 [22087] dbg: rules: running body tests; score so far=4.331
Oct 24 14:51:30.084 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60467 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_1
Oct 24 14:51:30.096 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60351 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_2
Oct 24 14:51:30.108 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60045 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_3
Oct 24 14:51:30.120 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60581 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_4
Oct 24 14:51:30.133 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60473 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_5
Oct 24 14:51:30.145 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60462 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_6
Oct 24 14:51:30.157 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60352 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_7
Oct 24 14:51:30.170 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60691 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_8
Oct 24 14:51:30.183 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60898 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_9
Oct 24 14:51:30.196 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60620 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_10
Oct 24 14:51:30.209 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60314 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_11
Oct 24 14:51:30.223 [22087] dbg: rules: flush_evalstr (add_evalstr) compiling
60168 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_12
Oct 24 14:51:30.233 [22087] dbg: rules: flush_evalstr (run_generic_tests)
compiling 23414 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_0_13
Oct 24 14:51:30.238 [22087] dbg: rules: run_generic_tests - compiling eval
code: body, priority 0
Oct 24 14:51:30.238 [22087] dbg: rules: compiled body tests
Oct 24 14:51:30.419 [22087] dbg: rules: ran body rule __NONEMPTY_BODY ======>
got hit: "P"
----------------------------------------------------------
----------------------------------------------------------
Please help in understanding why spamassassin in hung or entered into a busy
loop. When I formatted the html tags in the email by separating the tags using
newline, the spamassassin executed as expected. Hence, thought that there might
be issue with HTML Parser and upgraded to the latest version(i.e.0.8). But the
issue still persists. 
Please let me know how to proceed further.

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

Re: [Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 10/24/2014 1:46 PM, Benny Pedersen wrote:
>
>> Thanks for the quick response Grail, On applying the 'rules-all' 
>> patch found
>> that the process is hung while running the rule "__SARE_URI_VISIT_US"
>
>> Didn't find any additional information for the rule __SARE_URI_VISIT_US
>
> Sare rules still in use ? :)
>
> I bet if that rule set was removed you did not need to upgrade sa for 
> remove that problem, so still need to remove sare ruleset

I saw a CPU blip with a 3.3.1 install in testing. Mark didn't though.

Re: [Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

Posted by Benny Pedersen <me...@junc.eu>.
> Thanks for the quick response Grail, On applying the 'rules-all' patch found
> that the process is hung while running the rule "__SARE_URI_VISIT_US"

> Didn't find any additional information for the rule __SARE_URI_VISIT_US

Sare rules still in use ? :)

I bet if that rule set was removed you did not need to upgrade sa for 
remove that problem, so still need to remove sare ruleset

[Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

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

--- Comment #5 from vsen <se...@gmail.com> ---
(In reply to Kevin A. McGrail from comment #4)
> Long since resolved issue.  Install a more recent version of SA, please.

Thanks for the quick response Grail, On applying the 'rules-all' patch found
that the process is hung while running the rule "__SARE_URI_VISIT_US"

Also I found some warning messages,
Oct 24 20:00:34.374 [22685] warn: Use of uninitialized value $ns in pattern
match (m//) at /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm line 201.
Oct 24 20:00:34.374 [22685] warn: Use of uninitialized value $family in numeric
ne (!=) at /usr/share/perl5/IO/Socket/INET6.pm line 226.
Oct 24 20:00:34.374 [22685] warn: Use of uninitialized value $family in numeric
ne (!=) at /usr/share/perl5/IO/Socket/INET6.pm line 226.
Oct 24 20:00:34.375 [22685] warn: Use of uninitialized value $fam_listen in
numeric ne (!=) at /usr/share/perl5/IO/Socket/INET6.pm line 226.
Oct 24 20:00:34.375 [22685] warn: Use of uninitialized value $domain in socket
at /usr/lib64/perl5/IO/Socket.pm line 80.
Oct 24 20:00:34.378 [22685] warn: error creating a DNS resolver socket: Address
family not supported by protocol at
/usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm line 235.


Didn't find any additional information for the rule __SARE_URI_VISIT_US and not
sure what exactly is happening

Installing a higher version i.e spamassassin 3.4.0 resolved the issue.

Curious to know what exactly is happening here, something to do with DNS
resolver?

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

[Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

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

--- Comment #6 from Kevin A. McGrail <km...@pccc.com> ---
(In reply to vsen from comment #5)
> Curious to know what exactly is happening here, something to do with DNS
> resolver?

Biggest thing is you are using external rulesets like SARE that are long since
unmaintained.

Recommend 3.4.0 with a well trained BAYES Implementation, current sa-update
ruleset and remove any rulesets you have lying around from years ago though you
can look at extra rulesets like my KAM.cf

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

[Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

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

vsen <se...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |senthil.gv@gmail.com

--- Comment #2 from vsen <se...@gmail.com> ---
Created attachment 5246
  --> https://issues.apache.org/SpamAssassin/attachment.cgi?id=5246&action=edit
spam email causing 100% CPU

spam email requested to be attached

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

[Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

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

--- Comment #3 from Mark Martinec <Ma...@ijs.si> ---
Created attachment 5247
  --> https://issues.apache.org/SpamAssassin/attachment.cgi?id=5247&action=edit
debugging patch to add 'rules-all' facility for old 3.3.1 (backported)

Either apply the attached debugging-aid patch to your 4.5 years old SA
or install a newer version, then enable 'rules-all' debugging facility
and see where it gets stuck:

  $ spamassassin -D all,rules-all <test-mail.eml

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

[Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

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

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |kmcgrail@pccc.com
         Resolution|---                         |INVALID

--- Comment #4 from Kevin A. McGrail <km...@pccc.com> ---
Long since resolved issue.  Install a more recent version of SA, please.

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

[Bug 7094] Spamassassin hangs with 100% CPU for a specific email content

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

--- Comment #1 from AXB <ax...@gmail.com> ---
pls attach sample msg. Inline post is not really usefull

Attachment     ........
Add an attachment (proposed patch, testcase, etc.)

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