Bug 659380

Summary: RFE: run everything under valgrind
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: systemdAssignee: systemd-maint
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: awilliam, jlaska, johannbg, lpoetter, metherid, mitr, mschmidt, notting, plautrba, zbyszek
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-08 04:41:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 784611    

Description Dave Malcolm 2010-12-02 17:01:14 UTC
This is probably a crazy idea, but here goes...

Would it be possible to run systemd under valgrind (with --trace-children=yes), so that the entire user-space can be traced? (and PID 1 becomes "valgrind").

Or have an option to run all of a "unit" under valgrind?

It might make for a useful way for Fedora contributors with fast machines to help find bugs in the software they use.

(This would probably need to be combined with packaging suppression files for various packages across the distribution, to minimize the known false positives: though it strikes me that the disks storing the suppression files might not be mounted yet when errors happen...)

Comment 1 Dave Malcolm 2010-12-02 17:03:01 UTC
(I suspect this can't work without somehow embedding valgrind into a single binary with minimal dependencies; my recollection of the boot process is hazy)

Comment 2 Lennart Poettering 2011-01-04 23:40:14 UTC
Hmm, I don't think there is a real good reason why this should not be possible to do, however this probably needs a bit of work. And you'd probably get completely swamped by false positives... ;-)

Comment 3 Fedora Admin XMLRPC Client 2011-10-20 16:26:08 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Jóhann B. Guðmundsson 2012-02-27 11:14:51 UTC
Ping what's the current status on this?

Comment 5 Zbigniew Jędrzejewski-Szmek 2013-06-10 01:42:07 UTC
I'd be inclined to close this (as FIXED RESOLVED).

A solution which serves the requested purpose is provided by gcc 4.8: recompile systemd package with -fsanitize=address -fno-omit-frame-pointer in CFLAGS.

Running systemd itself under valgrind would require emedding valgrind in systemd... Let's not go there. Running individual services under valgrind is possible and easy by adding an override with a .d conf snippet for ExecStart. Running *everything* under valgrind doesn't really make much sense, one usually runs one just one thing under valgrind and deals with the fallout. Also valgrind is memory expensive, so enabling it for *everything* is quite expensive.

Comment 6 Zbigniew Jędrzejewski-Szmek 2013-08-08 04:41:10 UTC
Closing now.

(To expand on my previous comment: those processes do not share memory, so running one under valgrind, and then a second one, gives the same results as running both simultaneously under valgrind. And as soon a bash or python is used during the boot process, false positives overwhelm. So one really wants to run just select things under valgrind, not the whole system.)