Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201656 - mail-filter/dspam-3.8.0-r8: hash_drv housekeeping (cssclean, csscompress) failures
Summary: mail-filter/dspam-3.8.0-r8: hash_drv housekeeping (cssclean, csscompress) fai...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major
Assignee: Alin Năstac (RETIRED)
URL:
Whiteboard:
Keywords:
: 201660 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-08 07:56 UTC by Dirk Silkenbäumer
Modified: 2007-12-12 06:45 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cssclean.patch (cssclean.patch,5.98 KB, patch)
2007-12-09 11:37 UTC, Alin Năstac (RETIRED)
Details | Diff
cssclean.patch (cssclean.patch,6.00 KB, patch)
2007-12-09 11:42 UTC, Alin Năstac (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Silkenbäumer 2007-12-08 07:56:22 UTC
The housekeeping jobs (dspam.cron) calls cssclean and csscompress to clean the *.css files. 

1. csscompress gives an error when /tmp is mounted seperately cause the temp-file is just renamed:
rename(/tmp/12233.css, /var/spool/dspam/data/local/dirk/dirk.css): Invalid cross-device link

Solution: Save the temp css file in the same directory as the real css file. The temp file has the name PID.css so it will not conflict with any other file name (see cssclean.c).

2. csscompress: no lock file is written. Is that needed

3. cssclean: lock file is in wrong directory:
open("/var/spool/dspam/data/local/data/local/dirk/dirk.lock", O_WRONLY|O_CREAT|O_APPEND, 0666) = 3
open("/var/spool/dspam/data/local/dirk/dirk.css", O_RDWR) = 4

4. cssclean: File permissions of *.css files are wrong after usage:
-rw-r--r-- 1 root root  4837344  8. Dez 08:44 dirk.css

Before running cssclean it was: -rw-rw---- 1 dirk dspam

5. cssclean re-initializes the header counters thus causing dspam to return to training mode even though there is a good history remaining. 
dirk
    TP:     0 TN:     0 FP:     0 FN:     0 SC:     0 NC:     0

Solution: 
> filepos += sizeof(struct _hash_drv_header); 
> } 
> + bcopy (old.header, new.header, sizeof(struct _hash_drv_header)); 
> _ hash_drv_close(&new);


Reproducible: Always

Steps to Reproduce:
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-12-08 09:15:08 UTC
*** Bug 201660 has been marked as a duplicate of this bug. ***
Comment 2 Alin Năstac (RETIRED) gentoo-dev 2007-12-09 11:35:46 UTC
1 and 2) csscompress should probably be removed.

3) I will attach a patch shortly

4) that is impossible. cssclean preserve owner, group and mode of css files.
Comment 3 Alin Năstac (RETIRED) gentoo-dev 2007-12-09 11:37:20 UTC
Created attachment 138068 [details, diff]
cssclean.patch

Please do the following:
  ebuild dspam-3.8.0-r8.ebuild unpack
  apply this patch
  ebuild dspam-3.8.0-r8.ebuild merge
and see if it solves cssclean's problems.
Comment 4 Alin Năstac (RETIRED) gentoo-dev 2007-12-09 11:42:30 UTC
Created attachment 138070 [details, diff]
cssclean.patch

Improved patch.
Comment 5 Dirk Silkenbäumer 2007-12-09 12:37:16 UTC
1. solved
3. lockfile is in same directory as *css
4. csscompress is changing permissions -> my fault
5. headers are fine

If cssclean is doing the job we should remove csscompress from dspam.cron?

csscompress still lacks lock file, preserve owner, .... and header. At least the delete header bug should be fixed.

Thanks for your help!
Comment 6 Alin Năstac (RETIRED) gentoo-dev 2007-12-11 20:55:21 UTC
Fixed in -r9, which no longer installs csscompress.
Comment 7 steveb 2007-12-12 01:03:57 UTC
Why so fast?

cssclean and csscompress do not do the same.
cssclean: rebuilds the hash database, omitting hapaxes.
csscompress: compresses a hash databases extents.

Using cssclean degenerates the learning because hapaxes tokens get deleted. csscompress on the other hand just compresses the hash databases extents.

It is not exactly the same.
Comment 8 Alin Năstac (RETIRED) gentoo-dev 2007-12-12 06:08:24 UTC
The only difference between cssclean and csscompress is hapaxes removal, therefore the csscompress execution in cron script was of no consequences. 
While I agree that hapaxes shouldn't be removed on a daily basis, having another program that simply don't do that is hardly a solution. The solution would require a "last update" field stored in hash records.
Comment 9 steveb 2007-12-12 06:15:18 UTC
(In reply to comment #8)
> The only difference between cssclean and csscompress is hapaxes removal,
> therefore the csscompress execution in cron script was of no consequences. 
> While I agree that hapaxes shouldn't be removed on a daily basis, having
> another program that simply don't do that is hardly a solution. The solution
> would require a "last update" field stored in hash records.
> 
The CSS (CRM114 Sparse Spectra) storage does not have that feature. Date/time is irrelevant for CSS.
Comment 10 Alin Năstac (RETIRED) gentoo-dev 2007-12-12 06:29:09 UTC
(In reply to comment #9)
> The CSS (CRM114 Sparse Spectra) storage does not have that feature. Date/time
> is irrelevant for CSS.

This field would be used only for deciding if hash records can to be removed or not. Otherwise you get stuck with this half baked cssclean.
Comment 11 steveb 2007-12-12 06:45:19 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > The CSS (CRM114 Sparse Spectra) storage does not have that feature. Date/time
> > is irrelevant for CSS.
> 
> This field would be used only for deciding if hash records can to be removed or
> not. Otherwise you get stuck with this half baked cssclean.
> 
I know but this would break the compatibility to CRM114.