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 2006/05/08 19:38:27 UTC
[Bug 4897] New: Memory Leak using SpamAssassin Perl Module
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
Summary: Memory Leak using SpamAssassin Perl Module
Product: Spamassassin
Version: 3.1.0
Platform: All
OS/Version: Linux
Status: NEW
Severity: major
Priority: P5
Component: spamassassin
AssignedTo: dev@spamassassin.apache.org
ReportedBy: dmatysiak@gmail.com
A perl script using Mail::SpamAssassin to evaluate a piece of text repeatedly
will eventually cause the system to run out of memory and terminate Perl. This
bug has been tested on Solaris (SunOS 5.9) and with SpamAssassin 3.1.0 and Perl
5.8.6, and on Linux 2.6.10-6-386 with SpamAssassin 3.0.2 and Perl 5.8.4.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
------- Additional Comments From dallase@nmgi.com 2006-05-08 18:09 -------
Created an attachment (id=3516)
--> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3516&action=view)
what i use...
attached is the simplified method for how i interact with SA. maybe you'll
find it helpful.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
------- Additional Comments From dallase@nmgi.com 2006-05-08 17:56 -------
your code is causing it. use
----------------------------------
use Mail::SpamAssassin;
my $spamtest = Mail::SpamAssassin->new();
my $message = "This is a sample spam message";
while (1) {
my $mail = $spamtest->parse($message);
my $status = $spamtest->check($mail);
$status->finish();
$mail->finish();
}
$spamtest->finish();
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
------- Additional Comments From dmatysiak@gmail.com 2006-05-08 18:04 -------
(In reply to comment #5)
> your code is causing it. use
> ----------------------------------
>
> use Mail::SpamAssassin;
>
> my $spamtest = Mail::SpamAssassin->new();
> my $message = "This is a sample spam message";
>
> while (1) {
> my $mail = $spamtest->parse($message);
> my $status = $spamtest->check($mail);
> $status->finish();
> $mail->finish();
> }
>
> $spamtest->finish();
>
Okay, I see, thanks! :)
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
------- Additional Comments From dmatysiak@gmail.com 2006-05-08 17:49 -------
Created an attachment (id=3515)
--> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3515&action=view)
Same script as earlier, but with instantiation and finish within loop
see description
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
------- Additional Comments From dmatysiak@gmail.com 2006-05-08 17:42 -------
Created an attachment (id=3514)
--> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3514&action=view)
Simplified Perl script demonstrating bug; watch memory usage.
This Perl script reproduces the bug explained. Watch your memory usage. Memory
usage also goes up much more quickly is the sections below the comments (i.e.
instantiation of the SpamAssassin object and the finishing) are placed into the
loop.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
------- Additional Comments From dmatysiak@gmail.com 2006-05-08 17:47 -------
(In reply to comment #2)
> you need to finish() on each iteration. failing to do that inside the loop
> causes lots of nasties to be left around from what i've seen.
>
Doing this, as I have described, does not keep the system from running out of
memory.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
------- Additional Comments From dallase@nmgi.com 2006-05-08 17:45 -------
you need to finish() on each iteration. failing to do that inside the loop
causes lots of nasties to be left around from what i've seen.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4897] Memory Leak using SpamAssassin Perl Module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4897
dmatysiak@gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From dmatysiak@gmail.com 2006-05-08 18:04 -------
(In reply to comment #6)
> (In reply to comment #5)
> > your code is causing it. use
> > ----------------------------------
> >
> > use Mail::SpamAssassin;
> >
> > my $spamtest = Mail::SpamAssassin->new();
> > my $message = "This is a sample spam message";
> >
> > while (1) {
> > my $mail = $spamtest->parse($message);
> > my $status = $spamtest->check($mail);
> > $status->finish();
> > $mail->finish();
> > }
> >
> > $spamtest->finish();
> >
>
> Okay, I see, thanks! :)
>
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.