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: Ian Lance Taylor <iant at google 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 20:49:57 -0700
- Subject: Re: Excessive calls to iterate_phdr during exception handling
- References: <51A3DC25 dot 90401 at cs dot utoronto dot ca> <CAKOQZ8y36SyH5DgU9ZLT1AuVkd0MLOn7ZrFzZ2aoz4CQZV3txw at mail dot gmail dot com> <51A557B4 dot 7080202 at cs dot utoronto dot ca>
On Tue, May 28, 2013 at 6:19 PM, Ryan Johnson
<ryan.johnson@cs.utoronto.ca> wrote:
>
> That last point makes me really wonder why we bother grabbing the mutex
> during unwind at all... at the very least, it would seem profitable to
> verify the object header cache at throw time---perhaps using the nadds/nsubs
> trick---and refresh it with a call to dl_iterate_phdr if need be, then do
> the rest of unwind lock-free, ignoring deranged users who dlclose live code
> [2].
It's not that simple, as the cache is simply mapped in from the
object. So we need to ensure not only that the cache is valid when we
start to read it, but that it remains valid while we are reading it.
It's hard to see how to do that without some sort of lock.
Ian