From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by sourceware.org (Postfix) with ESMTPS id E6CDB38582A1 for ; Thu, 21 Jul 2022 13:40:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6CDB38582A1 Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-10d845dcf92so2374274fac.12 for ; Thu, 21 Jul 2022 06:40:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=MZAXEGFZouwBWcbfXj9nLoLrPF0tITXlzX6ao1OVBgQ=; b=eWnl/+dfy0KakiTDVvCTAVFkjpLIHrT1/Q58jBC7FiG5jONgKP7c3AIms5k+ZrOxT9 dYKTGpGfYFPy1D2xQI25k4NgoU0+ZWvgHMlyKSk0Ar4WC9CAxZWMOWwTWckg6QQC48KZ DrvrdM6VduhXAqIIbWxNCtqV7vSAUW2xiwmqL1bJMnQv9/LWKf/0a8QhpDJH6zdbwHl7 3DG3ITnyhJ+J1mIn6KGVlSUAUq3SM6OWHoXftzuonIrj+jvUe2SwEIwpFGMSYu3necLU MxcEBc/axQf43nWQRMthRjXERadwgd9dtaaBvy6DtzUpuuIuLp8kXUz4KLuSQJ5SH97P 4X7w== X-Gm-Message-State: AJIora/4HMgzyeTdGh/Ku4kdjJyV51twh2WrQ/Rbn3m+iylX4EvgWeDy jumyU00aJ8vnBCWrHG1aBAoLiSec13WXZA== X-Google-Smtp-Source: AGRyM1vEVHhFnt66A8tG/hiFuVHSL2qqI4l/KY/u6g8SPptBcohNtN+7OsXn8+jmH+AHnoPbf9YJ/A== X-Received: by 2002:a05:6870:c386:b0:102:fcb:86cd with SMTP id g6-20020a056870c38600b001020fcb86cdmr5278234oao.296.1658410814222; Thu, 21 Jul 2022 06:40:14 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:8ded:90a7:7be2:9a21:5f25? ([2804:431:c7cb:8ded:90a7:7be2:9a21:5f25]) by smtp.gmail.com with ESMTPSA id j19-20020a9d7693000000b0061c9ab1032dsm785860otl.18.2022.07.21.06.40.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jul 2022 06:40:13 -0700 (PDT) Message-ID: <67d80a43-c65a-b9db-af46-c73562e6c5b2@linaro.org> Date: Thu, 21 Jul 2022 10:40:11 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0.2 Subject: Re: [PATCH] malloc: Simplify implementation of __malloc_assert Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org References: <87a6924uvf.fsf@oldenburg.str.redhat.com> <21e64150-606d-df60-e50f-df09ca5a67ff@linaro.org> <87ilnq38cs.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87ilnq38cs.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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:40:16 -0000 On 21/07/22 10:26, Florian Weimer wrote: > * Adhemerval Zanella Netto: > >>> + __libc_message (do_abort, "\ >>> +Fatal glibc error: malloc assertion failure in %s: %s\n", >>> + function, assertion); >>> + __builtin_unreachable (); >>> } >>> #endif >>> #endif >>> >> >> Would be better to keep the the file and line information? > > I would have to figure out how to use _itoa correctly. 8-/ Yeah, it is not the best interface indeed. > > I think we converted almost all asserts that are reachable through heap > corruption into malloc_printerr a couple of years ago, so the diagnostic > value of the line number will be really low. That's why I had to resort > to GDB to test this. > > Do you insist that I add file and line number information? I think it should be ok, what bothers me is we need to reimplement the assert macro for malloc usage.