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 2009/10/28 01:52:51 UTC

[Bug 6228] New: sa-learn --backup is broken

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

           Summary: sa-learn --backup is broken
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: spamassassin
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: wtogami@redhat.com


spamassassin-3.3.0 svn816416
perl-5.8.8-27.el5
perl-5.10.0-82.fc12

# sa-learn --backup
Can't call method "backup_database" on an undefined value at /usr/bin/sa-learn
line 295.

https://bugzilla.redhat.com/show_bug.cgi?id=530966
Originally reported here.

How serious is this?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #16 from Mark Martinec <Ma...@ijs.si> 2009-12-17 04:27:13 UTC ---
> streamlining and extra logging in bayes plugin

Does this last patch to Plugin/Bayes.pm succeed in stashing a ref
to a 'store' into both places and the patch to sa-learn isn't needed?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #12 from Anthony Foiani <an...@gmail.com> 2009-12-16 23:42:22 UTC ---
In the process of tracking down this bug, I made these modifications to
SpamAssassin::Logger.  They helped me navigate the code (especially all the
twisty calls that the plugin architecture generates).  This is probably too
verbose for most output, but I thought it might be worth putting here so that
someone could make it an option if they were so inclined.

Just before "sub _loc":

my %short_name_of_file; 

sub _loc_from_caller 
{ 
  my ($package, $file, $line) = @_; 
  unless ( $short_name_of_file{$file} ) 
  { 
    my ( $short_name ) = ( $file =~ m!Mail/(SpamAssassin.*)$! ); 
    $short_name_of_file{$file} = $short_name || $file; 
  } 
  return "$short_name_of_file{$file}($line)"; 
} 

And inside "sub _loc", just before the call to log_message:

  if (my @parent = caller 1 ) 
  { 
      my $loc = _loc_from_caller @parent; 
      if (my @grandparent = caller 2) 
      { 
          $loc = _loc_from_caller(@grandparent) . " -> $loc"; 
      } 
      $message =~ s/^/[$loc] /mg; 
  } 

That makes for very wide log messages (and probably a bit slower), but it was
invaluable in figuring out just how I got to certain log message.

Thanks!

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[review] sa-learn --backup  |sa-learn --backup is broken
                   |is broken                   |

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is fixed in a kludgy way. fix more cleanly

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

Karsten Bräckelmann <gu...@rudersport.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Libraries                   |spamassassin

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|sa-learn --backup is broken |[review] sa-learn --backup
                   |                            |is broken

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #24 from Mark Martinec <Ma...@ijs.si> 2010-01-29 08:30:33 UTC ---
Btw, when analyzing an unrelated problem, I was surprised by two calls
to PerMsgStatus::new (instead of one) during learning.
Inserting a Carp traceback reveals one call from Mail/SpamAssassin/Bayes.pm,
and another from its plugin counterpart Mail/SpamAssassin/Plugin/Bayes.pm .

The first one is accompanied by referral to a Bug 2263:
  # DMK, koppel@ece.lsu.edu:  Hoping that the ultimate fix to bug 2263 will
  # make it unnecessary to construct a PerMsgStatus here.

Not sure if this is related to this topic at all, but it might have a
common solution.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #18 from Mark Martinec <Ma...@ijs.si> 2009-12-17 13:13:20 UTC ---
Created an attachment (id=4612)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4612)
proposed hackish patch

Here is a proposed patch, based on both Anthony's patches
(without the logging change patch).

The hackish smaller part (sa-learn.raw) is copying the plugin bayes
object to where the learner expects it. This will need to be
redesigned one day.

