public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Cc: Thomas Schwinge <thomas@codesourcery.com>, <gdb@sourceware.org>
Subject: Re: Memory corruption for host double format different from target double format
Date: Fri, 10 Aug 2012 10:37:00 -0000	[thread overview]
Message-ID: <6114731.htKcOdL0z6@qiyao.dyndns.org> (raw)
In-Reply-To: <87ipcrrt16.fsf@schwinge.name>

On Friday, August 10, 2012 11:32:53 AM Thomas Schwinge wrote:
> gdbarch.c:verify_gdbarch:
> 
>     [...]
>       /* Skip verify of float_bit, invalid_p == 0 */
>       if (gdbarch->float_format == 0)
>         gdbarch->float_format = floatformats_ieee_single;
>       /* Skip verify of double_bit, invalid_p == 0 */
>       if (gdbarch->double_format == 0)
>         gdbarch->double_format = floatformats_ieee_double;
>       /* Skip verify of long_double_bit, invalid_p == 0 */
>       if (gdbarch->long_double_format == 0)
>         gdbarch->long_double_format = floatformats_ieee_double;
>     [...]
> 
> That is, if set_gdbarch_double_format has not been called, it will
> default to floatformats_ieee_double -- even though set_gdbarch_double_bit
> may have been called setting it unequal to the 64-bit double format.
> Hmm, and gdbarch.c:verify_gdbarch has the following comment on top of it:
> »Ensure that all values in a GDBARCH are reasonable.«  ;-)

Looks like some checking like this is missing?

  gdbarch->float_format->totalsize <= gdbarch->float_bit
  gdbarch->double_format->totalsize <= gdbarch->double_bit

-- 
Yao (齐尧)

  reply	other threads:[~2012-08-10 10:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 18:19 Thomas Schwinge
2012-08-10  9:33 ` Thomas Schwinge
2012-08-10 10:37   ` Yao Qi [this message]
2012-08-10 12:57     ` Ulrich Weigand
2012-08-10 14:32       ` Mark Kettenis
2012-08-29 15:37         ` Thomas Schwinge
2012-08-30 15:38           ` Thomas Schwinge
2012-09-07  8:20             ` Thomas Schwinge

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=6114731.htKcOdL0z6@qiyao.dyndns.org \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@sourceware.org \
    --cc=thomas@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).