Bug 6214 - compiled body rules doesnt match
Summary: compiled body rules doesnt match
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: sa-compile (show other bugs)
Version: 3.3.0
Hardware: All All
: P1 normal
Target Milestone: 3.3.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-01 09:07 UTC by tonio
Modified: 2009-11-16 18:32 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
sa-compile debug output text/plain None tonio [NoCLA]
with Rule2XSBody active text/plain None tonio [NoCLA]
test with Rule2XSBody inactive text/plain None tonio [NoCLA]
t script demonstrating the bug patch None Justin Mason [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description tonio 2009-10-01 09:07:22 UTC
Created attachment 4543 [details]
sa-compile debug output

i'm running SA 3.3.0 (3.3.0-alpha3-r808953) and i've some problem with
compiled rules.

sa-compile runs without errors, and SA seems to works fine when restarted.
But some body rules are now not detected.

exemple of simple body rule (for testing):

body TONIO_SPAM_TEST            /toniospam/i
describe TONIO_SPAM_TEST        Mentions Generic toniospamtest
score   TONIO_SPAM_TEST 5

if i commented out
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody
in v320.pre, body rules is working again.

I've tested with SA 3.2.5 and it's working fine with Rule2XSBody active.
I've tried to delete compiled rules and compile again: same result.

Some info on my environnement:
debian testing
perl v5.10.0
xsubpp version 2.200401 (from debian perl package)
re2c version 0.13.5-1
Comment 1 Justin Mason 2009-10-01 09:42:29 UTC
could you run "spamassassin -D -Lt < sample-spam.txt" and attach the output of that, too?
Comment 2 tonio 2009-10-01 10:03:13 UTC
Created attachment 4544 [details]
with Rule2XSBody active
Comment 3 tonio 2009-10-01 10:04:27 UTC
Created attachment 4545 [details]
test with Rule2XSBody inactive
Comment 4 tonio 2009-10-01 10:05:09 UTC
i've run the test and it doesnt match. 
If i deactivate Rule2XSBody, test is working.

see attached files
- "with Rule2XSBody active"
- "test with Rule2XSBody inactive"
Comment 5 Mark Martinec 2009-10-15 09:42:20 UTC
The following may or may not be related.
It certainly looks like a bug in interpreting digits as octal numbers:

$ sa-compile

[2408] info: generic: base extraction starting. this can take a while...
[2408] info: generic: extracting from rules of type body_0
Illegal octal digit '9' ignored at /usr/local/lib/perl5/site_perl/5.10.1/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 1079.
Illegal octal digit '9' ignored at /usr/local/lib/perl5/site_perl/5.10.1/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 1079.
[...]
cd /tmp/.spamassassin2408oOVThutmp
cd Mail-SpamAssassin-CompiledRegexpsbody_0
Illegal octal digit '8' ignored at /usr/local/lib/perl5/site_perl/5.10.1/Mail/
 SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 1079, <$fh> line 3268.
Illegal octal digit '9' ignored at /usr/local/lib/perl5/site_perl/5.10.1/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 1079, <$fh> line 3381.
Comment 6 Mark Martinec 2009-11-09 10:25:19 UTC
I can reproduce the problem revealed by test in Comment 4, but I don't know
enough about compiled rules to help here (I don't use it here, not worth the
trouble imo). Bumping up priority.
Comment 7 Justin Mason 2009-11-14 16:38:40 UTC
Created attachment 4574 [details]
t script demonstrating the bug

I _think_ this t script should be passing, if sa-compile is working in trunk.  right now it fails for me :(
Comment 8 Justin Mason 2009-11-16 16:12:30 UTC
yep -- there was a bug there alright.  The fix from bug 6060 was incomplete, and didn't work for one-line body rules (as used by sa-compiled rulesets); hence sa-compiled rules were all missing their hits.  We would have spotted that sooner if I'd been careful enough to add an end-to-end sa-compile test in the first place :(

Anyway, here's the fix:


: 382...; svn commit -m "bug 6214: sa-compile broken by change from bug 6060, fix (and add test)"
Sending        .
Sending        MANIFEST
Sending        lib/Mail/SpamAssassin/Plugin/OneLineBodyRuleType.pm
Adding         t/sa_compile.t
Adding         xt/50_sa_compile.t
Transmitting file data ....
Committed revision 881065.
Comment 9 Mark Martinec 2009-11-16 18:32:29 UTC
> yep -- there was a bug there alright.  The fix from bug 6060 was incomplete,
> and didn't work for one-line body rules (as used by sa-compiled rulesets);

Mea culpa, thanks for finding the missing parameter!