The larger patch section on Plugin/Bayes.pm is just a simplification
(pushed Anthony's suggestion even a bit further) and added debugging,
no change in functionality there.

I tried it on Mail::SpamAssassin::BayesStore::MySQL and on the
default Mail::SpamAssassin::BayesStore::DBM backend, seems to work,
both the sa-learner --dump and --backup, as well as the normal
mail scanning operation with autolearning.

I suggest we roll it in to close this bug, then retarget it
to 3.3.1 for a cleaner solution.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #3 from Warren Togami <wt...@redhat.com> 2009-10-27 18:12:51 UTC ---
Using default v320.pre:
loadplugin Mail::SpamAssassin::Plugin::Bayes

# file ~/.spamassassin/bayes_toks
/home/warren/.spamassassin/bayes_toks: Berkeley DB (Hash, version 8, native
byte-order)

Same issue on RHEL5 and Fedora 12.  sa-learn --ham and --spam work fine, but
not --backup.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

Warren Togami <wt...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P5                          |P1

--- Comment #8 from Warren Togami <wt...@redhat.com> 2009-12-11 10:08:28 UTC ---
Proposing as 3.3.0 blocker.

Any ideas?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is fixed in a kludgy way. fix more cleanly

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

Justin Mason <jm...@jmason.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|sa-learn --backup is broken |sa-learn --backup is fixed
                   |                            |in a kludgy way. fix more
                   |                            |cleanly

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is fixed in a kludgy way. fix more cleanly

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #28 from Mark Martinec <Ma...@ijs.si> 2011-09-24 01:17:33 UTC ---
Closing. This is essentially resolved. Could be improved though...

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is fixed in a kludgy way. fix more cleanly

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.2                       |3.4.0

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is fixed in a kludgy way. fix more cleanly

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

Karsten Bräckelmann <gu...@rudersport.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Group|security                    |
          Component|Security                    |Libraries
         AssignedTo|security@spamassassin.apach |dev@spamassassin.apache.org
                   |e.org                       |

--- Comment #27 from Karsten Bräckelmann <gu...@rudersport.de> 2010-03-23 17:42:31 UTC ---
Moving back off of Security, which got changed by accident during the mass
Target Milestone move.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2
           Severity|major                       |normal

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

--- Comment #20 from Mark Martinec <Ma...@ijs.si> 2009-12-17 15:39:16 UTC ---
(In reply to comment #19)
> +1 .  I don't really like it, but we can get it fixed properly for 3.3.1.
> it particularly needs tests ;)

I don't like it much either, but it seems it is the best we are capable
of accomplishing in a short run. A big thanks to Anthony Foiani
for figuring out the details!

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #4 from Michael Parker <pa...@pobox.com> 2009-10-27 18:33:34 UTC ---
can you run:

sa-learn --debug bayes --backup

and include the output in this bug please.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.0                       |3.3.1
  Status Whiteboard|needs one more vote         |

--- Comment #23 from Mark Martinec <Ma...@ijs.si> 2009-12-18 04:39:57 UTC ---
Retargeting for 3.3.1 for a proper permanent fix.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #11 from Anthony Foiani <an...@gmail.com> 2009-12-16 23:34:28 UTC ---
Ok, I tried to ask learner_new to put $store into both places, but it didn't
seem to register.  Here's a complete kludge that makes the --backup case run...

After $spamtest->init(1) in sa-learn, add this:

# hacky mc hack hack 
if ( $spamtest->{bayes_scanner} ) 
{ 
  foreach my $plugin ( @{ $spamtest->{plugins}->{plugins} } ) 
  { 
    if ( $plugin->isa( 'Mail::SpamAssassin::Plugin::Bayes' ) ) 
    { 
      $spamtest->{bayes_scanner}->{store} = $plugin->{store}; 
    } 
  } 
} 

(Sorry that the style doesn't match the rest of the code, but I was "thinking
out loud", and that means that it was done in my internal default style.  Feel
free to munge as you see fit.)

There are many other better fixes:

1. don't go grovelling into the store directly anyway; define an interface, and
use it.

2. if you must grovel through store, make sure that learner_new puts it in the
right place.

I suspect that whoever did the plugin-ization of the Bayes filter will be able
to implement the correct fix much more elegantly.  But if you need something to
get 3.3.0 out the door, you're welcome to use the above.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #15 from Anthony Foiani <an...@gmail.com> 2009-12-16 23:55:41 UTC ---
Created an attachment (id=4606)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4606)
streamlining and extra logging in bayes plugin

Finally, I wanted to make sure that the store was actually being created; in
the process, I moved things around a little bit.  This patch isn't required,
but it did give me more confidence that things were happening correctly.

