Commit graph

50 commits

Author SHA1 Message Date
Val S.
72a7592649
Valgrind suppression for false positive in Rust png-decoder crate 2025-10-15 08:31:16 -04:00
Micah Snyder
8b2c81d7bf Valgrind: Adjust statx suppressions
We have 2 new variations on the statx false positive,
this time from calls from the Rust code.
I'm removing the mangled symbol to simplify the rule and accomodate
future variations.
2024-04-09 10:35:22 -04:00
Micah Snyder
8bf70207d5 CMake: Fix LLVM linking issues: libclamav_rust, -ltinfo
We must pass the LLVM library dependencies to the libclamav_rust
build.rs script so it links the libclamav_rust unit test executable with
LLVM.

Also:
- We can remove the libtinfo dependency that was hardcoded for the LLVM
  3.6 support, and must remove it for the build to work on Alpine, macOS.
- Also, increased the libcheck default timeout from 60s to 300s after
  experiencing a failure while testing this.
- Also made one of the valgrind suppressions more generic to account for
  inline optimization differences observed in testing this.
2022-03-09 20:35:42 -08:00
Micah Snyder
390c264480 Tests, Valgrind: suppress jpeg decoder error fp
Observed the following:

7: [INFO]: ==13953== Conditional jump or move depends on uninitialised value(s)
7: [INFO]: ==13953==    at 0x52F1DA5: drop_in_place<core::result::Result<(), std::sync::mpsc::SendError<alloc::vec::Vec<u8, alloc::alloc::Global>>>> (mod.rs:192)
7: [INFO]: ==13953==    by 0x52F1DA5: {closure#0} (multithreaded.rs:77)
7: [INFO]: ==13953==    by 0x52F1DA5: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once (panic.rs:347)
7: [INFO]: ==13953==    by 0x52EB913: do_call<std::panic::AssertUnwindSafe<jpeg_decoder::worker::multithreaded::spawn_worker_thread::{closure#0}>, ()> (panicking.rs:401)
7: [INFO]: ==13953==    by 0x52EB913: try<(), std::panic::AssertUnwindSafe<jpeg_decoder::worker::multithreaded::spawn_worker_thread::{closure#0}>> (panicking.rs:365)
7: [INFO]: ==13953==    by 0x52EB913: catch_unwind<std::panic::AssertUnwindSafe<jpeg_decoder::worker::multithreaded::spawn_worker_thread::{closure#0}>, ()> (panic.rs:434)
7: [INFO]: ==13953==    by 0x52EB913: halt_unwinding<jpeg_decoder::worker::multithreaded::spawn_worker_thread::{closure#0}, ()> (unwind.rs:17)
7: [INFO]: ==13953==    by 0x52EB913: {closure#0}<jpeg_decoder::worker::multithreaded::spawn_worker_thread::{closure#0}> (mod.rs:97)
7: [INFO]: ==13953==    by 0x52EB913: _ZN77_$LT$rayon_core..job..HeapJob$LT$BODY$GT$$u20$as$u20$rayon_core..job..Job$GT$7execute17h0490359412a3f331E.llvm.897720431843799762 (job.rs:167)
7: [INFO]: ==13953==    by 0x50052C0: execute (job.rs:59)
7: [INFO]: ==13953==    by 0x50052C0: execute (registry.rs:749)
7: [INFO]: ==13953==    by 0x50052C0: rayon_core::registry::WorkerThread::wait_until_cold (registry.rs:726)
7: [INFO]: ==13953==    by 0x53007AC: wait_until<rayon_core::latch::CountLatch> (registry.rs:700)
7: [INFO]: ==13953==    by 0x53007AC: main_loop (registry.rs:833)
7: [INFO]: ==13953==    by 0x53007AC: rayon_core::registry::ThreadBuilder::run (registry.rs:55)
7: [INFO]: ==13953==    by 0x5303104: {closure#0} (registry.rs:100)
7: [INFO]: ==13953==    by 0x5303104: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:125)
7: [INFO]: ==13953==    by 0x52FD0AA: {closure#0}<rayon_core::registry::{impl#2}::spawn::{closure#0}, ()> (mod.rs:476)
7: [INFO]: ==13953==    by 0x52FD0AA: call_once<(), std:🧵:{impl#0}::spawn_unchecked::{closure#0}::{closure#0}> (panic.rs:347)
7: [INFO]: ==13953==    by 0x52FD0AA: do_call<std::panic::AssertUnwindSafe<std:🧵:{impl#0}::spawn_unchecked::{closure#0}::{closure#0}>, ()> (panicking.rs:401)
7: [INFO]: ==13953==    by 0x52FD0AA: try<(), std::panic::AssertUnwindSafe<std:🧵:{impl#0}::spawn_unchecked::{closure#0}::{closure#0}>> (panicking.rs:365)
7: [INFO]: ==13953==    by 0x52FD0AA: catch_unwind<std::panic::AssertUnwindSafe<std:🧵:{impl#0}::spawn_unchecked::{closure#0}::{closure#0}>, ()> (panic.rs:434)
7: [INFO]: ==13953==    by 0x52FD0AA: {closure#0}<rayon_core::registry::{impl#2}::spawn::{closure#0}, ()> (mod.rs:475)
7: [INFO]: ==13953==    by 0x52FD0AA: core::ops::function::FnOnce::call_once{{vtable-shim}} (function.rs:227)
7: [INFO]: ==13953==    by 0x53BC4E6: call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> (boxed.rs:1572)
7: [INFO]: ==13953==    by 0x53BC4E6: call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> (boxed.rs:1572)
7: [INFO]: ==13953==    by 0x53BC4E6: std::sys::unix:🧵:Thread:🆕:thread_start (thread.rs:74)
7: [INFO]: ==13953==    by 0x6EF4EA4: start_thread (in /usr/lib64/libpthread-2.17.so)
7: [INFO]: ==13953==    by 0x6C1DB0C: clone (in /usr/lib64/libc-2.17.so)

The issue stems from jpeg decoder error handling.
It appears to be a false positive.
2022-03-02 13:12:59 -07:00
Micah Snyder
618e3b6bcf Valgrind,Tests: Add to more variants of statx suppression 2022-02-23 16:32:26 -07:00
Scott Hutton
a549e1fd90 valgrind: statx() suppression improvements
Reduce rule strictness for variants that appeared on centos 7
2022-01-10 12:18:33 -07:00
Micah Snyder
5691d57ff2 tests: Suppress valgrind FP's caused by Rust std library hack
See:
- https://github.com/fede1024/rust-rdkafka/blob/master/rdkafka.suppressions
- https://sourceware.org/git/?p=valgrind.git;a=commit;h=2a7d3ae768f9e5b29acd5cb743c3fb13640a391c
2022-01-10 12:18:33 -07:00
Andy Ragusa
4db6e1de0a Tests: tune valgrind suppression rule
Handle the case where thrmgr_dispatch_internal was called from somewhere
other than thrmgr_group_dispatch, triggering the valgrind supression
rule.
2021-07-30 14:45:43 -07:00
Micah Snyder
ba51d40625 Add valgrind suppression rule for non-serious clamd leaks
There appear to be minors leak in clamd that can occur when shutting-
down immediately after a command (e.g. RELOAD).

These are causing intermittent clamd test failures.

It seems like they're caused by a thread leaking occasionally,
due to not exiting before the program terminates.

I don't believe these to be a serious issue. Tracking down the exact
cause and crafting a fix for the leaks isn't worth the effort.
This commit adds valgrind suppression rules to stabilize the tests.
2021-07-15 11:46:51 -07:00
Micah Snyder
a746d344df Remove Autotools build system & built-in LLVM
CMake is now required to build.

The built-in LLVM is no longer available.

Also removed support for libltdl calls, which is not used in the CMake
builds, was only used when building with Autotools.

TODO: Fix CMake LLVM support & update to work with modern versions.
2021-05-19 14:20:59 -07:00
Micah Snyder
ffc521c8e8 Update valgrind suppression rule
The previous valgrind suppression rule for wcsrtombs assumed ascii
conversion.  With the clamd & clamscan change to use setlocale() to get
utf8 filenames to work in UnRAR, the wcsrtombs stack trace changed to
use utf8.

This patch supplements valgrind.supp with the new stack trace.  The old
one was left in, just in case.
2020-08-31 13:59:33 -07:00
Micah Snyder
2444a01f19 bb10979: clamd multi-threaded database reload
Offload the DB load to a separate thread and only replace the current
engine instance afterwards.

While reload is pending:
- existing scan requests use the old db (this is unchanged)
- new scan requests are honored instead of blocked and they also use
  the old db (this is new)

After the reload is complete:
- existing scan requests use the old db (this is unchanged)
- new scan requests use the new db (this is unchanged)

The existing engine is refcounted so it'll be eventually freed when no
longer in use.

Reload requests while reload is pending are silently ignored (i.e. It
never forks more than a single reload thread).

Patch courtesy of Alberto Wu. We would also like to thank Julius Plenz
for original work on this issue, as well as Alexander Sulfrian,
Arjen de Korte, David Heidelberg, and Ged Haywood for their work
updating and testing these patches.
2020-07-01 22:06:15 -07:00
Micah Snyder
9b9999d778 Rename core scanning functions
Many of the core scanning functions' names no longer represent their
specific purpose or arguments. This commit aims to make the names more
intuitive. Names are now prefixed with "magic" if they involve
file-typing and file-type parsing. In addition, each function now
includes the type of input being scanned whether its "desc", "fmap", or
"buff". Some of the APIs also now specify "type" to indicate that a type
other than "ANY" may be passed in to select the type rather than use
file type magic for type recognition.

| current name              | new name                          |
| ------------------------- | --------------------------------- |
| magic_scandesc()          | cli_magic_scan()                  |
| cli_magic_scandesc_type() | <delete>                          |
| cli_magic_scandesc()      | cli_magic_scan_desc()             |
| cli_base_scandesc()       | cli_magic_scan_desc_type()        |
| cli_partition_scandesc()  | <delete>                          |
| cli_map_scandesc()        | magic_scan_nested_fmap_type()     |
| cli_map_scan()            | cli_magic_scan_nested_fmap_type() |
| cli_mem_scandesc()        | cli_magic_scan_buff()             |
| cli_scanbuff()            | cli_scan_buff()                   |
| cli_scandesc()            | cli_scan_desc()                   |
| cli_fmap_scandesc()       | cli_scan_fmap()                   |
| cli_scanfile()            | cli_magic_scan_file()             |
| cli_scandir()             | cli_magic_scan_dir()              |
| cli_filetype2()           | cli_determine_fmap_type()         |
| cli_filetype()            | cli_compare_ftm_file()            |
| cli_partitiontype()       | cli_compare_ftm_partition()       |
| cli_scanraw()             | scanraw()                         |
2020-06-03 11:00:40 -04:00
Mickey Sola
e86bd7bd69 valgrind - Fix suppression rules
Fix unrar related suppression rules by cutting one call to wcsrtombs in
each
2020-02-14 08:28:27 -08:00
Mickey Sola
8cfec0b245 valgrind - add supression rule for memcpy_chk false positive 2019-10-02 16:08:29 -04:00
Micah Snyder (micasnyd)
5383eeae49 Adds 3 valgrind suppression rules to ignore the wcsrtombs false positive in UnRAR's unicode.cpp (see line 40). 2019-10-02 16:08:26 -04:00
Steven Morgan
d5b97f4dc2 bb11887 - add valgrind supression rules for FreeBSD. 2017-08-07 17:56:08 -04:00
Mickey Sola
b171157fb1 adding libltdl valgrind supression for newer distros 2016-06-21 12:11:23 -04:00
Kevin Lin
f5b8fb192a unit_tests: valgrind suppression for freebsd 11 dlopen invalid read 2016-04-20 13:03:43 -04:00
Shawn Webb
837e5a9b08 Add valgrind suppression 2014-12-11 12:44:07 -05:00
Shawn Webb
10e821144c Add valgrind suppression rule for OpenSSL globals 2014-03-11 11:27:29 -04:00
Shawn Webb
088d6002f7 mbox valgrind suppression #2 2014-03-04 15:38:31 -05:00
Shawn Webb
b1b3e6a2c8 Add Valgrind suppression for OpenSSL globals. 2014-02-13 08:47:11 -05:00
Shawn Webb
cd5ba2e93d Add a Valgrind suppression rule for a known glibc bug in Ubuntu 13.10.
Ubuntu introduced a non-critical bug in glibc that causes Valgrind to
think that there's a problem.

Sources:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1096826
https://sourceware.org/bugzilla/show_bug.cgi?id=14687
2014-02-05 13:16:35 -05:00
Shawn Webb
bfe26c4e49 Supress valgrind regression to make our debian 6.0 amd64 buildbot happy 2014-02-03 11:46:21 -05:00
Shawn Webb
b8451749d8 Fix off-by-one error. Make Valgrind happy. 2014-01-29 12:57:46 -05:00
David Raynor
cc2243afba valgrind suppression rules for dl_catch_error complaints 2013-08-07 18:55:13 -04:00
Shawn Webb
b814f446ed LLVM leaks a little bit of memory only when the RTLD starts closing everything down. Supress leak in valgrind. 2013-03-12 15:00:07 -04:00
David Raynor
b23fde6835 Suppress zlib valgrind warnings on inflateReset2 2012-06-12 19:09:49 -04:00
Török Edvin
8bf6e781e9 fix distcheck. 2011-10-10 12:07:31 +03:00
Török Edvin
bf8e15ce05 Fix make distcheck 2011-07-14 14:47:12 +03:00
Török Edvin
3c5f686d75 Use automake's parallel tests feature.
This simplifies the various clamd/clamscan tests a lot,
since the valgrind tests can now be parallelized by automake,
and we don't need to do that in the script itself.
2009-09-14 19:02:50 +03:00
Török Edvin
ce6614cc7b more suppressions
git-svn: trunk@4779
2009-02-13 11:36:14 +00:00
Török Edvin
666cef6e66 add suppression for progexit set in signal handler
git-svn: trunk@4778
2009-02-13 11:20:54 +00:00
Török Edvin
c5a47c1922 add some more suppressions
git-svn: trunk@4750
2009-02-12 14:43:28 +00:00
Török Edvin
1523c229e4 add more valgrind suppressions (bb #1283)
git-svn: trunk@4430
2008-11-18 12:55:13 +00:00
Török Edvin
5c97242d80 add more valgrind suppressions (bb #1283, #1286, #1294)
git-svn: trunk@4423
2008-11-17 14:54:23 +00:00
Török Edvin
03ec876ec6 suppress more valgrind race warnings
git-svn: trunk@4310
2008-10-30 10:39:16 +00:00
Török Edvin
1133ea32d9 fix more valgrind warnings
git-svn: trunk@4299
2008-10-28 19:40:30 +00:00
Török Edvin
a0ff88e4af suppress another valgrind warning on Fedora
git-svn: trunk@4298
2008-10-28 19:23:56 +00:00
Török Edvin
02157f0821 suppress valgrind warnings for old libc.
The warning is in __strcpy_chk, but I don't want to suppress a useful warnings in recent libcs,
and there is no way to specify both a function and object in a suppression, so I
suppressed all warnings from libc-2.5 when called from mbox/message.c

git-svn: trunk@4295
2008-10-27 15:39:57 +00:00
Török Edvin
69bf831df5 fix valgrind warnings on Fedora
git-svn: trunk@4293
2008-10-27 13:53:51 +00:00
Török Edvin
034743fdbe suppress a false positive race
* ChangeLog:

git-svn: trunk@4234
2008-10-07 19:35:48 +00:00
Török Edvin
0ef9c88167 add some valgrind suppressions (bb #1189)
git-svn: trunk@4219
2008-10-02 18:55:17 +00:00
Török Edvin
1642ffba29 fix some races in check_clamd.sh
add more valgrind suppressions
better log parsing for valgrind
add mutex to prevent multiple simultaneous forks (bb #1187)

git-svn: trunk@4182
2008-09-16 12:34:40 +00:00
Török Edvin
b8edbb880d clamd/thrmgr.c: fix valgrind warning (bb #1184)
unit_tests: add more valgrind tests, add a reload and a multiscan test (bb #1092)

git-svn: trunk@4175
2008-09-14 14:15:39 +00:00
Török Edvin
503fb9702e we need the other suppression for libc6-dbg
git-svn: trunk@4024
2008-07-29 16:14:49 +00:00
aCaB
9003d944d1 updated vlagrind supp
git-svn: trunk@4022
2008-07-29 16:07:30 +00:00
aCaB
c92b0057f7 test_disasm
git-svn: trunk@4009
2008-07-28 19:22:15 +00:00
Török Edvin
3dcc2d784e more tests for regex
run unit-tests under valgrind if available.


git-svn: trunk@3990
2008-07-25 16:03:04 +00:00