Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix crash on `info files' with gdbserver
Date: Wed, 08 Feb 2012 21:21:00 -0000	[thread overview]
Message-ID: <4F32E748.5020608@redhat.com> (raw)
In-Reply-To: <20120208204955.GA28565@host2.jankratochvil.net>

On 02/08/2012 08:49 PM, Jan Kratochvil wrote:

> while playing with gdbserver GDB just crashed for me.
> 
> The problem is exec_ops get pushed to the target stack for the loaded shared
> libraries despite exec_bfd remains NULL which is not expected by exec.c.
> 
> Breakpoint 1, add_target_sections (sections=0x21372e0, sections_end=0x2137580) at exec.c:471
> 471               push_target (&exec_ops);
> (gdb) bt
> #0  add_target_sections (sections=0x21372e0, sections_end=0x2137580) at exec.c:471
> #1  in solib_map_sections (so=0x21cd6f0) at solib.c:507
> #2  in update_solib_list (from_tty=1, target=0x1d8fee0) at solib.c:804
> #3  in solib_add (pattern=0x0, from_tty=1, target=0x1d8fee0, readsyms=1) at solib.c:889
> #4  in enable_break (info=0x210f000, from_tty=1) at solib-svr4.c:1624
> #5  in svr4_solib_create_inferior_hook (from_tty=1) at solib-svr4.c:2234
> #6  in solib_create_inferior_hook (from_tty=1) at solib.c:1172
> #7  in reload_shared_libraries (ignored=0x0, from_tty=1, e=0x1fc5cd0) at solib.c:1308
> 
> So it is questionable whether to keep exec_ops unpushed or whether to handle
> NULL exec_bfd there.  I chose the latter.

That's the right choice.  The exec target nowadays handles reading memory
from all target sections, no matter whether they came from the executable
or from shared libraries.  So e.g., "set trust-readonly-sections" works
with the DSOs target sections too.

-- 
Pedro Alves


  reply	other threads:[~2012-02-08 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 20:50 Jan Kratochvil
2012-02-08 21:21 ` Pedro Alves [this message]
2012-02-12 19:16   ` [commit] " 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=4F32E748.5020608@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /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