From patchwork Wed Jul 21 08:04:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 44444 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C9C2C388CC1C for ; Wed, 21 Jul 2021 08:05:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9C2C388CC1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626854737; bh=/b09XSiUkjPyfnt+lgwrO+cUqyyMmlhpg4oDTBceTno=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=J7uiU1EWlA+LbpZbH6gFSxXLLZ89WrSXLkSjRUZk/Akx4eH551GxvxVPdxYX9Cdba vAOuN6WjU2i274z3bxWgpuVKhv9RAEsO1maZwAxInTzEIBLfq4RvO62b8O3Lf/P3gE mHtOzpYnCC4LlrsTI4Oxyj4ymZd5GLaB79q4+l64= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dragonfly.birch.relay.mailchannels.net (dragonfly.birch.relay.mailchannels.net [23.83.209.51]) by sourceware.org (Postfix) with ESMTPS id 385D63857C74 for ; Wed, 21 Jul 2021 08:05:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 385D63857C74 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 00AD9122A98; Wed, 21 Jul 2021 08:05:11 +0000 (UTC) Received: from pdx1-sub0-mail-a42.g.dreamhost.com (100-96-17-89.trex.outbound.svc.cluster.local [100.96.17.89]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8A8FC12279D; Wed, 21 Jul 2021 08:05:10 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a42.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.17.89 (trex/6.3.3); Wed, 21 Jul 2021 08:05:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Spot-Troubled: 4a5db914509d92e3_1626854710824_34251736 X-MC-Loop-Signature: 1626854710824:1582140959 X-MC-Ingress-Time: 1626854710824 Received: from pdx1-sub0-mail-a42.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a42.g.dreamhost.com (Postfix) with ESMTP id 464D1897DE; Wed, 21 Jul 2021 01:05:10 -0700 (PDT) Received: from rhbox.intra.reserved-bit.com (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a42.g.dreamhost.com (Postfix) with ESMTPSA id A7302897E3; Wed, 21 Jul 2021 01:05:05 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a42 To: libc-alpha@sourceware.org Subject: [PATCH v3] manual: Document unsupported cases for interposition Date: Wed, 21 Jul 2021 13:34:53 +0530 Message-Id: <20210721080453.1368114-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <87wnpkqfbd.fsf@igel.home> References: <87wnpkqfbd.fsf@igel.home> MIME-Version: 1.0 X-Spam-Status: No, score=-3494.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Siddhesh Poyarekar via Libc-alpha From: Siddhesh Poyarekar Reply-To: Siddhesh Poyarekar Cc: fweimer@redhat.com, schwab@linux-m68k.org Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" These functions call the core allocator functions (realloc and malloc respectively) and are hence guaranteed to allocate memory using the correct functions when multiple allocators are interposed. Having these functions interposed in one allocator and not another may result in confusion, hence discourage interposing them altogether. --- manual/memory.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manual/memory.texi b/manual/memory.texi index 31ee36be8c..1ca0c83327 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -2033,6 +2033,13 @@ when a replacement @code{malloc} is in use. However, failure to replace these functions typically does not result in crashes or other incorrect application behavior, but may result in static linking failures. +There are other functions (@code{reallocarray}, @code{strdup}, etc.) in +@theglibc{} that are not listed above but return newly allocated memory to +callers. Replacement of these functions is not supported and may produce +incorrect results. @Theglibc{} implementations of these functions call +the replacement allocator functions whenever available, so they will work +correctly with @code{malloc} replacement. + @node Obstacks @subsection Obstacks @cindex obstacks