Commit Graph

33 Commits

Author SHA1 Message Date
Török Edvin
a7cf187a0c Make cl_load thread safe (bb #2333).
Parallel cl_load() crash (bb #2333).
Reason is twofold:
 - cache.c had 2 'static' global variables, thus trying to initialize same cache
 from multiple threads
  - bytecode2llvm.cpp: something in LLVM 2.7 is crashing when loading in
  parallel

Fix is to drop the 'static' on the variable (cache is per engine already).
This also fixes a potential memory leak in clamd!

The other part of the fix is to turn on the mutex around bytecode compilation
always. We don't call cl_load in parallel, so this doesn't affect clamd, but
some may need to call cl_load in parallel.
2010-11-04 21:53:03 +02:00
Török Edvin
91505254dc Fix build without pthreads bb #1897. 2010-05-07 13:00:11 +03:00
Török Edvin
fa9612e672 support building without pthreads (#1897). 2010-05-07 10:53:18 +03:00
Török Edvin
65cc5979e4 Better fix for found_possibly_unwanted and caching.
We treat found_possibly_unwanted as EMAX, except we can't cache
these at all, not even at their own reclevel, and we certainly can't cache
level0 (since we know it'll be virus).
We are still caching siblings in an archive, as long as they don't hit emax
themselves.
2010-03-10 14:49:22 +02:00
Török Edvin
4933f3449b Revert "don't cache possible unwanted"
This reverts commit 8e47245d4a.
There is a better way to fix this.
2010-03-10 14:38:50 +02:00
aCaB
8e47245d4a don't cache possible unwanted 2010-03-10 01:53:24 +01:00
aCaB
37002feeee remove aborts from cache.c: it's gonna crash anyway :) 2010-03-06 03:40:38 +01:00
aCaB
c5ed82baca cache.c cleanup and minor fixes 2010-03-06 03:10:03 +01:00
aCaB
2b70f02a2a bb#1856 2010-03-05 22:17:46 +01:00
aCaB
aef8d4acbf add spam to cache and magicscan 2010-03-05 17:15:08 +01:00
Török Edvin
f6798708fd Fix some pointer dereferences, and sizeof.
There were some variables initialized with values from dereferenced pointers,
and the null check after the init.
Also sizeof must be applied to pointed to element.
2010-01-15 18:20:22 +02:00
aCaB
52f52931a2 cache final fixes 2010-01-15 03:00:15 +01:00
aCaB
6223810ba0 tie cache to engine 2010-01-14 23:14:55 +01:00
aCaB
d982ac65e3 temp 2010-01-14 16:14:07 +01:00
aCaB
402f4b19d9 caching final 2010-01-14 04:38:31 +01:00
aCaB
08605d2f07 splay + age 2010-01-13 00:03:30 +01:00
aCaB
211fc872d9 track parents 2010-01-11 19:17:22 +01:00
aCaB
5bf3c76350 micro oprimization 2010-01-11 13:10:36 +01:00
Török Edvin
422faf754c Fix infinite loop in lookup.
This happens due to deleted keys filling the hash,
workaround this issue for now, if this is a performance hog
we'll need to periodically clean up the deleted slots by rehashing
elements.
2010-01-11 12:43:21 +02:00
aCaB
1e4d565677 splay replace policy 2010-01-10 20:24:09 +01:00
aCaB
a2c45a6bf5 cache comparisons 2010-01-09 16:21:48 +01:00
aCaB
5b95022bbf splay 2010-01-09 02:19:25 +01:00
aCaB
a6f7b46772 have i fucked it up? 2010-01-08 16:05:02 +01:00
aCaB
64e6c97fdd performance testing 2010-01-08 01:39:25 +01:00
aCaB
607904244a Merge branch 'cache' of git.clam.sourcefire.com:/var/lib/git/clamav-devel into cache 2010-01-07 23:38:33 +01:00
Török Edvin
75c7196180 Fix hash impl when replacing values.
We never remove keys from the hash, we only replace keys that expire due to LRU,
with the new keys. However the new key is not inserted in the same place as the
old one! (it depends where it hashes) So we need to mark the old key as deleted,
and not as empty. Otherwise future searches could miss keys that are in the
hash!
2010-01-06 19:53:07 +02:00
Török Edvin
a99a6040dd a fixed size, LRU hash-based cache. 2010-01-06 19:32:34 +02:00
aCaB
438f0550d6 tests 2010-01-06 17:09:41 +01:00
aCaB
6e11bf6197 add copyright stuff 2010-01-05 19:07:23 +01:00
aCaB
60b2125135 fix clamav-config include, properly restore fmap - thx edwin for the spot! 2010-01-05 18:15:59 +01:00
aCaB
54e6b31f1a cache fixes 2010-01-05 16:37:12 +01:00
aCaB
ea6f1300c4 Merge branch 'cache' 2010-01-05 14:56:33 +01:00
aCaB
511c2e792c cache
cache over 256 trees
2009-08-12 18:01:39 +02:00