|
SA Bugzilla – Full Text Bug Listing |
Summary: | untie db first to fix "bayes db version 0 is not able to be used, aborting!" problem | ||
---|---|---|---|
Product: | Spamassassin | Reporter: | Rob Mueller <spamassassin> |
Component: | Learner | Assignee: | SpamAssassin Developer Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | spamassassin4, spamassassin |
Priority: | P2 | ||
Version: | 3.3.2 | ||
Target Milestone: | 3.4.0 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: | |||
Bug Depends on: | |||
Bug Blocks: | 3563 | ||
Attachments: | comitted diff |
Description
Rob Mueller
2013-01-31 01:10:56 UTC
I've just applied this patch to my local DBM.pm module and will see in 24 hours how it's looking. I think this should fix it, but I'll update to confirm what I find. --- --- DBM.pm 2013-01-30 20:20:43.000000000 -0500 +++ /usr/share/perl5/Mail/SpamAssassin/BayesStore/DBM.pm 2013-01-30 20:21:09.000000000 -0500 @@ -175,7 +175,7 @@ my $db_var = 'db_'.$dbname; dbg("bayes: tie-ing to DB file R/O $name"); - # untie %{$self->{$db_var}} if (tied %{$self->{$db_var}}); + untie %{$self->{$db_var}}; if (!tie %{$self->{$db_var}},$self->DBM_MODULE, $name, O_RDONLY, (oct($main->{conf}->{bayes_file_mode}) & 0666)) { @@ -185,6 +185,7 @@ # be writing to it; let the R/W api deal with that case. if ($dbname eq 'seen') { + untie %{$self->{$db_var}}; tie %{$self->{$db_var}},$self->DBM_MODULE, $name, O_RDWR|O_CREAT, (oct($main->{conf}->{bayes_file_mode}) & 0666) or goto failed_to_tie; @@ -290,6 +291,7 @@ ($self->DBM_MODULE eq 'DB_File') and Mail::SpamAssassin::Util::avoid_db_file_locking_bug ($name); + untie %{$self->{$db_var}}; tie %{$self->{$db_var}},$self->DBM_MODULE, $name, O_RDWR|O_CREAT, (oct($main->{conf}->{bayes_file_mode}) & 0666) or goto failed_to_tie; > I've just applied this patch to my local DBM.pm module and will see in 24 > hours how it's looking. I think this should fix it, but I'll update to > confirm what I find. According to perl documentation untie has no effect if the variable is not tied, so your solution looks harmless, and if it avoids the bug so much the better. Thanks! trunk: Bug 6901: untie db first to fix "bayes db version 0 is not able to be used, aborting!" problem Sending lib/Mail/SpamAssassin/BayesStore/DBM.pm Committed revision 1450914. Created attachment 5135 [details]
comitted diff
FYI I've been running with the patch for a few weeks now, and all the error messages are gone, so this definitely fixed the problem for us. Ok, let's consider this closed, thanks for investigating and for reporting the tie issue to CPAN. |