-
-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
itkLevelSetEquationTermContainer mutates std::map from multiple threads with no synchronization #3032
Labels
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Comments
seanm
added
the
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
label
Jan 4, 2022
Another possible solution would be to use an atomic operation such as |
seanm
added a commit
to seanm/ITK
that referenced
this issue
Jan 4, 2022
…several threads simultaneously The itkSingleLevelSetsv4DenseImage2DTest (and others) fail under TSan because an std::map was mutated from several threads at once. Fixed by using compare_exchange_strong() to create a thread safe way.
seanm
added a commit
to seanm/ITK
that referenced
this issue
Jan 4, 2022
…several threads simultaneously The itkSingleLevelSetsv4DenseImage2DTest (and others) fail under TSan because an std::map was mutated from several threads at once. Fixed by using compare_exchange_strong() to create a thread safe way.
Great idea, thanks! See my attempt... |
seanm
added a commit
to seanm/ITK
that referenced
this issue
Jan 5, 2022
…several threads simultaneously The itkSingleLevelSetsv4DenseImage2DTest (and others) fail under TSan because an std::map was mutated from several threads at once. Fixed by using compare_exchange_strong() to create a thread safe way.
seanm
added a commit
to seanm/ITK
that referenced
this issue
Jan 5, 2022
…several threads simultaneously The itkSingleLevelSetsv4DenseImage2DTest (and others) fail under TSan because an std::map was mutated from several threads at once. Fixed by using compare_exchange_strong() to create a thread safe way.
Merged
seanm
added a commit
to seanm/ITK
that referenced
this issue
Jan 12, 2022
…several threads simultaneously The itkSingleLevelSetsv4DenseImage2DTest (and others) fail under TSan because an std::map was mutated from several threads at once. Fixed by using compare_exchange_strong() to create a thread safe way.
jhlegarreta
pushed a commit
to seanm/ITK
that referenced
this issue
Jan 15, 2022
…several threads simultaneously The itkSingleLevelSetsv4DenseImage2DTest (and others) fail under TSan because an std::map was mutated from several threads at once. Fixed by using compare_exchange_strong() to create a thread safe way.
hjmjohnson
pushed a commit
that referenced
this issue
Jan 16, 2022
…ously The itkSingleLevelSetsv4DenseImage2DTest (and others) fail under TSan because an std::map was mutated from several threads at once. Fixed by using compare_exchange_strong() to create a thread safe way.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
The
itkSingleLevelSetsv4DenseImage2DTest
(and others) fail under TSan because anstd::map
is mutated from several threads at once.This line here:
is run by several threads simultaneously and
cfl_it->second
is both read and written with no mutex or other synchronization.One solution would be a mutex to protect
m_TermContribution
. But someone that knows this code may have a better idea...Full TSan report:
The text was updated successfully, but these errors were encountered: