public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul E Murphy <murphyp@linux.ibm.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Florian Weimer <fweimer@redhat.com>,
	Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>,
	Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Subject: Re: [PATCH] powerpc: Remove backtrace implementation
Date: Wed, 14 Apr 2021 16:37:31 -0500	[thread overview]
Message-ID: <57f96ee4-7586-de09-2234-ad09c347be84@linux.ibm.com> (raw)
In-Reply-To: <20210226173909.nikuk5bohko2clqj@work-tp>



On 2/26/21 11:39 AM, Raoni Fassina Firmino via Libc-alpha wrote:
> On Tue, Feb 23, 2021 at 09:43:28AM -0300, AL glibc-alpha wrote:
>>
>>
>> On 23/02/2021 09:28, Florian Weimer wrote:
>>> * Adhemerval Zanella via Libc-alpha:
>>>
>>>> Afaik this is true for every other architecture that uses libgcc for
>>>> backtrace implementation, currently *everything* but powerpc and
>>>> microblaze:
>>>>
>>>> This is on aarch64 with gcc 5.4:
>>>>
>>>> $ gcc -g0 -fno-asynchronous-unwind-tables backtrace.c -o backtrace
>>>> $ ./backtrace 3
>>>> backtrace() returned 1 addresses
>>>> ./backtrace() [0x4009dc]
>>>>
>>>> And this is sparc64 with gcc-10:
>>>>
>>>> $ gcc -g0 -fno-asynchronous-unwind-tables backtrace.c -o backtrace
>>>> $ ./backtrace 3
>>>> backtrace() returned 1 addresses
>>>> ./backtrace(+0xa74) [0x10000000a74]
>>>>
>>>> So for all other architectures we require -fasynchronous-unwind-tables
>>>> to get backtrace work and I plan to remove microblaze implementation
>>>> so powerpc will be only outlier.
>>>
>>> GCC's defaults matter as well, I think.  If GCC defaults to unwind
>>> tables (is -funwind-tables sufficient?), then the libgcc_s unwinder will
>>> work for default builds.
>>
>> I think -funwind-tables is not suffice on some architectures to unwind
>> through signal handlers.
>>
>>>
>>> The libgcc_s unwinder may also have custom backchain logic for some
>>> targets, I haven't checked.
>>
>> This a point to actually use libgcc instead of using custom implementations
>> on glibc.
>>
>>>
>>> Part of the challenge here is whether people consider unwind tables or
>>> frame pointers part of the ABI.  There doesn't seem to be consensus,
>>> even for Linux targets (I think people on the musl side dislike the
>>> tables).
>> My view is glibc should not need to handle it, my point is use what
>> compiler already provide as a unwinder solution so we don't need to
>> handle all possible ABI variations and extensions that compiler or
>> use might use.
> 
> Is there any formal expectation of the environment in which bactrace()
> will work?  The manual don't seems to put too many constraints a part
> from having a well formatted stack.
> 
> Should it then be added that CFI information is necessary?

Ping?  This seems like a beneficial change.  Using the unwind
information makes for a much more robust backtrace with other languages
which support C bindings but do not use the same ABI (specifically
calling to and from go code in C).

Should we instead turn the existing ppc backtrace into a compat symbol?
This seems like it would address Tulio's issue with older binaries.

  reply	other threads:[~2021-04-14 21:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12 17:09 Adhemerval Zanella
2021-02-12 17:21 ` Florian Weimer
2021-02-12 17:25   ` Adhemerval Zanella
2021-02-22 22:16     ` Tulio Magno Quites Machado Filho
2021-02-23  9:52       ` Florian Weimer
2021-02-23 11:56       ` Adhemerval Zanella
2021-02-23 12:28         ` Florian Weimer
2021-02-23 12:43           ` Adhemerval Zanella
2021-02-26 17:39             ` Raoni Fassina Firmino
2021-04-14 21:37               ` Paul E Murphy [this message]
2021-04-15 14:42                 ` Tulio Magno Quites Machado Filho
2021-04-15 20:44                   ` Adhemerval Zanella
2021-04-27 15:09                     ` Florian Weimer
2021-10-14 20:24                   ` Raphael M Zinsly
2021-10-14 21:39                     ` Tulio Magno Quites Machado Filho
2021-10-20 13:39                       ` Adhemerval Zanella
2021-02-26 17:19 ` Raoni Fassina Firmino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57f96ee4-7586-de09-2234-ad09c347be84@linux.ibm.com \
    --to=murphyp@linux.ibm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=tuliom@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).