This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Excessive calls to iterate_phdr during exception handling
- From: Alan Modra <amodra at gmail dot com>
- To: Ryan Johnson <ryan dot johnson at cs dot utoronto dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 28 May 2013 14:03:47 +0930
- Subject: Re: Excessive calls to iterate_phdr during exception handling
- References: <51A3DC25 dot 90401 at cs dot utoronto dot ca>
On Mon, May 27, 2013 at 06:20:21PM -0400, Ryan Johnson wrote:
> I'm not sure whether this is an oversight, a known problem that's
> hard to fix, or a feature (e.g. somehow required for reliable
> unwinding). I suspect the former, because _Unwind_Find_FDE tries a
> call to _Unwind_Find_registered_FDE before falling back to
> dl_iterate_phdr, but the former never succeeds in my trace
> (iterate_phdr is always called).
Your suspicion is unfounded. The locking is required to support
dlopen (or at least, you need some sort of thread synchronisation
here). _Unwind_Find_registered_FDE is to support an older method of
finding FDEs. Newer executables and shared libraries on linux will
use PT_GNU_EH_FRAME, so don't expect _Unwind_Find_registered_FDE
to do anything except waste time! google eh_frame_hdr for more info.
C++ and threading is a minefield.
--
Alan Modra
Australia Development Lab, IBM