This is the mail archive of the
mailing list for the GCC project.
Re: GCC stack backtraces
On Wed, Aug 29, 2012 at 9:31 AM, H.J. Lu <email@example.com> wrote:
> On Wed, Aug 29, 2012 at 9:21 AM, Ian Lance Taylor <firstname.lastname@example.org> wrote:
>> I believe the unwinder proper is async signal safe--it just uses
>> 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:
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.