This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC][PATCH] fix Read_symbols datarace
- From: Cary Coutant <ccoutant at google dot com>
- To: Evgeniy Dushistov <dushistov at mail dot ru>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 5 Nov 2014 14:53:47 -0800
- Subject: Re: [RFC][PATCH] fix Read_symbols datarace
- Authentication-results: sourceware.org; auth=none
- References: <20141105201101 dot GA2666 at fifteen>
> After update to gcc 4.9.2, link of my project failed,
> because of ld.gold crash.
> I reproduce this problem:
> https://sourceware.org/bugzilla/show_bug.cgi?id=17538
>
> Today I dig into this, and see that problem in
> that multiply threads run
> Read_symbols::do_read_symbols
> which call
> Plugin_manager::claim_file
> which call
> this->objects_.push_back
>
> without any sync, and so std::vector was modified
> in many threads without any locks, which of course
> cause crashes.
>
> Attached patch fix problem for me.
> Comments?
Thanks for finding this! A couple of minor comments, but it looks good...
Please write a ChangeLog entry.
+ this_blocker_(NULL), extra_search_path_(), lock_(NULL),
initialize_lock_(&lock_)
Line too long; please wrap.
+ Lock *lock_;
For C++ code, the "*" goes with the type: "Lock* lock_;".
Do you have commit access?
-cary