From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id DF937385C301; Wed, 30 Nov 2022 18:00:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DF937385C301 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62a.google.com with SMTP id ml11so18366674ejb.6; Wed, 30 Nov 2022 10:00:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WjS8g8LjPgXS9t6LHaiKrSs/4nQ9wG9khlaLtCjpQ4I=; b=fmGffvxRmhj0kYZxFXwRjUgNxM4OlYwdK5t4PoFoDl2QDyD+j3Rmbg45JZBlMhyafo WNFU0kd2+zV5RYL2PJc4ubxBJV4bT3kULjpXKKHBwQ6QjMsUp51o/qfqOP1G/yQMWXSA qLfn0VADY9B3PsRVj6B53IlKrgljog0052bXNCP13gVdoGAeDJ/xcN+uevA+R+AKZm3A cDZxBEkDz+yUtQbtOrgfsu9SbsLnjEk/W15SlQkmTqIa/91Gw2FaA5cgFZccygetvkFJ Svwfb8qyiifqQgxRrk5pxjLz+FUlXKYigxtAtZS6YAZRQ4cgJt/ntBAdqhdOC7mObtOD g4dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WjS8g8LjPgXS9t6LHaiKrSs/4nQ9wG9khlaLtCjpQ4I=; b=qApRy8+1UC6WYjUp8twVwfykPgVORku+4CJ3GkvO1TkdLqEOCcnXgrbYXwBpe1xIiZ +fQ53CBE/RfFuBVTTmQsm0iPscz1BqFVOAjiAbPZwfFPgvqr3UxuQcq6MyIeK9DbiWCb 8u1MsqYv8srshEjxEgukJ5BAF3F8TZLatkRU5tzBK2Valy6fFjkUJRNsX0r0szkrg6o3 w0wJyo0rwE/T9y+7Jfw7g/QTwGfngSZYte+hXc3odWQmkJKYGG5NemFV+j108C3bPFqf NCAUa9yi2pRug8OIxJl5RlLuvnNW8apY8q8u3sWcqrNHuXSCODzKMYSd35QJUwisNJ3x GMow== X-Gm-Message-State: ANoB5pkXmL4Hti/7FcKxX66qm744GhWCKZZE7xaJNxUfrjqdg/oMiLM2 7pGjkk/LQjeaiZ82vJ4hEMfIDrdNpDA= X-Google-Smtp-Source: AA0mqf54Emoz0Jc1KXvm5vPg281fsCw4Nch1lSAHUcJsZD9nTVXLxS9Xm3fKUtEISvjyBGYEBAXlyA== X-Received: by 2002:a17:907:8c83:b0:7bf:4ac7:56e4 with SMTP id td3-20020a1709078c8300b007bf4ac756e4mr14976580ejc.39.1669831215595; Wed, 30 Nov 2022 10:00:15 -0800 (PST) Received: from [10.2.0.65] ([109.190.253.14]) by smtp.googlemail.com with ESMTPSA id g24-20020a1709067c5800b007bc8ef7416asm901581ejp.25.2022.11.30.10.00.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Nov 2022 10:00:14 -0800 (PST) Message-ID: <830aca53-fd19-2556-28b0-30ebff17df8c@gmail.com> Date: Wed, 30 Nov 2022 19:00:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] libstdc++: Add error handler for To: Jonathan Wakely Cc: =?UTF-8?Q?Bj=c3=b6rn_Sch=c3=a4pers?= , libstdc++@gcc.gnu.org, gcc Patches References: <20221129214107.25572-1-gcc@hazardy.de> Content-Language: fr From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 30/11/22 14:07, Jonathan Wakely wrote: > On Wed, 30 Nov 2022 at 11:57, Jonathan Wakely wrote: >> >> >> On Wed, 30 Nov 2022 at 11:54, Jonathan Wakely wrote: >>> >>> >>> On Wed, 30 Nov 2022 at 06:04, François Dumont via Libstdc++ wrote: >>>> Good catch, then we also need this patch. >>> >>> Is it worth printing an error? If we can't show the backtrace because of an error, we can just print nothing there. No strong opinion on that but if we do not print anything the output will be: Backtrace: Error: ... I just considered that it did not cost much to report the issue to the user that defined _GLIBCXX_DEBUG_BACKTRACE and so is expecting a backtrace. Maybe printing "Backtrace:\n" could be done in the normal callback leaving the user with the feeling that _GLIBCXX_DEBUG_BACKTRACE does not work. >>> >>> We also need to pass an error handler to the __glibcxx_backtrace_create_state call in formatter.h. >>> >>> Now that I look at this code again, why do we need the _M_backtrace_full member? It's always set to the same thing, why can't we just call that function directly? >> >> Oh right, I remember now ... because otherwise the libstdc++.so library needs the definition of __glibcxx_backtrace_full. > I'm testing the attached patch. > > >>> And I think we should use threaded=1 for the __glibcxx_backtrace_create_state call. >>> >>> So like the attached patch. >>> >>>