On Wed, Aug 29, 2012 at 9:31 AM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Wed, Aug 29, 2012 at 9:21 AM, Ian Lance Taylor <i...@google.com> wrote: >> >> I believe the unwinder proper is async signal safe--it just uses >> _Unwind_Backtrace. >> >> The DWARF reader calls malloc and is therefore not async-signal safe. >> It would be difficult to write an efficient DWARF reader that does not >> allocate any memory, and I'm not aware of any way to allocate memory >> that is defined to be async-signal safe. That said, as far as I know >> mmap is async-signal safe in practice if not in theory, so one >> approach would be to do memory allocation using mmap. >> > > Using mmap instead of malloc is a good idea. It should fix: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24724
I don't think that is a very interesting bug for GCC developers, since it is only talking about unwinding on systems that do not support dl_iterate_phdr with a linker that supports --eh-frame-hdr. On the systems most people use, the unwinder does not allocate. Not that I'm opposed to fixing it, of course. Ian