This is a cherry-pick of a similar commit on the bytecode branch.
There this was needed because the JIT stores pointers mangled (stores an integer in low
bits of the pointer), thus valgrind can't see that pointers to that memory
region still exist, and reports it as definetely lost, instead of still
reachable.
However this seems to happen on master too (where there is no JIT), valgrind
cannot see that everything allocating in engine is reachable from the engine
pointer, and reports some of the memory allocated for the engine (the regex
parts) as possible lost, and reports the rest as still reachable. This seems to
only happen with certain kernel versions, timings, etc.
The fix is to always free the engine, even if this is the parent after the fork.
This occurs because the JIT stores pointers mangled (stores an integer in low
bits of the pointer), thus valgrind can't see that pointers to that memory
region still exist, and reports it as definetely lost, instead of still
reachable.
The fix is to always free the engine, even if this is the parent after the fork.
* master: (60 commits)
Fix build when git is not installed and using BSD make.
Only use -fno-strict-aliasing for gcc-4.3+, to avoid bugs with older compilers (bb #1581).
libclamav/matcher-bm.c: fix cli_bm_freeoff() (bb#1710)
bb#1708
implove poolsize.pl
win32: s/C_WINDOWS/_WIN32/ in clamd, shared
libclamav/matcher-ac.c: fix matching of logical sigs (bb#1707)
libclamav/readdb.c: fix handling of broken .ldb sigs (bb#1701)
libclamav: new signature blacklisting format (bb#1625)
killclamd must always succeed (except when there's a stuck clamd).
Fix typo.
Better error message when clamd gets killed
merge win32 patches from sherpya
remove bogus debug printf
libclamav/matcher-ac.c: add support for line marker (L) (matches CR, CRLF and boundaries)
fix EOL in platform.h
sis.c: fix size check
fix several problems introduced by the win32 commits
fix in cli_is_abspath
win32#3
...
Conflicts:
.gitignore
Makefile.am
configure
configure.in
libclamav/readdb.c
handle multiple %v parameters
introduce poll_fds that also does the read into a buffer
introduce thrmgr_group* commands for keeping track of groups of commands
(multiscan, IDSESSION)
introduce 2 queues in thrmgr, multiscan queues get lower priority. Commands
are processed from both queues in a 4:1 ratio to avoid starvation.
unify reply code: conn_reply*
unify scanner code into scan_callback that is called from cli_ftw
multiscan doesn't need stat() now if readdir() provides dt_type
redesign clamd main loop: there is now an accept thread, and a
recv()/dispatch thread, +MaxThreads worker (scanner) threads.
introduce limiting on commands when worker threads are contended.
introduce IDSESSION, a replacement for the old SESSION command, that allows
asyncronous (scan) commands and scan replies
introduce INSTREAM that allows sending the data to scan on same connection
(vs STREAM that requires another port)
introduce zCOMMANDS
git-svn: trunk@4755
if there is a version.h.static use that instead of output from svnversion
use get_version(), tools outside libclamav shouldn't rely on libclamav version
exception: clamconf itself needs both, and the milter shows both
git-svn: trunk@4076
clamd is unusable on OpenBSD and some other BSD versions without it.
It has a C_BSD wrapper around it so it shouldn't affect anything else.
git-svn: trunk@4060
available, and falls back to locking with a mutex around
ctime(). (ensures we are using the same mutex always).
use cli_ctime() instead of the thread-unsafe ctime().
This fixes stability problems.
git-svn: trunk@3578