public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [patch] Fix resolving ELF symbols for live PIDs with deleted files
Date: Fri, 29 Aug 2014 22:15:50 +0200	[thread overview]
Message-ID: <20140829201550.GA1979@host2.jankratochvil.net> (raw)
In-Reply-To: 1409306132.4981.13.camel@bordewijk.wildebeest.org

[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]

On Fri, 29 Aug 2014 11:55:32 +0200, Mark Wielaard wrote:
> On Thu, 2014-08-28 at 22:12 +0200, Jan Kratochvil wrote:
> > +# Older Linux (such as 2.6.32) required PTRACE_ATTACH to read /proc/PID/mem.
> > +sleep 60 & p=$!; sleep 0.1
> > +addr=0x$(cat /proc/$p/maps|sed -n 's#^\([0-9a-f]*\)-[0-9a-f]* r[^ ]* 00* .*/sleep$#\1#p'|head -n1)
> > +supported=$[$(dd if=/proc/$p/mem bs=1 skip=$[$addr] count=1|wc -c)]
> > +kill -9 $p
> > +if [ $supported -eq 0 ]; then
> > +  exit 77
> > +fi
>  
> I don't think this check is needed. eu-stack needs to be attached to get
> the register values and dwfl_linux_proc_find_elf makes sure the process
> is attached before calling elf_from_remote_memory.

When I remove the check on 2.6.32 (tested on kernel-2.6.32-431.el6.x86_64) the
testcase really FAILs:
	.../elfutils/src/stack: dwfl_thread_getframes tid 26376 at 0x4006c8 in .../elfutils/tests/deleted: no matching address range

I can debug it further but I guess at least this patch could go in as is (with
the kernel check).


Thanks,
Jan

             reply	other threads:[~2014-08-29 20:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 20:15 Jan Kratochvil [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-08-29 21:00 Mark Wielaard
2014-08-29 20:44 Mark Wielaard
2014-08-29 20:38 Jan Kratochvil
2014-08-29  9:55 Mark Wielaard
2014-08-28 20:12 Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140829201550.GA1979@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).