From: Doug Evans <dje@google.com>
To: Sterling Augustine <saugustine@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: Fix for pr16196: Honor fetch limit for strings of known size
Date: Fri, 22 Nov 2013 20:37:00 -0000 [thread overview]
Message-ID: <CADPb22T7uxGzkfZTjdQu3F6a+LS=Esj=3tQ9o=WKt=3ZS1Xbdw@mail.gmail.com> (raw)
In-Reply-To: <CAEG7qUzi0uLcLuLweWURr1d4m+OdZb5MUo9q-imF8mgGtM7=CQ@mail.gmail.com>
On Fri, Nov 22, 2013 at 12:02 PM, Sterling Augustine
<saugustine@google.com> wrote:
> The enclosed patch fixes 16196, which was revealed when an unitialized
> C++ string happened to point to valid memory and had a garbage in the
> size field that happened to look very large. GDB then spins a very
> long time reading invalid memory.
>
> The patch fixes this by enforcing the fetch limit (which, in turn, is
> set by print elements) even when the size of the string is known. This
> makes the function's behavior similar to when the size of the string
> isn't know.
>
> I checked all callers, and it this does not cause any difference in
> behavior, and reveals no new problems in the test-suite.
>
> Thanks
>
> Sterling
>
> 2013-11-22 Sterling Augustine <saugustine@google.com>
>
> PR backtrace/16196:
> * valprint.c (read_string): Set new variable fetchlen based on
> fetchlimit and size. Use it in call to partial_memory_read.
> Update comment.
LGTM.
[There are still other issues, but this patch doesn't have to fix all of them.]
I'd change the "backtrace" in backtrace/16196 to something else, not
sure what though.
"gdb" is always a good fallback. PR gdb/16196.
next prev parent reply other threads:[~2013-11-22 20:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 20:35 Sterling Augustine
2013-11-22 20:37 ` Doug Evans [this message]
2013-11-26 2:58 ` Sterling Augustine
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='CADPb22T7uxGzkfZTjdQu3F6a+LS=Esj=3tQ9o=WKt=3ZS1Xbdw@mail.gmail.com' \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=saugustine@google.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