From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76590 invoked by alias); 24 Mar 2018 10:54:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 76581 invoked by uid 89); 24 Mar 2018 10:54:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=scenario X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 24 Mar 2018 10:54:34 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83653722D0; Sat, 24 Mar 2018 10:54:32 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id F39981102E2A; Sat, 24 Mar 2018 10:54:31 +0000 (UTC) Subject: Re: patch for search bug in gdbserver To: Game Debugger , gdb patches References: From: Pedro Alves Message-ID: Date: Sat, 24 Mar 2018 10:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-03/txt/msg00481.txt.bz2 Hi! Thanks much for finding the program and for the patch. On 03/24/2018 10:41 AM, Game Debugger wrote: > diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c > index 64c72bd..943dfb2 100644 > --- a/gdb/gdbserver/server.c > +++ b/gdb/gdbserver/server.c > @@ -1123,7 +1123,7 @@ handle_search_memory_1 (CORE_ADDR start_addr, CORE_ADDR search_space_len, > : chunk_size); > > if (gdb_read_memory (read_addr, search_buf + keep_len, > - nr_to_read) != search_buf_size) > + nr_to_read) != nr_to_read) > { > warning ("Unable to access %ld bytes of target memory " > "at 0x%lx, halting search.", > > > > =============== PATCH FINISHED :) Close, but not yet :-) It'd be really good to add a test to the testsuite to exercise this and make sure we don't break the fix ever again. Clearly we don't have a test yet that covers this scenario otherwise we'd have noticed the problem before! Maybe add it to gdb/testsuite/gdb.base/find.{c,exp}? Thanks, Pedro Alves