This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/24724] _Unwind_Backtrace() calls malloc
- From: "rth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2010 23:08:28 -0000
- Subject: [Bug other/24724] _Unwind_Backtrace() calls malloc
- References: <bug-24724-11484@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from rth at gcc dot gnu dot org 2010-08-04 23:08 -------
There are two solutions to this:
(1) Make sure your binary provides PT_GNU_EH_FRAME. This is the quickest
path through the unwinder, since the table is pre-sorted by the linker.
(2) Have your malloc detect the recursion and return NULL. This will cause
the unwinder to perform a linear search through the unsorted tables.
It should not fail due to the fake out-of-memory condition, since it
was designed to handle throwing an exception during a true OOM condition.
--
rth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24724