From: Pedro Alves <pedro@palves.net>
To: Martin Jambor <mjambor@suse.cz>, GCC Development <gcc@gcc.gnu.org>
Subject: GSoC, Make cp-demangle non-recursive and async-signal safety
Date: Fri, 8 Apr 2022 11:06:37 +0100 [thread overview]
Message-ID: <4ae22d40-8dde-ae2d-16a4-38f0f8e58f74@palves.net> (raw)
Hi!
I noticed the discussions about making cp-demangle use malloc/free instead of recursion,
and I wonder about signal handlers, and I don't see that mentioned in
https://gcc.gnu.org/wiki/SummerOfCode's description of the project.
See my question to Ian a few years back, here, and his answer:
https://gcc.gnu.org/legacy-ml/gcc-patches/2018-12/msg00696.html
~~~
Ian says:
> Pedro says:
> Ian earlier mentioned that we've wanted to avoid malloc because some
> programs call the demangler from a signal handler, but it seems like
> we already do, these functions already aren't safe to use from
> signal handlers as is. Where does the "we can't use malloc" idea
> come from? Is there some entry point that avoids
> the malloc/realloc/free calls?
cplus_demangle_v3_callback and cplus_demangle_print_callback.
~~~
Grepping the gcc tree, I see that libsanitizer uses those entry points.
Is async-signal safety no longer a consideration/concern? Or will those entry points
continue to work without calling malloc/free somehow?
next reply other threads:[~2022-04-08 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 10:06 Pedro Alves [this message]
2022-04-13 13:53 ` Martin Jambor
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=4ae22d40-8dde-ae2d-16a4-38f0f8e58f74@palves.net \
--to=pedro@palves.net \
--cc=gcc@gcc.gnu.org \
--cc=mjambor@suse.cz \
/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).