(Moving the $store outside the conditional also let me reduce the amount of
conditional code, and use a single debugging log output to make sure we created
/something/.)

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |please review and/or vote

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #5 from Warren Togami <wt...@redhat.com> 2009-10-27 18:35:43 UTC ---
# sa-learn --debug bayes --backup
[10176] dbg: bayes: tie-ing to DB file R/O
/home/warren/.spamassassin/bayes_toks
[10176] dbg: bayes: tie-ing to DB file R/O
/home/warren/.spamassassin/bayes_seen
[10176] dbg: bayes: found bayes db version 3
[10176] dbg: bayes: DB journal sync: last sync: 1256692056
Can't call method "backup_database" on an undefined value at /usr/bin/sa-learn
line 295.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #13 from Anthony Foiani <an...@gmail.com> 2009-12-16 23:52:30 UTC ---
Created an attachment (id=4604)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4604)
very hacky "fix" for 3.3.0

I'm not at all proud of this, but it works.  As I mention above, the original
developer can probably do this much more cleanly.

(Also note, there is a spare line in there that was necessary to add my private
perl5 libs to the search path, since sa-learn inserts the factory setting at
run time.  I apologize for leaving it in, but that's an artifact of me giving
you a patch to something that actually runs; if I removed that line, I would be
modifying the known-good state.  Anyway.)

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #9 from Mark Martinec <Ma...@ijs.si> 2009-12-11 11:59:09 UTC ---
(In reply to comment #8)
> Proposing as 3.3.0 blocker.
> 
> Any ideas?

Just a guess: it may have become broken with pluginization
of Bayes.pm (Mail/SpamAssassin/Bayes.pm ->
   Mail/SpamAssassin/Bayes.pm + Mail/SpamAssassin/Plugin/Bayes.pm )

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #6 from Michael Parker <pa...@pobox.com> 2009-10-27 19:02:01 UTC ---
Certainly is perplexing.

Can you look in the /usr/local/lib/perl5 tree and find the
SpamAssassin/BayesStore directory and see if a) the files exists and b) their
permissions look sane.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #14 from Anthony Foiani <an...@gmail.com> 2009-12-16 23:53:52 UTC ---
Created an attachment (id=4605)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4605)
extra-verbose logging

Here's what I was talking about when I said I added a bit of caller context to
the debug messages.  I admit that these are way too wide -- but again, they let
someone with zero knowledge of the codebase find where things were happening.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|please review and/or vote   |needs one more vote

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #7 from Warren Togami <wt...@redhat.com> 2009-10-27 19:23:01 UTC ---
Fedora 12:
# ls -ld /usr/lib/perl5/vendor_perl/5.10.0/Mail/SpamAssassin/BayesStore/
drwxr-xr-x. 2 root root 4096 2009-09-24 23:32
/usr/lib/perl5/vendor_perl/5.10.0/Mail/SpamAssassin/BayesStore/
# ls -l /usr/lib/perl5/vendor_perl/5.10.0/Mail/SpamAssassin/BayesStore/
total 224
-r--r--r--. 1 root root 42508 2009-08-31 19:25 BDB.pm
-r--r--r--. 1 root root 59815 2009-08-31 19:25 DBM.pm
-r--r--r--. 1 root root 27341 2009-08-31 19:25 MySQL.pm
-r--r--r--. 1 root root 26789 2009-08-31 19:25 PgSQL.pm
-r--r--r--. 1 root root  1933 2009-08-31 19:25 SDBM.pm
-r--r--r--. 1 root root 59178 2009-08-31 19:25 SQL.pm

RHEL5:
# ls -ld /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/BayesStore/
drwxr-xr-x 2 root root 4096 Sep 25 00:51
/usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/BayesStore/
# ls -l /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/BayesStore
total 256
-r--r--r-- 1 root root 42508 Aug 31 19:25 BDB.pm
-r--r--r-- 1 root root 59815 Aug 31 19:25 DBM.pm
-r--r--r-- 1 root root 27341 Aug 31 19:25 MySQL.pm
-r--r--r-- 1 root root 26789 Aug 31 19:25 PgSQL.pm
-r--r--r-- 1 root root  1933 Aug 31 19:25 SDBM.pm
-r--r--r-- 1 root root 59178 Aug 31 19:25 SQL.pm

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

