From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91917 invoked by alias); 14 Feb 2020 09:45:48 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 91768 invoked by uid 89); 14 Feb 2020 09:45:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=pay X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Feb 2020 09:45:23 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j2XX5-00080h-0v; Fri, 14 Feb 2020 04:45:11 -0500 Received: from [176.228.60.248] (port=1252 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j2XX4-00055T-CS; Fri, 14 Feb 2020 04:45:10 -0500 Date: Fri, 14 Feb 2020 09:45:00 -0000 Message-Id: <83blq1pknp.fsf@gnu.org> From: Eli Zaretskii To: Simon Marchi CC: binutils@sourceware.org, gdb-patches@sourceware.org In-reply-to: (message from Simon Marchi on Thu, 13 Feb 2020 16:07:14 -0500) Subject: Re: Using the vcs_to_changelog.py script References: <83imkbqhry.fsf@gnu.org> <83a75mqyry.fsf@gnu.org> <675991ee-28c0-ce5a-6327-c6ad80ccb1c3@polymtl.ca> <837e0qqpps.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-SW-Source: 2020-02/txt/msg00316.txt.bz2 > Cc: binutils@sourceware.org, gdb-patches@sourceware.org > From: Simon Marchi > 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 AuthorDate: Mon Jan 6 21:54:21 2020 +0200 Commit: Eli Zaretskii 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 * gdbsupport/gdb_wait.c: Include instead of gdb/signals.h, as we are now using native signal symbols. commit cbfa85811792ca8e96ace40bef0aaaf507e54bcc Author: Shahab Vahedi AuthorDate: Mon Jan 6 15:27:32 2020 +0100 Commit: Pedro Alves 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 * 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.