<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Greeting,<div><br></div><div>I am investigating the test failures: </div><div><br></div><div><a href="https://open.cdash.org/viewTest.php?onlyfailed&buildid=3931664">https://open.cdash.org/viewTest.php?onlyfailed&buildid=3931664</a></div><div><br></div><div>Which began occurring with upgrade to ITK 4.8.</div><div><br></div><div>Doing a git bisect I narrowed the problem down to the change to the atomic integer class done here:</div><div><br></div><div><a href="https://github.com/InsightSoftwareConsortium/ITK/commit/33bcbd822f761e407db851d218b1e3204e6194d9">https://github.com/InsightSoftwareConsortium/ITK/commit/33bcbd822f761e407db851d218b1e3204e6194d9</a></div><div><br></div><div>Then I was able to get a stack trace for a failing ITK test:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">(gdb) </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#0  0x00a77d2d in pthread_mutex_lock () from /lib/libpthread.so.0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#1  0x086cede3 in itk::SimpleFastMutexLock::Lock (this=0x0) at /home/blowekamp/src/ITK/Modules/Core/Common/src/itkSimpleFastMutexLockPThreads.cxx:50</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#2  0x0869976c in itk::MutexLockHolder<itk::SimpleFastMutexLock>::MutexLockHolder (this=0xbfffe6fc, mutex=..., noblock=false)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    at /home/blowekamp/src/ITK/Modules/Core/Common/include/itkMutexLockHolder.h:56</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#3  0x086d4308 in itk::Detail::AtomicOps<4u>::PreIncrement (ref=0x8982c78) at /home/blowekamp/src/ITK/Modules/Core/Common/src/itkAtomicInt.cxx:214</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#4  0x086c7e45 in itk::AtomicInt<unsigned long>::operator++ (this=0x8982c78) at /home/blowekamp/src/ITK/Modules/Core/Common/include/itkAtomicInt.h:93</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#5  0x086c7dd6 in itk::TimeStamp::Modified (this=0x8c81980) at /home/blowekamp/src/ITK/Modules/Core/Common/src/itkTimeStamp.cxx:63</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#6  0x086a11fb in itk::Object::Modified (this=0x8c81970) at /home/blowekamp/src/ITK/Modules/Core/Common/src/itkObject.cxx:389</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#7  0x086a1346 in itk::Object::Object (this=0x8c81970) at /home/blowekamp/src/ITK/Modules/Core/Common/src/itkObject.cxx:593</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#8  0x086c9be6 in itk::ObjectFactoryBase::ObjectFactoryBase (this=0x8c81970)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    at /home/blowekamp/src/ITK/Modules/Core/Common/src/itkObjectFactoryBase.cxx:476</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#9  0x08379b12 in itk::MetaImageIOFactory::MetaImageIOFactory (this=0x8c81970)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    at /home/blowekamp/src/ITK/Modules/IO/Meta/src/itkMetaImageIOFactory.cxx:24</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#10 0x08296048 in itk::MetaImageIOFactory::New () at /home/blowekamp/src/ITK/Modules/IO/Meta/include/itkMetaImageIOFactory.h:46</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#11 0x08224ae0 in RegisterRequiredFactories ()</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    at /home/blowekamp/src/ITK/Modules/Core/TestKernel/include/itkTestDriverIncludeRequiredIOFactories.h:41</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#12 0x08229720 in ProcessArgumentsAndRegisterRequiredFactories (ac=0xbfffeaf0, av=0xbfffeaf4)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    at /home/blowekamp/src/ITK/Modules/Core/TestKernel/include/itkTestDriverIncludeRequiredIOFactories.h:58</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">#13 0x082297f7 in main (ac=1, av=0xbfffeb74) at /scratch/blowekamp/build/Modules/Video/Core/test/ITKVideoCoreTestDriver.cxx:102</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">So, this stack trace shows that there is a problem using pthreads during static initialization for the Object's reference counting.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">As the implementation is basically that of VTK, I and wondering if anyone else knows about this problem or work arounds.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Thanks,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Brad</div></body></html>