[llvm-branch-commits] [lld] r322648 - Merging r322264:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jan 17 05:14:51 PST 2018
Author: hans
Date: Wed Jan 17 05:14:51 2018
New Revision: 322648
URL: http://llvm.org/viewvc/llvm-project?rev=322648&view=rev
Log:
Merging r322264:
------------------------------------------------------------------------
r322264 | dim | 2018-01-11 00:03:22 -0800 (Thu, 11 Jan 2018) | 17 lines
Fix thread race between SectionPiece's OutputOff and Live members
Summary:
As reported in bug 35788, rL316280 reintroduces a race between two
members of SectionPiece, which share the same 64 bit memory location.
To fix the race, check the hash before checking the Live member, as
suggested by Rafael.
Reviewers: ruiu, rafael
Reviewed By: ruiu
Subscribers: smeenai, emaste, llvm-commits
Differential Revision: https://reviews.llvm.org/D41884
------------------------------------------------------------------------
Modified:
lld/branches/release_60/ (props changed)
lld/branches/release_60/ELF/SyntheticSections.cpp
Propchange: lld/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 17 05:14:51 2018
@@ -1 +1 @@
-/lld/trunk:321983,321986,322041,322259
+/lld/trunk:321983,321986,322041,322259,322264
Modified: lld/branches/release_60/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_60/ELF/SyntheticSections.cpp?rev=322648&r1=322647&r2=322648&view=diff
==============================================================================
--- lld/branches/release_60/ELF/SyntheticSections.cpp (original)
+++ lld/branches/release_60/ELF/SyntheticSections.cpp Wed Jan 17 05:14:51 2018
@@ -2438,10 +2438,8 @@ void MergeNoTailSection::finalizeContent
parallelForEachN(0, Concurrency, [&](size_t ThreadId) {
for (MergeInputSection *Sec : Sections) {
for (size_t I = 0, E = Sec->Pieces.size(); I != E; ++I) {
- if (!Sec->Pieces[I].Live)
- continue;
size_t ShardId = getShardId(Sec->Pieces[I].Hash);
- if ((ShardId & (Concurrency - 1)) == ThreadId)
+ if ((ShardId & (Concurrency - 1)) == ThreadId && Sec->Pieces[I].Live)
Sec->Pieces[I].OutputOff = Shards[ShardId].add(Sec->getData(I));
}
}
More information about the llvm-branch-commits
mailing list