Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Subject: Re: [ob] More warnings; Call for assistance
Date: Fri, 20 Jan 2006 23:06:00 -0000	[thread overview]
Message-ID: <20060120230641.GA21181@nevyn.them.org> (raw)
In-Reply-To: <u4q428vj3.fsf@gnu.org>

On Tue, Jan 17, 2006 at 10:11:12PM +0200, Eli Zaretskii wrote:
> > Date: Tue, 17 Jan 2006 14:46:24 -0500
> > From: Daniel Jacobowitz <drow@false.org>
> > 
> > I disagree, because (IIRC) Debian users have filed at least two bugs
> > where failures in this code have led to user input crashing GDB:
> > 
> >   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=186037
> >   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231162
> 
> These aren't crashes, GDB prints a legible error message and returns
> to top level.  However, internal_error is not the best idea for these
> situations, so we probably should arrange for GDB to mutter something
> about possibly bad format instead, and not to ask whether to dump
> core.

I suppose that would work.  And be a good idea if we're not going to
make any other changes here, along with -Wformat-nonliteral.

For reference, it'd actually be "removing -Wformat-nonliteral".  An
earlier message in this thread confused me about what that option did.

> > The advantages of static format checking, in the face of that, are
> > pretty large.
> 
> No matter what you do, as long as users are typing format strings, it
> will always be possible for a format to exceed our wildest
> imagination.  You cannot beat that, unless you are willing to
> artificially restrict users to some safe and/or easily parsable subset
> of valid formats, which I think we shouldn't do.
> 
> > avoid the use of standard printf
> 
> Avoid? how? are you saying that we should write our own version of
> printf?

Certainly we shouldn't write a new one - but the advantage of being a
GNU project and licensed under the GPL is that there's already at least
two we can choose from, probably more :-)

Another major advantage of having our own implementation of printf is that
we could document which format specifiers the GDB "printf" command
supports.  Right now we say "it's the same as if your program had
called printf", which is not necessarily true, e.g. with remote
debugging.

This is what I'd been vaguely planning on doing, but never gotten
around to.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-01-20 23:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-17 15:17 Daniel Jacobowitz
2006-01-17 15:22 ` Daniel Jacobowitz
2006-01-17 19:37   ` Jim Blandy
2006-01-17 19:46     ` Daniel Jacobowitz
2006-01-17 20:11       ` Eli Zaretskii
2006-01-20 23:06         ` Daniel Jacobowitz [this message]
2006-01-21 10:07           ` Eli Zaretskii
2006-01-21 15:18             ` Daniel Jacobowitz
2006-01-17 20:57       ` Jim Blandy
2006-01-17 20:17     ` Eli Zaretskii
2006-01-20 23:09   ` Daniel Jacobowitz
2006-01-17 20:19 ` Eli Zaretskii
2006-01-17 20:23   ` Daniel Jacobowitz
2006-01-17 21:08     ` Eli Zaretskii
2006-01-17 21:14       ` Daniel Jacobowitz
2006-01-18  4:16         ` Eli Zaretskii
2006-01-18  1:15 ` Jim Blandy
2006-01-18 23:33   ` Daniel Jacobowitz

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=20060120230641.GA21181@nevyn.them.org \
    --to=drow@false.org \
    --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