Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 201656
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Alin Năstac <mrness@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Dirk Silkenbäumer <dirk-s@muenster.de>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
cssclean.patch cssclean.patch patch Alin Năstac 2007-12-09 11:37 0000 5.98 KB Details | Diff
cssclean.patch cssclean.patch patch Alin Năstac 2007-12-09 11:42 0000 6.00 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 201656 depends on: Show dependency tree
Bug 201656 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-12-08 07:56 0000
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 From Jakub Moc (RETIRED) 2007-12-08 09:15:08 0000 -------
*** Bug 201660 has been marked as a duplicate of this bug. ***

------- Comment #2 From Alin Năstac 2007-12-09 11:35:46 0000 -------
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 From Alin Năstac 2007-12-09 11:37:20 0000 -------
Created an attachment (id=138068) [details]
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 From Alin Năstac 2007-12-09 11:42:30 0000 -------
Created an attachment (id=138070) [details]
cssclean.patch

Improved patch.

------- Comment #5 From Dirk Silkenbäumer 2007-12-09 12:37:16 0000 -------
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 From Alin Năstac 2007-12-11 20:55:21 0000 -------
Fixed in -r9, which no longer installs csscompress.

------- Comment #7 From steveb 2007-12-12 01:03:57 0000 -------
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 From Alin Năstac 2007-12-12 06:08:24 0000 -------
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 From steveb 2007-12-12 06:15:18 0000 -------
(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 From Alin Năstac 2007-12-12 06:29:09 0000 -------
(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 From steveb 2007-12-12 06:45:19 0000 -------
(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.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug