From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id 278303858C2D for ; Tue, 24 Oct 2023 16:28:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 278303858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 278303858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698164892; cv=none; b=uPGLhfee6YfMuOWDkaELZy6FVBZQi0N3gu7v/tbRMHB2W1BBR6T42BHE9jfpJo8k3TGjBzQkpighIBOVY5f7G7ze0NkXRZfSz+S6hYVisfADZvktgwaiLAcKtnsvK4brV8OYRGvirq1g6dD59K7mtB7Hcn0QJ8Q1FIcyAIkKE+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698164892; c=relaxed/simple; bh=eg6ChXDQUKsPMcywa8WkTRw8Hseq7DK37TqxDLvY8JI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=sKw8nbgcJUsfSgWs07GMK8HkhaRHb+DBFNxGwC2qRzaRcDigZMFMvBlVoW3bvaAYbrpJLlvdlW33mptFgw53w133K1FWUlVWgfcoPoeLOqOSXRdGl/PttPLC8KbjdHsTNIqmCeXTe5uERKjc4L90Ux238iowg7OJEzUyJD8HWNc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-27d17f5457fso4241238a91.0 for ; Tue, 24 Oct 2023 09:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698164890; x=1698769690; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=59IMLqc6emhtyu79ZdqqMAYKH1Qf7y4E5XYTkgVt0tY=; b=wwOioLnJ5ijudJmFcCOiNXcYUi8oCJSj5Mo+H7Asm7FgkV36GRJQkVFn3AGqQdvOTj 6yIbVlbEpmr4CdbaRexT9a9plidi+BEkQ776bd039pqbBdCrnujbIiAmQLkeWSnhB1Dn FDtLQv8ZkJFZn1ckzO3uwl17kI4fl42xfMg2uXQOuzM7Hm16gLpWGHkGDy6gAFZkS82o oUlhr7QhLg+Ft3mvijDfq0yFSLAviMnN5fjKhjMKnjHgPHYgs1i94kNWcDZr9ix1/ERk HYD3DodgEMsdgfFx8YcMkzFHz3/bCUyvTAD+br6kaVlcSlbvWTB5ZQWgCuHxav3usvTr aC0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698164890; x=1698769690; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=59IMLqc6emhtyu79ZdqqMAYKH1Qf7y4E5XYTkgVt0tY=; b=JwJWS61Z5WLAZcP0fxTNW3VhoDHoESk73TNimLP1X84D3jftaFYh4fwElBUyBiU83P kJsTBJiB15kkr9Tts3HWCbOe4t3Ne8bTPxea94s3PXAG4U/zTeviZx4DkbLGLEKXcr+P KNLCuwc4ZdfGH27CCoIdWlQJF8KcJQDKCNKDU2Tz+yI0HWXVhsZCAZT6kRyP/sS0N7HW dSLtmPfKyI3Jhtia6C7z9tDMrFaNDK81hzdwHp88d4US1ypWxiHzhSdCfGndk+2wHyOG mZZ40j6OAJk6XYXx1QkZBwFWOEm/1dLae2MTlpLPmXo8VnaWNKQCGwXAAzj1w6iJDPyV 8jXw== X-Gm-Message-State: AOJu0YyzUbO4XBgtfyomP9omk7t0CWQXWcNEGlOFWaY+u9JwKlfGP8Xy IIei4KFHbRo84MsanRXyz/epIg== X-Google-Smtp-Source: AGHT+IHl+I5DRH5S6cFH1QO8T1jijf7PjwxqozwWSnEIvxchONerNsQBcE1njmpuWYtS5cZ500/pkQ== X-Received: by 2002:a17:90b:1e12:b0:27d:d9a:be8b with SMTP id pg18-20020a17090b1e1200b0027d0d9abe8bmr17081019pjb.6.1698164889913; Tue, 24 Oct 2023 09:28:09 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:a647:f05a:5f8b:2693:4fff? ([2804:1b3:a7c3:a647:f05a:5f8b:2693:4fff]) by smtp.gmail.com with ESMTPSA id ge13-20020a17090b0e0d00b00271c5811019sm7113045pjb.38.2023.10.24.09.28.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Oct 2023 09:28:09 -0700 (PDT) Message-ID: <8b505776-755c-42bb-8b8c-e6311a13f17b@linaro.org> Date: Tue, 24 Oct 2023 13:28:06 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mcheck.3, mtrace.3: update examples for glibc 2.34 Content-Language: en-US To: Alejandro Colomar , Vincent Lefevre Cc: linux-man@vger.kernel.org, GNU C Library References: <20231024143144.76490-1-vincent@vinc17.net> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 24/10/23 12:32, Alejandro Colomar wrote: > Hi Vincent, > > On Tue, Oct 24, 2023 at 04:31:17PM +0200, Vincent Lefevre wrote: >> The glibc 2.34 NEWS file says that mtrace() and mcheck() have now been >> disabled in the main C library, and preloading libc_malloc_debug.so is > > Can you please clarify "disabled"? What is the behavior if that library > is not preloaded? My attempt to run this program is that mcheck(3) > returns -1. So, the preload interposes the dummy function that only > returns -1 with an actual mcheck(3) implementation? The libc mcheck and mcheck_pedantic now return -1, while mprobe returns MCHECK_DISABLED. All the implementation that used to live in libc.so were moved to libc_malloc_debug.so. > > Are these functions deprecated by glibc? If so, we should probably use > [[deprecated]] in the SYNOPSIS. Or did they just move the functionality > for other reasons but without deprecating? There is no deprecation because the functionality is still fully supported, albeit in a different library. Setting to deprecated would require to move the prototypes to a different header. > > Should we document the need for LD_PRELOAD in the LIBRARY section? Yes, I think it would be better. > > Thanks, > Alex > >> needed to get this functionality back. >> >> So the examples now need a "LD_PRELOAD=libc_malloc_debug.so". >> >> Signed-off-by: Vincent Lefevre >> --- >> man3/mcheck.3 | 2 +- >> man3/mtrace.3 | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/man3/mcheck.3 b/man3/mcheck.3 >> index 285ea946c..e17650a4c 100644 >> --- a/man3/mcheck.3 >> +++ b/man3/mcheck.3 >> @@ -169,7 +169,7 @@ when running the program: >> .PP >> .in +4n >> .EX >> -.RB "$" " ./a.out" >> +.RB "$ " "LD_PRELOAD=libc_malloc_debug.so ./a.out" >> About to free >> \& >> About to free a second time >> diff --git a/man3/mtrace.3 b/man3/mtrace.3 >> index f30511cd0..d0cde42c9 100644 >> --- a/man3/mtrace.3 >> +++ b/man3/mtrace.3 >> @@ -153,7 +153,7 @@ diagnosed memory leaks at two different locations in the program: >> .EX >> .RB "$ " "cc \-g t_mtrace.c \-o t_mtrace" >> .RB "$ " "export MALLOC_TRACE=/tmp/t" >> -.RB "$ " "./t_mtrace" >> +.RB "$ " "LD_PRELOAD=libc_malloc_debug.so ./t_mtrace" >> .RB "$ " "mtrace ./t_mtrace $MALLOC_TRACE" >> Memory not freed: >> -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- >> -- >> 2.42.0 >> >