From owner-freebsd-current@FreeBSD.ORG Tue Nov 17 14:17:14 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9B36106566B; Tue, 17 Nov 2009 14:17:14 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail2.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id AF5288FC21; Tue, 17 Nov 2009 14:17:14 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mail2.sandvine.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Nov 2009 09:17:15 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id C64991160C; Tue, 17 Nov 2009 09:17:13 -0500 (EST) Date: Tue, 17 Nov 2009 09:17:13 -0500 From: Ed Maste To: Robert Watson Message-ID: <20091117141713.GA51251@sandvine.com> References: <3bbf2fe10911160718j7784b311g2980aa02c79bc9ec@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 17 Nov 2009 14:17:15.0371 (UTC) FILETIME=[A9B603B0:01CA6790] Cc: Attilio Rao , freebsd-current@freebsd.org Subject: Re: [PATCH] Let gcore use ptrace interface rather than the procfs X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2009 14:17:15 -0000 On Tue, Nov 17, 2009 at 11:21:52AM +0000, Robert Watson wrote: > On Mon, 16 Nov 2009, Attilio Rao wrote: > > >This patch allows gcore to use the ptrace interface rather than procfs: > >http://www.freebsd.org/~attilio/Sandvine/STABLE_8/gcore/gcore.diff > > > >The main visible effect of that is that gcore can now work on a per-thread > >scope, offering a granularity procfs can't reach. A downside, though, is > >that the process to be targeted is going to be stopped with ptrace. This > >patch has been contributed back by Sandvine Incorporated. Comments, > >reviews and testing are welcome. > > Am I right in thinking that this may run into a number of other issues that > the procfs version didn't: > > - gcore may no longer work on processes that are actively being debugged > with gdb or traced with truss. > > - gcore may cause interruptible system calls in the target process to > return EINTR, and interfere with signal delivery. > > If so, these aren't show-stoppers, but we should make sure they're > documented in the gcore man page. Fixing gcore would be excellent, it got > missed in the initial sweep of things broken by disabling procfs by default. Our original motivation for doing this was to make gcore work with threaded apps, not avoiding procfs, but that's a useful side-effect of the work. Note though that for that purpose it isn't complete; procfs is still used in readmap to read the process' memory map. It looks like we need to find a way to implement readmap without procfs. Thanks, Ed