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: [RFC][PATCH] fix Read_symbols datarace


> 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


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