Bug 4353 - whitelist_addrs.t failing on Solaris 10 with NDBM_File
Summary: whitelist_addrs.t failing on Solaris 10 with NDBM_File
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P5 major
Target Milestone: 3.1.0
Assignee: Justin Mason
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-20 18:32 UTC by Justin Mason
Modified: 2005-05-23 15:57 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
fix patch None Justin Mason [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Mason 2005-05-20 18:32:52 UTC
it fails the last test, test 5.  This appears to be a bug in SDBM_File, or at
least its handling on Solaris.  I suspect it's not a Solaris-specific bug, just
appearing there because I haven't installed DB_File, forcing the AWL to fall
back to SDBM.

I've instrumented the test with -D and some sleeps to get debugs and a chance to
look into the db files, and this is what I see:

Skipping to step 4:

        /local/perl586/bin/perl -T -w ../spamassassin -C log/test_rules_copy 
--siteconfigpath log/localrules.tmp -p log/test_default.cf  -D
--add-addr-to-blacklist whitelist_test@whitelist.spamassassin.taint.org
...
[19586] dbg: auto-whitelist: tie-ing to DB file R/W in
./log/user_state/auto-whitelist
[19586] dbg: auto-whitelist: db-based
whitelist_test@whitelist.spamassassin.taint.org|ip=none scores 0/0
[19586] dbg: auto-whitelist: db-based
whitelist_test@whitelist.spamassassin.taint.org|ip=none scores 0/0
[19586] dbg: auto-whitelist: add_score: new count: 1, new totscore: 100
[19586] dbg: auto-whitelist: DB addr list: untie-ing and unlocking
[19586] dbg: auto-whitelist: DB addr list: file locked, breaking lock
[19586] dbg: locker: safe_unlock: unlink ./log/user_state/auto-whitelist.lock


If I run '../tools/check_whitelist log/user_state/auto-whitelist' at this
stage, I see:

   100.0       (100.0/1)  -- 
whitelist_test@whitelist.spamassassin.taint.org|ip=none

which is correct.  next step:


        /local/perl586/bin/perl -T -w ../spamassassin -C log/test_rules_copy 
--siteconfigpath log/localrules.tmp -p log/test_default.cf  -D -L < data/nice/002
...
[19588] dbg: auto-whitelist: tie-ing to DB file R/W in
./log/user_state/auto-whitelist
[19588] dbg: auto-whitelist: db-based
whitelist_test@whitelist.spamassassin.taint.org|ip=212.17 scores 4/0
[19588] dbg: auto-whitelist: AWL active, pre-score: 0, autolearn score: 0, mean:
undef, IP: 212.17.35.15
[19588] dbg: auto-whitelist: add_score: new count: 5, new totscore: 0
[19588] dbg: auto-whitelist: DB addr list: untie-ing and unlocking
...

check_whitelist says:

     0.0         (0.0/5)  -- 
whitelist_test@whitelist.spamassassin.taint.org|ip=212.17
   100.0       (100.0/1)  -- 
whitelist_test@whitelist.spamassassin.taint.org|ip=none

so it appears it failed to find the "ip=none" entry for some reason.
Comment 1 Justin Mason 2005-05-20 18:33:12 UTC
should be investigated for 3.1.0
Comment 2 Justin Mason 2005-05-20 18:37:16 UTC
actually, it does appear platform-specific -- adding

tstprefs ("
auto_whitelist_db_modules SDBM_File
");

to the whitelist_addrs.t file on linux generates an SDBM db, but does not fail
on test 5.
Comment 3 Justin Mason 2005-05-20 18:42:09 UTC
gotcha.  It's not an SDBM_File, it's using an NDBM_File on Solaris.  removing
"NDBM_File" from the attempted list in Plugin/AWL.pm fixes the problem.

looks like a bug in NDBM_File, and IMO given this we can't support them, and
should remove that module from the attempted list...
Comment 4 Justin Mason 2005-05-20 18:44:33 UTC
Created attachment 2886 [details]
fix

comments?  votes?
Comment 5 Michael Parker 2005-05-20 19:38:59 UTC
I'm personally fine with this, but it will cause anyone who has created an AWL
with NDBM_File problems when they upgrade to 3.1.
Comment 6 Justin Mason 2005-05-23 23:57:43 UTC
actually, not a problem -- SDBM is fully compatible!
http://www.dss.bc.ca/dx/free_databases/sdbm.html