From owner-freebsd-hackers@freebsd.org Wed Sep 13 16:30:53 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C31DFE04517 for ; Wed, 13 Sep 2017 16:30:53 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2CB96CB78; Wed, 13 Sep 2017 16:30:53 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 462385A9F12; Wed, 13 Sep 2017 16:30:46 +0000 (UTC) Date: Wed, 13 Sep 2017 16:30:46 +0000 From: Brooks Davis To: "Ngie Cooper (yaneurabeya)" Cc: Mariusz Zaborski , FreeBSD Hackers Subject: Re: Bypassing libcasper (for fun and profit)...? Message-ID: <20170913163046.GB89845@spindle.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2017 16:30:53 -0000 On Mon, Sep 11, 2017 at 01:55:13PM -0700, Ngie Cooper (yaneurabeya) wrote: > Hi Mariusz, > I???m trying to get runtime coverage to work on ^/projects/runtime-coverage . I noticed that libcasper is unfortunately getting in the way of writing .gcda files via install(1) (libgcov and libprofile_rt hijack binaries and libraries to write out profiling information at runtime, which doesn???t seem to jive with libcasper). I assume install(1) won???t be the only program to have this issue, so a generic solution should probably be implemented. > I was wondering if there???s a way that you would like to design a formalized hook to bypass this, was wondering if you think conditionally compiling out the functions (as stubs) was the proper way to do it (security vs flexibility), have the the library implement weak symbols and override with another library using strong symbols as a bypass, or use a combination of LD_PRELOAD and hooks to disable libcasper/turn the calls into warnings (instead of fatal errors). I attempted to suggest solutions and then realized that I don't understand the problem. How does install interact with libgcov and libprofile_rt? -- Brooks