Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: jan.kratochvil@redhat.com, gdb-patches@sourceware.org
Subject: Re: [patch+7.5.1] Work around PR libc/13097 "linux-vdso.so.1" #3
Date: Fri, 23 Nov 2012 16:23:00 -0000	[thread overview]
Message-ID: <50AFA2D7.2010207@redhat.com> (raw)
In-Reply-To: <201211231612.qANGCXUC004949@glazunov.sibelius.xs4all.nl>

On 11/23/2012 04:12 PM, Mark Kettenis wrote:
>> Date: Fri, 23 Nov 2012 16:01:03 +0000
>> From: Pedro Alves <palves@redhat.com>
>>
>> This means that looking for relative path DSOs in the file system is
>> currently depending on GDB's current directory.
> 
> Yup, you lose.
> 
>> My favorite is opening a DSO symlink like we /proc/PID/exe.
> 
> That doesn't really help.  If you replace the DSO the symlink will
> point at the new one, not the one loaded by the executable.

No, no, no.   /proc/PID/exe is special.  It's kind of a hard link.   Opening it
opens the old,  before-replacement file.  E.g., try running a program, and
deleting its executable.  You can still open /proc/PID/exe, and it will
open the running program.

>cp /usr/bin/sleep sleep2

>./sleep2 1000&
[1] 26504
>bg
[1]+ ./sleep2 1000 &
>readlink -f /proc/26504/exe
/home/pedro/sleep2
>rm sleep2
>readlink -f /proc/26504/exe
/home/pedro/sleep2 (deleted)
>ls -l /proc/26504/exe
lrwxrwxrwx. 1 pedro pedro 0 Nov 23 16:20 /proc/26504/exe -> /home/pedro/sleep2 (deleted)
>size /proc/26504/exe
   text    data     bss     dec     hex filename
  21645    1200     384   23229    5abd /proc/26504/exe

Let's try replacing it, even:

>echo "hahaha" > sleep2
>size /proc/26504/exe
   text    data     bss     dec     hex filename
  21645    1200     384   23229    5abd /proc/26504/exe

-- 
Pedro Alves


  parent reply	other threads:[~2012-11-23 16:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22 20:17 Jan Kratochvil
2012-11-23 11:30 ` Luis Gustavo
2012-11-23 11:41   ` Jan Kratochvil
2012-11-23 11:59     ` Luis Machado
2012-11-23 12:03 ` Pedro Alves
2012-11-23 12:40   ` Jan Kratochvil
2012-11-23 14:05     ` Luis Machado
2012-11-23 14:07       ` Jan Kratochvil
2012-11-23 16:01     ` Pedro Alves
2012-11-23 16:12       ` Mark Kettenis
2012-11-23 16:17         ` Jan Kratochvil
2012-11-23 16:23         ` Pedro Alves [this message]
2012-11-23 17:28       ` Joel Brobecker
2012-11-23 18:17         ` Jan Kratochvil
2012-11-23 18:22           ` Pedro Alves
2012-11-27 21:58       ` Mike Frysinger
2012-11-27 23:00         ` Matt Rice
2012-11-28  1:12         ` Pedro Alves
2012-11-28 20:39           ` Mike Frysinger
2012-11-28 22:44           ` Jan Kratochvil
2012-11-29  1:07             ` Mike Frysinger
2012-11-23 12:43   ` Mark Kettenis
2012-11-23 16:30 ` H.J. Lu
2012-11-23 18:19   ` Pedro Alves
2012-11-23 18:43     ` Jan Kratochvil
2012-11-25 18:15       ` 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=50AFA2D7.2010207@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    /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