From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 71F21383E6A7 for ; Mon, 23 May 2022 07:03:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71F21383E6A7 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-2S8lYs44Pi6JBNJ4hM0XXw-1; Mon, 23 May 2022 03:03:12 -0400 X-MC-Unique: 2S8lYs44Pi6JBNJ4hM0XXw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2B6F1C068C6; Mon, 23 May 2022 07:03:11 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29957C159B3; Mon, 23 May 2022 07:03:10 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 08/26] stdio-common: Add tst-memstream-string for open_memstream overflow References: <2d35bb583d26a0dce2d905c2cc79fb87a8e9413b.1647544751.git.fweimer@redhat.com> <0d61b6b0-a296-28ad-cd41-cc4172012d18@linaro.org> Date: Mon, 23 May 2022 09:03:09 +0200 In-Reply-To: <0d61b6b0-a296-28ad-cd41-cc4172012d18@linaro.org> (Adhemerval Zanella's message of "Fri, 20 May 2022 14:44:41 -0300") Message-ID: <87bkvozq6q.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2022 07:03:15 -0000 * Adhemerval Zanella: > On 17/03/2022 16:29, Florian Weimer via Libc-alpha wrote: >> This code path is exercised indirectly by some of the DNS stub >> resolver tests, via their own use of xopen_memstream for constructing >> strings describing result data. The relative lack of test suite >> coverage became apparent when these tests starting failing after a >> printf changes uncovered bug 28949. > > LGTM, with maybe a suggestio below. > > Reviewed-by: Adhemerval Zanella >> +/* Hide fprintf behind a compiler barrier, to avoid the fputs >> + transformation. */ >> +void __attribute__ ((weak)) >> +fprintf_compiler_barrier (FILE *fp, const char *format, const char *arg) >> +{ >> + fprintf (fp, format, arg); >> +} > > You can also avoid it by explicit disable the builtin on object build: > > CFLAGS-tst-memstream-string.c += -fno-builtin-fprintf Thanks, I made this change. Florian