<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Hello,</div><div><br></div><div>My guess it something is clobbering the stack. Does this occur with all of itk or just a specific filter? </div><div><br>On Jul 13, 2016, at 4:12 AM, LaurenČ›iu Nicola <<a href="mailto:lnicola@dend.ro">lnicola@dend.ro</a>> wrote:<br><br></div><blockquote type="cite"><div>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title>

<div style="font-family:Arial;">Hi,<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">This is a bit of a shot in the dark asking this, but we're working on a project that uses a library based on ITK (OTB). We noticed two issues:<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">1. We've seen processes with a single remaining thread that's stuck in pthread_join().<br></div>
<div style="font-family:Arial;">2. We're getting some segfaults in libpthread.so:<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">[Jul13 09:42] otbApplicationL[37610]: segfault at 7ff2f27fc9d0 ip 00007ff3375c2e61 sp 00007ffd9ef0d620 error 4 in <a defang_rel="nofollow" href="http://libpthread-2.17.so">libpthread-2.17.so</a>[7ff3375ba000+16000]<br></div>
<div style="font-family:Arial;">[  +0.002159] otbApplicationL[31064]: segfault at 2d3 ip 00007fd3bf636e61 sp 00007fff2446f210 error 4 in <a defang_rel="nofollow" href="http://libpthread-2.17.so">libpthread-2.17.so</a>[7fd3bf62e000+16000]<br></div>
<div style="font-family:Arial;">[  +0.007911] otbApplicationL[10366]: segfault at 7feb000008cc ip 00007febeaa15e61 sp 00007ffe34bb1e10 error 4 in <a defang_rel="nofollow" href="http://libpthread-2.17.so">libpthread-2.17.so</a>[7febeaa0d000+16000]<br></div>
<div style="font-family:Arial;">[Jul13 09:44] maccs-processin[39138]: segfault at 7f6b713979d0 ip 00007f6b767cae61 sp 00007ffe09fe6410 error 4 in <a defang_rel="nofollow" href="http://libpthread-2.17.so">libpthread-2.17.so</a>[7f6b767c2000+16000]<br></div>
<div style="font-family:Arial;">[  +0.000092] otbApplicationL[22007]: segfault at 2d0 ip 00007f06a6541e61 sp 00007fffb4299660 error 4 in <a defang_rel="nofollow" href="http://libpthread-2.17.so">libpthread-2.17.so</a>[7f06a6539000+16000]<br></div>
<div style="font-family:Arial;">[  +0.000384] otbApplicationL[33830]: segfault at 100001626 ip 00007f37c1f90e61 sp 00007fff8a0f44d0 error 4 in <a defang_rel="nofollow" href="http://libpthread-2.17.so">libpthread-2.17.so</a>[7f37c1f88000+16000]<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">My theory is that 2d0 is an offset into a NULL pthread struct, but I couldn't find the definition of that structure (pthread_t is an opaque handle).<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">I suspect that the two issues are related. The weird part is that those segfaults tend to happen for multiple processes at the same time. The system was probably loaded, but I don't think it was an OOM situation.<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">Right now we're on ITK 4.9.1. Is there anyone else who encountered this or knows about recent ITK fixes related to multithreading?<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">Regards,<br></div>
<div style="font-family:Arial;">Laurentiu Nicola<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">(gdb) bt<br></div>
<div style="font-family:Arial;">#0  0x00007f0d74650ef7 in pthread_join () from /usr/lib64/libpthread.so.0<br></div>
<div style="font-family:Arial;">#1  0x00007f0d74dd1cca in itk::MultiThreader::SpawnWaitForSingleMethodThread (this=this@entry=0x2411670, threadHandle=<optimized out>)<br></div>
<div style="font-family:Arial;">    at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0-BUILD/ITK/src/ITK/Modules/Core/Common/src/itkMultiThreaderPThreads.cxx:239<br></div>
<div style="font-family:Arial;">#2  0x00007f0d74dd244b in itk::MultiThreader::WaitForSingleMethodThread (this=this@entry=0x2411670, threadHandle=<optimized out>)<br></div>
<div style="font-family:Arial;">    at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0-BUILD/ITK/src/ITK/Modules/Core/Common/src/itkMultiThreader.cxx:480<br></div>
<div style="font-family:Arial;">#3  0x00007f0d74dd2f7d in itk::MultiThreader::SingleMethodExecute (this=0x2411670) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0-BUILD/ITK/src/ITK/Modules/Core/Common/src/itkMultiThreader.cxx:389<br></div>
<div style="font-family:Arial;">#4  0x00007f0d7cedb87d in itk::ImageSource<otb::VectorImage<float, 2u> >::GenerateData (this=0x23fff10) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/install/otb-install/usr/include/ITK-4.8/itkImageSource.hxx:254<br></div>
<div style="font-family:Arial;">#5  0x00007f0d74dcdc00 in itk::ProcessObject::UpdateOutputData (this=0x23fff10) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0-BUILD/ITK/src/ITK/Modules/Core/Common/src/itkProcessObject.cxx:1739<br></div>
<div style="font-family:Arial;">#6  0x00007f0d74dcdcc0 in itk::ProcessObject::UpdateOutputData (this=0x23e9b00) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0-BUILD/ITK/src/ITK/Modules/Core/Common/src/itkProcessObject.cxx:1700<br></div>
<div style="font-family:Arial;">#7  0x00007f0d4af29368 in otb::StreamingImageVirtualWriter<otb::VectorImage<float, 2u> >::GenerateData (this=0x23e9700)<br></div>
<div style="font-family:Arial;">    at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.txx:248<br></div>
<div style="font-family:Arial;">#8  0x00007f0d4af1c8ce in otb::StreamingImageVirtualWriter<otb::VectorImage<float, 2u> >::Update (this=0x23e9700)<br></div>
<div style="font-family:Arial;">    at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.txx:156<br></div>
<div style="font-family:Arial;">#9  0x00007f0d4af11aad in otb::PersistentFilterStreamingDecorator<otb::PersistentShrinkImageFilter<otb::VectorImage<float, 2u>, otb::VectorImage<float, 2u> > >::GenerateData (this=0x2466c20)<br></div>
<div style="font-family:Arial;">    at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Core/Streaming/include/otbPersistentFilterStreamingDecorator.txx:52<br></div>
<div style="font-family:Arial;">#10 0x00007f0d4af1f4be in otb::Wrapper::Quicklook::DoExecute (this=0x23a9540) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Applications/AppImageUtils/app/otbQuicklook.cxx:272<br></div>
<div style="font-family:Arial;">#11 0x00007f0d7d2026c8 in otb::Wrapper::Application::Execute (this=this@entry=0x23a9540) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx:223<br></div>
<div style="font-family:Arial;">#12 0x00007f0d7d202789 in otb::Wrapper::Application::ExecuteAndWriteOutput (this=0x23a9540) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx:230<br></div>
<div style="font-family:Arial;">#13 0x00007f0d7d60b2c9 in otb::Wrapper::CommandLineLauncher::ExecuteAndWriteOutput (this=0x2366aa0) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx:158<br></div>
<div style="font-family:Arial;">#14 0x00000000004034a8 in main (argc=<optimized out>, argv=<optimized out>) at /home/cudroiu/sen2agri/packaging/Sen2AgriPlatform/build/OTB-5.0/Modules/Wrappers/CommandLine/src/otbApplicationLauncherCommandLine.cxx:299<br></div>
<div style="font-family:Arial;"> </div>
<div style="font-family:Arial;">(gdb) info threads<br></div>
<div style="font-family:Arial;">  Id   Target Id         Frame <br></div>
<div style="font-family:Arial;">* 1    Thread 0x7f0d63055880 (LWP 21145) "otbApplicationL" 0x00007f0d74650ef7 in pthread_join () from /usr/lib64/libpthread.so.0<br></div>


</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Community mailing list</span><br><span><a href="mailto:Community@itk.org">Community@itk.org</a></span><br><span><a href="http://public.kitware.com/mailman/listinfo/community">http://public.kitware.com/mailman/listinfo/community</a></span><br></div></blockquote></body></html>