Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: Re: Using the vcs_to_changelog.py script
Date: Fri, 14 Feb 2020 09:45:00 -0000	[thread overview]
Message-ID: <83blq1pknp.fsf@gnu.org> (raw)
In-Reply-To: <e9f3f58a-67b6-c435-b8bd-d4f2b88b7e78@polymtl.ca> (message from	Simon Marchi on Thu, 13 Feb 2020 16:07:14 -0500)

> Cc: binutils@sourceware.org, gdb-patches@sourceware.org
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Date: Thu, 13 Feb 2020 16:07:14 -0500
> 
> On 2020-02-13 1:58 p.m., Eli Zaretskii wrote:
> >   2) we need some guidelines for "good commit messages", otherwise
> >      patch review will need to pay a lot of attention to discussing
> >      that and making sure the log messages are fine
> 
> We can write some guidelines for sure, it wouldn't hurt.  But I think that as a
> project, we have already some quite good standards in terms of commit messages.

AFAIU, our current standards assume the ChangeLog-formatted entry is
part of the log message which describes the individual changes.  If
that is removed, we may wish to modify our standards to make up for
the loss.

E.g., compare the 2 sample log messages below.  The first one will
probably be quite incomplete if the ChangeLog part is removed, while
the second will probably not suffer too much.  So we may wish to make
sure log messages like the first one are augmented by additional
information.

  commit 66182876b46d40163e81504f7fa4f206268cb83c
  Author:     Eli Zaretskii <eliz@gnu.org>
  AuthorDate: Mon Jan 6 21:54:21 2020 +0200
  Commit:     Eli Zaretskii <eliz@gnu.org>
  CommitDate: Mon Jan 6 21:54:21 2020 +0200

      Fix MinGW native compilation of gdb/gdbsupport/gdb_wait.c

      gdb/ChangeLog
      2020-01-06  Eli Zaretskii  <eliz@gnu.org>

	      * gdbsupport/gdb_wait.c: Include <signal.h> instead of
	      gdb/signals.h, as we are now using native signal symbols.

  commit cbfa85811792ca8e96ace40bef0aaaf507e54bcc
  Author:     Shahab Vahedi <shahab@synopsys.com>
  AuthorDate: Mon Jan 6 15:27:32 2020 +0100
  Commit:     Pedro Alves <palves@redhat.com>
  CommitDate: Mon Jan 6 19:47:20 2020 +0000

      GDB: Fix the overflow in addr/line_is_displayed()

      In tui_disasm_window::addr_is_displayed(), there can be situations
      where "content" is empty. For instance, it can happen when the
      "content" was not filled in tui_disasm_window::set_contents(),
      because tui_disassemble() threw an exception. Usually this exception
      is the result of fetching invalid PC addresses like the ones beyond
      the end of the program.

      Having "content.size ()" zero leads to an overflow in this condition
      check inside tui_disasm_window::addr_is_displayed():

	int i = 0;
	while (i < content.size () - threshold ...) {
	  ... content[i] ...
	}

      "threshold" is 2 and there are times that "content.size ()" is 0.
      This results into an overflow and the loop is entered whereas it
      should have been skipped. Finally, "content[i]" access leads to
      a segmentation fault.

      Same problem applies to tui_source_window::line_is_displayed().

      The issue has been discussed at length in bug 25345:
	https://sourceware.org/bugzilla/show_bug.cgi?id=25345

      This commit avoids the segmentation faults with an early check:

	if (content.size () < SCROLL_THRESHOLD)
	  return false;

      Moreover, those functions have been overhauled to a leaner code.

      gdb/ChangeLog:
      2020-01-06  Shahab Vahedi  <shahab@synopsys.com>

	      * tui/tui-disasm.c (tui_disasm_window::addr_is_displayed): Avoid
	      overflow by an early check of content vs threshold.
	      * tui/tui-source.c (tui_source_window::line_is_displayed):
	      Likewise.


  reply	other threads:[~2020-02-14  9:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 23:33 Simon Marchi
2020-02-13  1:03 ` Alan Modra
2020-02-13  2:29   ` Jeff Law
2020-02-13  3:13     ` Simon Marchi
2020-02-13 14:13     ` Eli Zaretskii
2020-02-13  3:37 ` Eli Zaretskii
2020-02-13 14:19   ` Simon Marchi
     [not found]     ` <83a75mqyry.fsf@gnu.org>
2020-02-13 16:26       ` Simon Marchi
2020-02-13 18:58         ` Eli Zaretskii
2020-02-13 19:09           ` Philippe Waroquiers
2020-02-13 19:29             ` Eli Zaretskii
2020-02-13 20:56               ` Simon Marchi
2020-02-13 21:07           ` Simon Marchi
2020-02-14  9:45             ` Eli Zaretskii [this message]
2020-02-14 19:31               ` Simon Marchi
2020-02-14 20:16                 ` Eli Zaretskii
2020-02-14 21:08                   ` Simon Marchi
2020-02-15  7:26                     ` Eli Zaretskii

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=83blq1pknp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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