Anthony Foiani <an...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anthony.foiani@gmail.com

--- Comment #10 from Anthony Foiani <an...@gmail.com> 2009-12-16 22:41:41 UTC ---
(In reply to comment #9)
> Just a guess: it may have become broken with pluginization
> of Bayes.pm (Mail/SpamAssassin/Bayes.pm ->
>    Mail/SpamAssassin/Bayes.pm + Mail/SpamAssassin/Plugin/Bayes.pm )

I believe you're correct. [*]

In Plugin/Bayes.pm (around line 1501), "learner_new" creates the backing store
object and assigns it into $self->{store}.  But in that routine, $self is
blessed as:

  Mail::SpamAssassin::Plugin::Bayes=HASH(0x2ed88e0)

When we get back into sa-learn and try to use ->{store} directly, we
$spamtest->{bayes_scanner} which is blessed as:

  Mail::SpamAssassin::Bayes=HASH(0x171f100)

So there's the disconnect.  I'll look at it for a bit longer, but I suspect
that either the plugin needs to assign that store into the legacy object, or
sa-learn needs to be revised to deal with the plugin and not the legacy
interface.

As a hack, I suspect that learner_new could just stick the store in both
places.

[*] I am not at all familiar with the SA codebase, but I've a fair bit of
experience with perl.  Nirik (Kevin Fenzi) asked me to take a look at this.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #2 from Michael Parker <pa...@pobox.com> 2009-10-27 18:07:38 UTC ---
Better question, do they have:

loadplugin Mail::SpamAssassin::Plugin::Bayes

in one of their .pre files?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #17 from Anthony Foiani <an...@gmail.com> 2009-12-17 07:28:49 UTC ---
(In reply to comment #16)
> Does this last patch to Plugin/Bayes.pm succeed in stashing a ref
> to a 'store' into both places and the patch to sa-learn isn't needed?

No, it doesn't.  Sorry, I should have been more clear.

The rest of the patch is still useful; keeping $store in scope across the
entire function is better than assigning it individually inside each branch of
the 'if'.  That's somewhat a taste issue, but the ability to add better
logging/tracing is a technical argument in its favor.

As for trying to stash $store in both places ... I suspect that this patch
could be made to work (and hence get rid of the hack in sa-learn).  I'm either
not putting it in the correct place, or one of the values in this chain:

  $self->{main}->{bayes_scanner}->{store}

Is getting overwritten sometime after 'learner_new' is called.

So I probably should have left that commented out.  Sorry about that.  Someone
who understands the invocation order and relationships between the different
objects should be able to make this work, and hence not need the ugly hack in
sa-learn.

Does that make sense?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is fixed in a kludgy way. fix more cleanly

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

Justin Mason <jm...@jmason.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

--- Comment #1 from Michael Parker <pa...@pobox.com> 2009-10-27 18:03:49 UTC ---
What does their bayes_store_module config say?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

--- Comment #21 from Warren Togami <wt...@redhat.com> 2009-12-17 17:00:09 UTC ---
+1

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

--- Comment #22 from Mark Martinec <Ma...@ijs.si> 2009-12-18 03:53:14 UTC ---
  Bug 6228 - sa-learn --backup is broken:
  a quick-and-hackish temporary solution to a problem
  of Bayes pluginization not (yet) carried out fully
Sending lib/Mail/SpamAssassin/Plugin/Bayes.pm
Sending sa-learn.raw
Committed revision 892229.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] sa-learn --backup is broken

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

Warren Togami <wt...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|Undefined                   |3.3.0

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6228] [review] sa-learn --backup is broken

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

Justin Mason <jm...@jmason.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jm@jmason.org

--- Comment #19 from Justin Mason <jm...@jmason.org> 2009-12-17 13:48:46 UTC ---
+1 .  I don't really like it, but we can get it fixed properly for 3.3.1.  it
particularly needs tests ;)

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.