Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
We see from the above that one thread is writing to 0x000102c13fac and another is simultaneously reading from the same address.
Here is the relevant code, NB the fire emojis:
template <typename TInputImage, typename TOutputImage>
void
NarrowBandImageFilterBase<TInputImage, TOutputImage>::ThreadedApplyUpdate(const TimeStepType & dt,
const ThreadRegionType & regionToProcess,
ThreadIdType threadId)
{
// const int INNER_MASK = 2;
constexpr signed char INNER_MASK = 2;
typename NarrowBandType::ConstIterator it;
typename OutputImageType::Pointer image = this->GetOutput();
typename OutputImageType::PixelType oldvalue;
typename OutputImageType::PixelType newvalue;
for (it = regionToProcess.first; it != regionToProcess.last; ++it)
{
oldvalue = image->GetPixel(it->m_Index);//READ π₯π₯π₯π₯
newvalue = oldvalue + dt * it->m_Data;
// Check whether solution is out the inner band or not
m_TouchedForThread[threadId] =
(m_TouchedForThread[threadId] || (!(it->m_NodeState & INNER_MASK) && ((oldvalue > 0) != (newvalue > 0))));
image->SetPixel(it->m_Index, newvalue);//WRITE π₯π₯π₯π₯
}
}
I don't know this code at all, but given the names PoolMultiThreader::ParallelizeArray and ThreadedApplyUpdate this looks like different threads are supposed to be dealing with different regions, but I'd guess perhaps the regions are overlapping?
Running the itkNarrowBandImageFilterBaseTest test with TSan:
We see from the above that one thread is writing to 0x000102c13fac and another is simultaneously reading from the same address.
Here is the relevant code, NB the fire emojis:
I don't know this code at all, but given the names
PoolMultiThreader::ParallelizeArray
andThreadedApplyUpdate
this looks like different threads are supposed to be dealing with different regions, but I'd guess perhaps the regions are overlapping?