This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] Add --core-pattern option to eu-stack
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 27 Nov 2014 22:47:33 +0100
- Subject: Re: [PATCH] Add --core-pattern option to eu-stack
On Thu, 27 Nov 2014 12:17:39 +0100, Mark Wielaard wrote:
> On Wed, 2014-11-26 at 15:44 +0100, Jan Kratochvil wrote:
> > I was trying to figure out some more generic functionality than --core-pattern
> > but given that for core_pattern one needs to:
> > PTRACE_SEIZE
> > close(0)
> > waitpid()
> > I do not find any part of this sequence separable, do you?
> The close (0) is somewhat odd. I assume it signals the process is done
> with handling the core file data and waitpid () never returns without
> But it does seem somewhat harmless. Are there any bad side effects from
> closing stdin? We don't handle stdin at the moment. Although we could
> maybe add --core=- to be explicit about the core data coming from stdin.
I have discussed reading core file for --core-pattern in my other mail.
> The waitpid () really is just waiting for PTRACE_EVENT_EXIT. So if you
> wrap that in a while loop wouldn't it just work fine too in case the
> user uses it with -p <tid> on a thread that they want to get the
> backtrace of when it exits instead of in a core file pattern handler
= lock-up on waitpid()
close(0); (in a process exec-ing eu-readelf)
= ESRCH; not tested but I find it obvious, the process has disappeared
= ECHILD; not tested but obviously there is no ptraced process
I do not see where a while loop could be applied.