This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [gold commit] PR gold/14860: Fix race condition.


On Thu, Nov 14, 2013 at 10:45 AM, Cary Coutant <ccoutant@google.com> wrote:
> This patch fixes a race condition in Eh_frame_hdr::record_fde. When
> running multi-threaded, many Write_sections tasks may call record_fde_,
> which pushes an entry onto a shared vector. We need to hold a lock
> while modifying the vector.

I don't see how this could happen.  I think there is only one Eh_frame
section, created in Layout::make_eh_frame_section.  And I think the
only place that an FDE is written out is when the Eh_frame section is
written out, and I think that only happens once.  What am I missing?


> +       Hold_lock(*this->lock_);

I don't think this works.  I think you need to write
    Hold_lock hl(*this->lock_);

Ian


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