Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] [ia64] Fixup breakpoints errors handling
Date: Tue, 08 Sep 2009 17:10:00 -0000	[thread overview]
Message-ID: <20090908170900.GA3223@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20090907183259.GH30677@adacore.com>

On Mon, 07 Sep 2009 20:32:59 +0200, Joel Brobecker wrote:
> On Sat, 05 Sep 2009 21:00:26 +0200, Jan Kratochvil wrote:
> > found out the code could already for example internal_error on uninitialized
> > memory after failed target_read_memory.
[...]
> > 	* ia64-tdep.c (ia64_memory_insert_breakpoint)
> > 	(ia64_memory_remove_breakpoint): Return immediately if any of memory
> > 	reads fail.  Do not combine the VAL values.
> 
> The patch is OK. I'm just curious as to which internal_error was
> triggered? Was it the one inside that function, or did it happen
> elsewhere?

I have not seen any such internal_error being triggered.

Still target_read_memory comment says:
	If an error occurs, no guarantee is made about the contents of the
	data at MYADDR.

Therefore:
  val = target_read_memory (addr, bundle, BUNDLE_LEN);
...
  instr_breakpoint = slotN_contents (bundle, slotnum);
  if (instr_breakpoint == IA64_BREAKPOINT)
    internal_error (__FILE__, __LINE__,

can induce the internal_error if either
(1) target_read_memory would just put random pattern to BUNDLE while failing
    with the bad luck of matching IA64_BREAKPOINT.
or
(2) the autovariable BUNDLE would get randomly initialized to a random
    pattern with the bad luck of matching IA64_BREAKPOINT while failing 
    target_read_memory would not touch the uninitialized content.

I do not think it could happen in the real world.


I will check it in with the other patch.


Thanks,
Jan


  reply	other threads:[~2009-09-08 17:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-05 19:01 Jan Kratochvil
2009-09-07 18:33 ` Joel Brobecker
2009-09-08 17:10   ` Jan Kratochvil [this message]
2009-09-08 18:03   ` 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=20090908170900.GA3223@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.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