From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102467 invoked by alias); 3 Jun 2016 15:31:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 102454 invoked by uid 89); 3 Jun 2016 15:31:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=aconole@redhat.com, aconoleredhatcom, baking, Hx-languages-length:1910 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 03 Jun 2016 15:31:30 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DC1C7822D; Fri, 3 Jun 2016 15:31:28 +0000 (UTC) Received: from aconole-fed23 (vpn-63-134.rdu2.redhat.com [10.10.63.134]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u53FVOIG014525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jun 2016 11:31:26 -0400 From: Aaron Conole To: "H.J. Lu" Cc: Nathan Sidwell , GCC Patches , Jan Hubicka , Nathan Sidwell Subject: Re: [PATCH v2] gcov: Runtime configurable destination output References: <1456350732-8272-1-git-send-email-aconole@bytheb.org> <8040ea19-7c4f-03ab-ba90-d82b35abcb32@acm.org> Date: Fri, 03 Jun 2016 15:31:00 -0000 In-Reply-To: (H. J. Lu's message of "Fri, 3 Jun 2016 08:00:18 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00286.txt.bz2 "H.J. Lu" writes: > On Mon, May 23, 2016 at 11:16 AM, Aaron Conole wrote: >> Nathan Sidwell writes: >> >>> On 05/19/16 14:40, Aaron Conole wrote: >>>> Nathan Sidwell writes: >>> >>>>>> +FILE *__gcov_error_file = NULL; >>>>> >>>>> Unless I'm missing something, isn't this only accessed from this file? >>>>> (So could be static with a non-underbarred name) >>>> >>>> Ack. >>> >>> I have a vague memory that perhaps the __gcov_error_file is seen from >>> other dynamic objects, and one of them gets to open/close it? I think >>> the closing function needs to reset it to NULL though? (In case it's >>> reactivated before the process exits) >> >> This is being introduced here, so the actual variable won't be seen, >> however you're correct - the APIs could still be called. >> >> I think there does exist a possibility that it can get re-activated >> before the process exits. So, I've changed it to have a proper block >> cope and to reset gcov_error_file to NULL. >> >>>>> And this protection here, makes me wonder what happens if one is >>>>> IN_GCOV_TOOL. Does it pay attention to GCOV_ERROR_FILE? That would >>>>> seem incorrect, and thus the above should be changed so that stderr is >>>>> unconditionally used when IN_GCOV_TOOL? >>>> >>>> You are correct. I will fix it. >>> >>> thanks. >>> >>>>>> +static void >>>>>> +gcov_error_exit(void) >>>>>> +{ >>>>>> + if (__gcov_error_file && __gcov_error_file != stderr) >>>>>> + { >>>>> >>>>> Braces are not needed here. >>> >>> Unless of course my speculation about setting it to NULL is right. >> >> It is - I've fixed it, and will post the v3 patch shortly. >> >> Thank you for your help, Nathan! >> > > It breaks profiledbootstrap: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71400 d'oh! Okay, baking a patch.