From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id A94A53846454 for ; Tue, 23 Feb 2021 09:54:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A94A53846454 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-189-4lfjAVX7Pt2xhFblIESPlQ-1; Tue, 23 Feb 2021 04:54:21 -0500 X-MC-Unique: 4lfjAVX7Pt2xhFblIESPlQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B00BE77C; Tue, 23 Feb 2021 09:52:06 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-131.ams2.redhat.com [10.36.113.131]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1BA26268D; Tue, 23 Feb 2021 09:52:04 +0000 (UTC) From: Florian Weimer To: Tulio Magno Quites Machado Filho Cc: Adhemerval Zanella , libc-alpha@sourceware.org, Raoni Fassina Firmino Subject: Re: [PATCH] powerpc: Remove backtrace implementation References: <20210212170941.1786380-1-adhemerval.zanella@linaro.org> <878s7ti4m0.fsf@oldenburg.str.redhat.com> <90d1d0e5-a31e-fbac-ead0-7f76f2645cd9@linaro.org> <87sg5n3g04.fsf@linux.ibm.com> Date: Tue, 23 Feb 2021 10:52:47 +0100 In-Reply-To: <87sg5n3g04.fsf@linux.ibm.com> (Tulio Magno Quites Machado Filho's message of "Mon, 22 Feb 2021 19:16:27 -0300") Message-ID: <874ki31574.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 23 Feb 2021 09:54:25 -0000 * Tulio Magno Quites Machado Filho: > Adhemerval Zanella writes: > >> On 12/02/2021 14:21, Florian Weimer wrote: >>> * Adhemerval Zanella: >>> >>> Does this really work well (enough) on systems which do not build >>> everything with asynchronous unwind tables? If I recall correctly, GCC >>> enabled them by default only quite recently. >> >> This should work as well any other architecture since it uses the libgcc_s >> routines. Afaik the powerpc implementation was done as optimization, not >> for correctness. > > I think Florian is correct. > > GCC enabled -fasynchronous-unwind-tables by default on ppc* ELF targets on > version 8 [1]. > So if you take a Debian 10 ppc64le, build the backtrace example from > linux-manpages [2] with gcc-7 or with a newer GCC using > 'gcc-9 -g0 -fno-asynchronous-unwind-tables', this executable won't be able to > print the correct backtrace, e.g.: > > $ ./testrun.sh ./tst-no-asynchronous-unwind-tables 3 > backtrace() returned 1 addresses > ./tst-no-asynchronous-unwind-tables(+0xb48) [0x7fff99a00b48] > > 8 addresses were expected in the previous test. > > With that said, I don't think the powerpc files are just an optimization and > removing them may cause old binaries to stop getting the right backtrace. > > [1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=0359465c703a > [2] https://www.man7.org/linux/man-pages/man3/backtrace.3.html Meh, I feel like I have an egg on my face. I was pretty sure yesterday that the change was safe after all. Thanks for checking. Is there are reason why the libgcc_s unwinder does not use the backchain if no DWARF data is available? Florian