Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 245226 - app-antivirus/clamav-0.94.1rc1 fails when make check under sys-apps/sandbox-1.2.18.1-r2 runs dev-util/valgrind-3.3.1
Summary: app-antivirus/clamav-0.94.1rc1 fails when make check under sys-apps/sandbox-1...
Status: RESOLVED DUPLICATE of bug 235581
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Maurice van der Pot (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-02 04:44 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2008-11-09 12:44 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2008-11-02 04:44:29 UTC
When I use clamav-0.94.1_rc1.ebuild (which I wrote) to install clamav-0.94.1rc1 (clamav-0.94.1 might be release 2008/11/03), make check is run for clamav. This is good and what I want since I have FEATURES=test. However, clamav's scripts run valgrind --tool=helgrind. This picks what valgrind thinks are potential race conditions in /usr/lib/libsandbox.so.0.0.0.


Reproducible: Always

Steps to Reproduce:

To reproduce:
1. If you really want, get my scattered overlay using layman with http://ohnopublishing.net/~ohnobinki/binkioverlay.xml or just grab my clamav ebuilds derived from Portage with rsync://ohnopublishing.net/myoverlay/app-antivirus/
2. Attempt to compile clamav with FEATURES=test
3. See error message from clamav about submitting your valgrind-race.log to clamav's bugzilla, but ignore it because clamav people will tell you "why doesn't your OS have the proper suppressions?".

Or you may be able to reproduce what I see using a multithreaded program that uses the access(2) function call under valgrind --tool=helgrind under a sandbox session.
Actual Results:  
testing the clamav executables fails with similar messages to below in /var/tmp/portage/app-antivirus/clamav-0.94.1_r1/work/clamav*/valgrind-raced.log:

==4200== Possible data race during write of size 4 at 0x4163B80
==4200==    at 0x405ED94: before_syscall (in /usr/lib64/libsandbox.so.0.0.0)
==4200==    by 0x405F1A8: access@@GLIBC_2.2.5 (in /usr/lib64/libsandbox.so.0.0.0)
==4200==    by 0x40B11F: scan (scanner.c:321)
==4200==    by 0x407A25: command (session.c:197)


Expected Results:  
I expected clamav's tests to complete successfully, since outside of sandbox the tests work fine. For instance, appending the following to /usr/lib/valgrind/default.supp fixes all of the helgrind errors for testing clamav under valgrind uner sandbox and lets it install:


# Errors to suppress by default with sandbox
# I only know of "race conditions" that need to be listed here.

{
   sandbox-race-1
   Helgrind:Race
   fun:before_syscall
   obj:/usr/lib*/libsandbox.so*

}

{
   sandbox-race-2
   Helgrind:Race
   fun:egetcwd
   fun:erealpath
   obj:/usr/lib*/libsandbox.so*
}

I think that this and other sandbox-related suppressions should be thrown inside the system-wide /usr/lib/valgrind/default.supp. This way, tests can be made to apps using valgrind's helgrind under the sandbox without having to patch individual ebuilds, like clamav, with a build-system-wide oddity which is sandbox.
Comment 1 Tobias Scherbaum (RETIRED) gentoo-dev 2008-11-06 21:24:36 UTC
re-assigning to valgrind maintainer.

(besides that this looks like a good idea to me)
Comment 2 Maurice van der Pot (RETIRED) gentoo-dev 2008-11-07 10:51:18 UTC
I haven't looked at it yet, but how sure are you these are false positives?
Comment 3 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2008-11-07 19:52:50 UTC
(In reply to comment #2)
> I haven't looked at it yet, but how sure are you these are false positives?
> 

I do not know for sure if they are false positives. However, I do know that ClamAV's running of the helgrind tests are "successful" when make check isn't run under sandbox. I also know they are successful when the suppressions I wrote are added to the defaults suppressions and make check is run under sandbox. I also know that make check doesn't work without my suppressions when run under sandbox.
I'm not sure how sandbox works. Maybe there are problems with it that helgrind has picked up. But sandbox, which is a wrapper for certain calls to libc, may, like libc, do certain things which helgrind thinks _may_ be wrong. I don't know who to ask about the intricacies of sandbox. However, it would seem logical to me that if libc needs suppressions, libsandbox might need ones too.

I'm sorry I didn't make my "reproduction of problem" instructions easier: Just download the clamav-0.94.1 source from clamav.net, extract and use ./configure; make; make check. Then do the same process, making sure to run make check under sandbox. This should make it easier for you to have the time to see the issue I'm having... I hope :-).

Thanks for your consideration of this bug.
Comment 4 SpanKY gentoo-dev 2008-11-09 12:31:21 UTC
before digging too deep, please try svn trunk of sandbox rather than any 1.2.x version
Comment 5 Maurice van der Pot (RETIRED) gentoo-dev 2008-11-09 12:44:19 UTC
I tested it with the svn trunk of sandbox and the issue disappeared, so this is the same as bug #235581.

*** This bug has been marked as a duplicate of bug 235581 ***