From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] mdebugread.c (psymtab_to_symtab_1): assert that 'fh' is not null
Date: Sun, 06 Mar 2011 19:05:00 -0000 [thread overview]
Message-ID: <20110306185355.GB22789@host1.jankratochvil.net> (raw)
In-Reply-To: <4D73D67F.1030704@vmware.com>
On Sun, 06 Mar 2011 19:46:23 +0100, Michael Snyder wrote:
> All these recent submissions of mine are coming from running Coverity
> on gdb. In this case, Coverity reports that we checked the variable fh
> for null (suggesting that we think null is possible), but then
> dereferenced it on an unchecked path.
>
> I figured that triggering an assert was more gracefull than just
> crashing on a null pointer dereference, and gives the user the chance
> to recover.
I agree from the user point of view it may be (slightly) better (*).
But from the GDB developers point of view this change without any specific
code comment is not acceptable (as explained in my mail) as it confuses the
code readers.
I would find perfect:
/* FIXME: FH may be NULL here but the code below cannot handle it. */
gdb_assert (fh);
Thanks,
Jan
(*) In fact I like the crash from the Fedora point of view better as ABRT
(Automatic Bug Reporting Tool) will automatically report it. In the case
of a failed gdb_assert the user may or may not allow the core dump and
therefore the crash bugreport by ABRT may be suppressed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
This is just FYI and it should not be related to FSF GDB maintenance.
next prev parent reply other threads:[~2011-03-06 18:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-04 22:15 Michael Snyder
2011-03-06 16:17 ` Jan Kratochvil
2011-03-06 18:54 ` Michael Snyder
2011-03-06 19:05 ` Jan Kratochvil [this message]
2011-03-07 16:53 ` Tom Tromey
2011-03-07 17:21 ` 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=20110306185355.GB22789@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.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