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 2007/07/12 17:51:48 UTC

[Bug 5557] New: temp files not removed

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5557

           Summary: temp files not removed
           Product: Spamassassin
           Version: 3.2.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P5
         Component: spamassassin
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: nstsupport@byteplant.com


A Windows build of SpamAssassin.exe, created with perl 5.8.7, sometimes fails 
to clean up OK after itself.

Some 3.2.1 users were reporting thousands of leftover tmp files after a few 
days of running 3.2.1. And no, SpamAssassin.exe was not forcibly killed with 
TerminateProcess() or similar.

The exe built from SpamAssassin 3.1.7 still works fine, so something happened 
along the way.

I hope someone out there is able to confirm this problem, and is able to 
reproduce this more reliably.

This bug might be related to bug #5444.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


spamassassin@dostech.ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 2 votes for 3.2       |needs 1 votes for 3.2




------- Additional Comments From spamassassin@dostech.ca  2007-11-06 12:17 -------
+1



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From nstsupport@byteplant.com  2007-08-13 02:56 -------
We are calling spamassassin from our SMTP proxy directly
"spamassassin -x -c ruleset -e 255"
(no spamc/spamd).
The temp file issue seems to have started with SA 3.2.0.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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





------- Additional Comments From orjan@olindesign.com  2007-09-19 05:35 -------
(In reply to comment #14)
> oops -- not fixed!  this is still an issue for 3.2.x, and needs confirmation
> that the fix as applied *works*.

I can confirm that it works under Windows. No temp files are being left anymore.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From jm@jmason.org  2007-07-19 10:36 -------
reminder from bug 5444: if the calling code calls $permsgstatus->finish(), then
we may have a bug to fix in SA.

otherwise, the calling code needs to be fixed to call ->finish(), which has been
required (but unenforced until now) since SA 3.0.0.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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





------- Additional Comments From jm@jmason.org  2008-02-06 06:46 -------
(In reply to comment #20)
> On both Linux and Windows some temp files are still not removed when
> spamassassin receives a signal. 

please open this as a new issue. thanks!



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|temp files not removed      |[review] temp files not
                   |                            |removed on win32
  Status Whiteboard|                            |needs 2 votes for 3.2
   Target Milestone|Undefined                   |3.2.4






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From jm@jmason.org  2007-08-23 04:45 -------
Per Kristian Hove, via mail, noted:


'Hi, I apologize for sending this directly to you, but
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5557 didn't let
me provide input without registering, which I at the moment don't have
time to do. (Also, if you forward this information to somebody, please
leave out my email address. Thanks in advance).

We see similar issues on Solaris 8 with SpamAssassin 3.2.3 invoked as
a filter from ".qmail" files (no spamd/spamc configuration, only a
single message per invocation of spamassassin).

This happens when spamassassin dies with SIGPIPE, which seems to
happen occationally. Could the reason be an internal bug in
spamassassin? (When dying with SIGPIPE, it doesn't get the chance to
run the cleanup-on-exit procedures). No other filters invoked from
.qmail have this problem, so the cause of the SIGPIPE is unlikely to
be the pipe that spamassassin gets from qmail as stdin.

Also, in most (but not all) of the cases, the temp files left behind
appears in pairs: there are often 2 temp files created by the same
process:

-rw-------  1 xxx      xxx    54642 Aug 23 11:10 .spamassassin20499BnIaSstmp
-rw-------  1 xxx      xxx    71048 Aug 23 11:10 .spamassassin20499Z5fMKptmp

etcetera.


-- 
Per Kristian Hove <....>
Chief engineer, Dept. of Mathematical Sciences
Norwegian University of Science and Technology'




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


jm@jmason.org changed:

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




------- Additional Comments From jm@jmason.org  2007-12-16 13:34 -------
added to 3.2.x: r604715



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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





------- Additional Comments From dwing@fuggles.com  2007-09-19 09:10 -------
Confirmed here, too -- that patch fixes the problem on Win32 and temporary files
are no longer left around.





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


jm@jmason.org changed:

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




------- Additional Comments From jm@jmason.org  2008-02-11 13:05 -------
re-closing, as noted, please open a new issue.

I've checked in the quick 4-line fix for kill_handler, though, to
svn trunk...

: jm 406...; svn commit -m "bug 5557: additional tempfile cleanup in
kill_handler part of spamassassin script" spamassassin.raw
Sending        spamassassin.raw
Transmitting file data .
Committed revision 620609.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From r.gruyters@yirdis.nl  2007-08-13 00:03 -------
I've got similar issues on my FreeBSD system.

-rw-------  1 mailnull  wheel  13110 Aug 12 21:34 /tmp/.spamassassin89241ESdKdwtmp
-rw-------  1 mailnull  wheel  23161 Aug 12 11:05 /tmp/.spamassassin89241FYNO81tmp
-rw-------  1 mailnull  wheel  13110 Aug 12 21:34 /tmp/.spamassassin89241JGI9jEtmp
-rw-------  1 mailnull  wheel   7336 Aug 12 18:57 /tmp/.spamassassin89241JgFEbXtmp
-rw-------  1 mailnull  wheel  19150 Aug 13 05:35 /tmp/.spamassassin89241JkL0aptmp
-rw-------  1 mailnull  wheel  24154 Aug 13 06:23 /tmp/.spamassassin89241KIeq7Htmp
-rw-------  1 mailnull  wheel  20348 Aug 12 04:01 /tmp/.spamassassin89241LPCXBdtmp
-rw-------  1 mailnull  wheel  24154 Aug 13 06:23 /tmp/.spamassassin89241QJElAdtmp
-rw-------  1 mailnull  wheel  37313 Aug 13 03:48 /tmp/.spamassassin89241Qm44Outmp
-rw-------  1 mailnull  wheel  41771 Aug 13 03:48 /tmp/.spamassassin89241TQHQXltmp
-rw-------  1 mailnull  wheel  41771 Aug 13 03:48 /tmp/.spamassassin89241W5I2lCtmp
-rw-------  1 mailnull  wheel  18818 Aug 12 19:49 /tmp/.spamassassin89241WEFYgftmp
-rw-------  1 mailnull  wheel   7336 Aug 12 18:57 /tmp/.spamassassin89241kzMXrjtmp
-rw-------  1 mailnull  wheel  23161 Aug 12 11:05 /tmp/.spamassassin89241ozlyuVtmp
-rw-------  1 mailnull  wheel  18818 Aug 12 19:49 /tmp/.spamassassin89241u26x6Atmp
-rw-------  1 mailnull  wheel  19150 Aug 13 05:35 /tmp/.spamassassin89241wZHM8Rtmp
-rw-------  1 mailnull  wheel  37313 Aug 13 03:48 /tmp/.spamassassin89241xYqRfytmp
-rw-------  1 mailnull  wheel  20348 Aug 12 04:01 /tmp/.spamassassin89241yhTyPOtmp

Issue started when I installed SA version 3.2.1.

OS: FreeBSD server 6.2-RELEASE-p5 FreeBSD 6.2-RELEASE-p5 #4: Thu May 31 10:58:52
CEST 2007





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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


parchondous@hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |parchondous@hotmail.com






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


Bug 5557 depends on bug 5626, which changed state.

Bug 5626 Summary: [review] "spamassassin" script needs signal handlers
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5626

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From jm@jmason.org  2007-08-13 02:33 -------
R, Thomas --

how are you calling SA?   directly via procmail and spamc, or with Amavis, Exim,
Mailscanner, etc.?  Is there any process that could be killing the spamd
processes  with kill -9 or kill -15?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


jm@jmason.org changed:

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




------- Additional Comments From jm@jmason.org  2007-09-18 06:13 -------
applied to 3.3.0 trunk as r576895.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |5626




------- Additional Comments From jm@jmason.org  2007-08-24 09:35 -------
(In reply to comment #8)
> We see similar issues on Solaris 8 with SpamAssassin 3.2.3 invoked as
> a filter from ".qmail" files (no spamd/spamc configuration, only a
> single message per invocation of spamassassin).
> 
> This happens when spamassassin dies with SIGPIPE, which seems to
> happen occationally. Could the reason be an internal bug in
> spamassassin? (When dying with SIGPIPE, it doesn't get the chance to
> run the cleanup-on-exit procedures). No other filters invoked from
> .qmail have this problem, so the cause of the SIGPIPE is unlikely to
> be the pipe that spamassassin gets from qmail as stdin.

this is now opened (separately) as bug 5626.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From orjan@olindesign.com  2007-09-18 04:41 -------
This bug (on Windows at least) happens because the temp files are not closed 
before deletion is attempted.

Non-text mime parts are stored in temp files, and these files are not closed in 
the finish() code in message.pm before they are deleted.
Adding:

    if (ref $part->{'raw'} eq 'GLOB') {
      # Make sure the file is closed it if it's a temp file -- Bug 5557
      close ($part->{'raw'});
    }

to the cleanup of Message::Node part in finish() and moving:

  # delete temporary files
  if ($self->{'tmpfiles'}) {
    unlink @{$self->{'tmpfiles'}};
    delete $self->{'tmpfiles'};
  }

to the end of finish() fixes the problem.
Bug 5626 is probably not related to this bug.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


jm@jmason.org changed:

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




------- Additional Comments From jm@jmason.org  2007-09-18 06:40 -------
oops -- not fixed!  this is still an issue for 3.2.x, and needs confirmation
that the fix as applied *works*.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From nstsupport@byteplant.com  2007-08-13 02:23 -------
same thing happens with a standard SA 3.2.2 installation on debian.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From nstsupport@byteplant.com  2007-08-13 06:02 -------
Yes, this happens from time to time e.g. when a sending MTA disconnects
unexpectedly.
We did not have any problems doing this with pre-3.2.0 SA releases.
It would be great if you could give us some more details on the temp file
behaviour related changes in the 3.2 release.
Is there anything we can do to make SA clean up its temp files under these
conditions, e.g. another way to terminate a running SA? I can imagine that other
SA users also have this issue.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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


dwing@fuggles.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dwing@fuggles.com






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


nstsupport@byteplant.com changed:

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




------- Additional Comments From nstsupport@byteplant.com  2008-02-06 06:36 -------
On both Linux and Windows some temp files are still not removed when
spamassassin receives a signal. 
Adding 

  if (defined $tempfile) {
    unlink $tempfile;
    $tempfile = undef;
  }

at the end of kill_handler in the spamassassin script helps, but temp files
created through

my $tmpf = $permsgstatus->create_fulltext_tmpfile($fulltext);

in dccproc_lookup (line 526 in the DCC.pm plugin) will still not be cleaned up
properly.
Any ideas to resolve this?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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


James.Wilkinson@sparex.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |James.Wilkinson@sparex.co.uk






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From jm@jmason.org  2007-09-18 06:09 -------
(In reply to comment #10)
> This bug (on Windows at least) happens because the temp files are not closed 
> before deletion is attempted. [...]

Thanks, that seems likely to be it!  well spotted.

I'll attach that fix as a patch -- would appreciate if you/others could try it
out and report if it works for you.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] [review] temp files not removed on win32

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


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 1 votes for 3.2       |ready to commit for 3.2




------- Additional Comments From sidney@sidney.com  2007-12-16 04:27 -------
+1



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From jm@jmason.org  2007-08-13 03:12 -------
yeah, 3.2.0 normalizes the temp file behaviour cross-platform, so behaviour that
would be buggy on win32 is now buggy on all platforms, for consistency. ;)

Do you ever interrupt a running spamassassin process?





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5557] temp files not removed

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





------- Additional Comments From jm@jmason.org  2007-09-18 06:10 -------
Created an attachment (id=4125)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4125&action=view)
fix as patch




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.