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: Excessive calls to iterate_phdr during exception handling


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


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