[Insight-developers] _GLIBCXX_DEBUG is not thread safe.

Sean McBride sean at rogue-research.com
Thu Mar 27 12:10:48 EDT 2008


On 3/27/08 9:30 AM, Hans Johnson said:

>I wanted to get this information out on the developer list so that others
>would see it.
>
>_GLIBCXX_DEBUG  does not seem to be thread safe.

A search of the gcc bugbase reveals several threading issues, yes:
<http://gcc.gnu.org/bugzilla/query.cgi>

For example, it is known to be not thread safe with gcc 3.3 (where the
feature was introduced).  See:
<http://gcc.gnu.org/ml/libstdc++/2004-09/msg00170.html>
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17664>

You might also want to google "<rdar://4417672>".

>Code consistently in the pthread mutex lock when using "-g -D_GLIBCXX_DEBUG"
>at line 302 of InsightToolkit/Algorithms/itkFastMarchingImageFilter.txx
>=====================
>299   while ( !m_TrialHeap.empty() )
>300     {
>301     // get the node with the smallest value
>302     node = m_TrialHeap.top();
>303     m_TrialHeap.pop();
>=====================
> -- AND --
>At line 141 of InsightToolkit/BasicFilters/itkMedianImageFilter.txx
>=====================
>139       // get the median value
>140       const typename std::vector<InputPixelType>::iterator
>                       medianIterator = pixels.begin() + medianPosition;
>141       std::nth_element(pixels.begin(), medianIterator, pixels.end());
>142       it.Set( static_cast<typename OutputImageType::PixelType>
>                        (*medianIterator) );
>=====================
>_L_mutex_unlock_153,  FP=bfffd3c8

I'm not sure I understand... what is the symptom you see with ITK?  Are
you sure it's not an ITK bug?

Can you try with gcc 4.3 on linux?

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada



More information about the Insight-developers mailing list