Re: [PATCH] Let gcore use ptrace interface rather than the procfs

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Tue, 17 Nov 2009 11:21:52 +0000 (GMT)
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.

Thanks for doing this work,

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Tue Nov 17 2009 - 10:21:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:58 UTC