SA Bugzilla – Bug 6214
compiled body rules doesnt match
Last modified: 2009-11-16 18:32:29 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
could you run "spamassassin -D -Lt < sample-spam.txt" and attach the output of that, too?
Created attachment 4544 [details] with Rule2XSBody active
Created attachment 4545 [details] test with Rule2XSBody inactive
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"
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.
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.
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 :(
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.
> 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!