From patchwork Wed Jul 21 07:18:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 44443 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 C253F388802A for ; Wed, 21 Jul 2021 07:19:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C253F388802A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626851951; bh=uoK2ClsG3yvtWVxgmdkH4EWe/BWN381MSdJkPbDv94k=; 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=UhN9Y2Vb26tzxXFaCKyvJxQ2jCL08tNQB9zBcWMlaxc0a9YTk0mqLxPU4y1pcdy8B xAdkRBhZ19F7jSvdZoQnBgV2aGi0Zxh95bBswOzDwpU4kMUdylaP7JcP5a6WgyKHuC ev/bEjhazpGVA2P1U9kzndJPgRle9wmOZ9V2iELA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from bee.birch.relay.mailchannels.net (bee.birch.relay.mailchannels.net [23.83.209.14]) by sourceware.org (Postfix) with ESMTPS id 53B6A3865C1F for ; Wed, 21 Jul 2021 07:18:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53B6A3865C1F 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 9E5F2182E7E; Wed, 21 Jul 2021 07:18:47 +0000 (UTC) Received: from pdx1-sub0-mail-a42.g.dreamhost.com (100-101-162-69.trex-nlb.outbound.svc.cluster.local [100.101.162.69]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3B2761830B9; Wed, 21 Jul 2021 07:18:47 +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.101.162.69 (trex/6.3.3); Wed, 21 Jul 2021 07:18:47 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Name-Language: 2cc05e8447b95223_1626851927475_3562012411 X-MC-Loop-Signature: 1626851927475:1958042721 X-MC-Ingress-Time: 1626851927475 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 F23707E641; Wed, 21 Jul 2021 00:18:46 -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 E1893897DE; Wed, 21 Jul 2021 00:18:43 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a42 To: libc-alpha@sourceware.org Subject: [PATCH v2] manual: Document unsupported cases for interposition Date: Wed, 21 Jul 2021 12:48:23 +0530 Message-Id: <20210721071823.1364166-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <8735s9v294.fsf@oldenburg.str.redhat.com> References: <8735s9v294.fsf@oldenburg.str.redhat.com> 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_H3, RCVD_IN_MSPIKE_WL, 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 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..5fb58af736 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