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.133.124]) by sourceware.org (Postfix) with ESMTPS id E10AE3858D28 for ; Thu, 21 Jul 2022 13:28:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E10AE3858D28 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-194-DGVGiVXXOWqTtTfQKmUv0g-1; Thu, 21 Jul 2022 09:28:51 -0400 X-MC-Unique: DGVGiVXXOWqTtTfQKmUv0g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B334381A084; Thu, 21 Jul 2022 13:28:51 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.154]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7ABA6492C3B; Thu, 21 Jul 2022 13:28:50 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] malloc: Simplify implementation of __malloc_assert References: <87a6924uvf.fsf@oldenburg.str.redhat.com> <21e64150-606d-df60-e50f-df09ca5a67ff@linaro.org> <9519948b-7913-ea0a-32c7-fad43d61a558@linaro.org> Date: Thu, 21 Jul 2022 15:28:48 +0200 In-Reply-To: <9519948b-7913-ea0a-32c7-fad43d61a558@linaro.org> (Adhemerval Zanella Netto's message of "Thu, 21 Jul 2022 10:24:18 -0300") Message-ID: <87edye388f.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.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP 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: Thu, 21 Jul 2022 13:28:53 -0000 * Adhemerval Zanella Netto: > And since the idea here is to avoid the malloc from __asprintf, would > be better to make __assert_fail_base call __libc_message (which will > either call alloca or mmap) ? Then there is no need to reimplement it > for malloc. No, assert is required to print to stderr (the stdio stream) by POSIX and ISO C. But we don't want to call into libio after detecting heap corruption. Thanks, Florian