From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30119 invoked by alias); 27 Feb 2014 20:56:56 -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 30108 invoked by uid 89); 27 Feb 2014 20:56:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 27 Feb 2014 20:56:53 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id s1RKuf2k031541; Thu, 27 Feb 2014 21:56:41 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id s1RKufPE026880; Thu, 27 Feb 2014 21:56:41 +0100 (CET) Date: Thu, 27 Feb 2014 20:56:00 -0000 Message-Id: <201402272056.s1RKufPE026880@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: jan.kratochvil@redhat.com CC: gdb-patches@sourceware.org, arnez@linux.vnet.ibm.com In-reply-to: <20140227201731.GA18067@host2.jankratochvil.net> (message from Jan Kratochvil on Thu, 27 Feb 2014 21:17:31 +0100) Subject: Re: [commit] [patch] Fix solib list reading asan error (for PR 8882) References: <20140226220918.GA10431@host2.jankratochvil.net> <20140227201731.GA18067@host2.jankratochvil.net> X-SW-Source: 2014-02/txt/msg00838.txt.bz2 > Date: Thu, 27 Feb 2014 21:17:31 +0100 > From: Jan Kratochvil > > On Wed, 26 Feb 2014 23:09:18 +0100, Jan Kratochvil wrote: > > gdb/ > > 2014-02-26 Jan Kratochvil > > > > Additional PR 8882 fix. > > * solib-svr4.c (svr4_read_so_list): Change first to first_l_name. > > Checked in already as it is complicating the testing under asan: > c91550fc5d8dae5f1140bca649690fa13e5276e9 Broke my build because ithe compiler warned that first_l_name may be used uninitialized. And I agree, so I committed the diff below as obvious. >From c725e7b6878220bbeac44b86a2581d74f16b497c Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Thu, 27 Feb 2014 21:51:08 +0100 Subject: [PATCH] Prevent compiler warning. GCC 4.2.1 complains about first_l_name may be used uninitialized, and my brain agrees. gdb/ChangeLog: * solib-svr4.c (svr4_read_so_list): Initialize first_l_name to 0. --- gdb/ChangeLog | 4 ++++ gdb/solib-svr4.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6a8fc0c..c99510c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2014-02-27 Mark Kettenis + * solib-svr4.c (svr4_read_so_list): Initialize first_l_name to 0. + +2014-02-27 Mark Kettenis + * sparc-nat.c (sparc_xfer_wcookie): Always use process ID. 2014-02-27 Jan Kratochvil diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 6c4dff7..4c94f9f 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1306,7 +1306,7 @@ static int svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, struct so_list ***link_ptr_ptr, int ignore_first) { - CORE_ADDR first_l_name; + CORE_ADDR first_l_name = 0; CORE_ADDR next_lm; for (; lm != 0; prev_lm = lm, lm = next_lm) -- 1.8.5.3