This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC stack backtraces


On Wed, Aug 29, 2012 at 9:31 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Aug 29, 2012 at 9:21 AM, Ian Lance Taylor <iant@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]