MantisBT - VTK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0012655 | VTK | (No Category) | public | 2011-10-14 10:55 | 2016-08-12 09:55 |
Reporter | Ben Payne | ||||
Assigned To | Dave DeMarle | ||||
Priority | high | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | moved | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Project | Kitware | ||||
Type | crash | ||||
Summary | 0012655: Data race in vtkAlgorithm triggered by vtkImageAppend | ||||
Description | I just spent several hours tracking down a mysterious crash, which appears to be due to an insidious race condition triggered when running a multi-threaded vtkImageAppend filter. The crux of the problem is that vtkImageAppend::ThreadedRequestData() indirectly calls vtkAlgorithm::GetOutputPort() which, despite outward appearances is *not* thread-safe. I found this race by running helgrind (a valgrind tool) on our application - which spits out the following (threads 8 and 9 are the algorithm's worker threads): ==4282== Possible data race during read of size 8 at 0x2c3f0c20 by thread 0000009 ==4282== at 0xFBF50C: vtkSmartPointer<vtkAlgorithmOutput>::operator vtkAlgorithmOutput*() const (vtkSmartPointer.h:75) ==4282== by 0xFBE287: vtkAlgorithm::GetOutputPort(int) (vtkAlgorithm.cxx:1218) ==4282== by 0xFF4712: vtkExecutive::GetProducerPort(vtkDataObject*) (vtkExecutive.cxx:419) ==4282== by 0xFDD976: vtkDataObject::GetProducerPort() (vtkDataObject.cxx:362) ==4282== by 0x101C4DC: vtkImageData::GetScalarType() (vtkImageData.cxx:1498) ==4282== by 0x101C94F: vtkImageData::GetScalarSize() (vtkImageData.cxx:1579) ==4282== by 0xF42F2D: vtkImageAppend::InitOutput(int*, vtkImageData*) (vtkImageAppend.cxx:427) ==4282== by 0xF430CA: vtkImageAppend::ThreadedRequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*, vtkImageData***, vtkImageData**, int*, int) (vtkImageAppend.cxx:476) ==4282== by 0x10C2714: vtkThreadedImageAlgorithmThreadedExecute(void*) (vtkThreadedImageAlgorithm.cxx:202) ==4282== by 0x4C29D69: mythread_wrapper (hg_intercepts.c:221) ==4282== by 0x9C4CD8B: start_thread (pthread_create.c:304) ==4282== by 0xB74104C: clone (clone.S:112) ==4282== This conflicts with a previous write of size 8 by thread #8 ==4282== at 0x1255D7A: vtkSmartPointerBase::Swap(vtkSmartPointerBase&) (vtkSmartPointerBase.cxx:105) ==4282== by 0x1255CF8: vtkSmartPointerBase::operator=(vtkSmartPointerBase const&) (vtkSmartPointerBase.cxx:88) ==4282== by 0xFBF162: vtkSmartPointer<vtkAlgorithmOutput>::operator=(vtkSmartPointer<vtkAlgorithmOutput> const&) (vtkSmartPointer.h:27) ==4282== by 0xFBE2C9: vtkAlgorithm::GetOutputPort(int) (vtkAlgorithm.cxx:1221) ==4282== by 0xFF4712: vtkExecutive::GetProducerPort(vtkDataObject*) (vtkExecutive.cxx:419) ==4282== by 0xFDD976: vtkDataObject::GetProducerPort() (vtkDataObject.cxx:362) ==4282== by 0x101C4DC: vtkImageData::GetScalarType() (vtkImageData.cxx:1498) ==4282== by 0x101C94F: vtkImageData::GetScalarSize() (vtkImageData.cxx:1579) ==4282== Address 0x2c3f0c20 is 0 bytes inside a block of size 8 alloc'd ==4282== at 0x4C28B82: operator new(unsigned long) (vg_replace_malloc.c:261) ==4282== by 0xFC0BB3: __gnu_cxx::new_allocator<vtkSmartPointer<vtkAlgorithmOutput> >::allocate(unsigned long, void const*) (new_allocator.h:89) ==4282== by 0xFC0948: std::_Vector_base<vtkSmartPointer<vtkAlgorithmOutput>, std::allocator<vtkSmartPointer<vtkAlgorithmOutput> > >::_M_allocate(unsigned long) (in /home/ben/Dev/virat2-superbuild-debug/TPL/VisGUI/bin/viqui) ==4282== by 0xFC02C3: std::vector<vtkSmartPointer<vtkAlgorithmOutput>, std::allocator<vtkSmartPointer<vtkAlgorithmOutput> > >::_M_fill_insert(__gnu_cxx::__normal_iterator<vtkSmartPointer<vtkAlgorithmOutput>*, std::vector<vtkSmartPointer<vtkAlgorithmOutput>, std::allocator<vtkSmartPointer<vtkAlgorithmOutput> > > >, unsigned long, vtkSmartPointer<vtkAlgorithmOutput> const&) (vector.tcc:414) ==4282== by 0xFBFBED: std::vector<vtkSmartPointer<vtkAlgorithmOutput>, std::allocator<vtkSmartPointer<vtkAlgorithmOutput> > >::insert(__gnu_cxx::__normal_iterator<vtkSmartPointer<vtkAlgorithmOutput>*, std::vector<vtkSmartPointer<vtkAlgorithmOutput>, std::allocator<vtkSmartPointer<vtkAlgorithmOutput> > > >, unsigned long, vtkSmartPointer<vtkAlgorithmOutput> const&) (stl_vector.h:859) ==4282== by 0xFBF4A4: std::vector<vtkSmartPointer<vtkAlgorithmOutput>, std::allocator<vtkSmartPointer<vtkAlgorithmOutput> > >::resize(unsigned long, vtkSmartPointer<vtkAlgorithmOutput>) (stl_vector.h:558) ==4282== by 0xFBC7D8: vtkAlgorithm::SetNumberOfOutputPorts(int) (vtkAlgorithm.cxx:772) ==4282== by 0x1014A64: vtkImageAlgorithm::vtkImageAlgorithm() (vtkImageAlgorithm.cxx:32) ==4282== by 0x10C1BE4: vtkThreadedImageAlgorithm::vtkThreadedImageAlgorithm() (vtkThreadedImageAlgorithm.cxx:31) ==4282== by 0xF420D9: vtkImageAppend::vtkImageAppend() (vtkImageAppend.cxx:31) ==4282== by 0xF42093: vtkImageAppend::New() (vtkImageAppend.cxx:28) | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2011-10-14 10:55 | Ben Payne | New Issue | |||
2012-11-04 16:53 | Leo Liu | Note Added: 0029649 | |||
2012-11-05 13:03 | Ben Payne | Note Added: 0029653 | |||
2012-11-05 13:50 | Leo Liu | Note Added: 0029654 | |||
2013-06-24 21:25 | Dave DeMarle | Note Added: 0031032 | |||
2013-07-22 12:37 | Dave DeMarle | Status | backlog => expired | ||
2013-07-22 12:37 | Dave DeMarle | Assigned To | => Dave DeMarle | ||
2016-08-12 09:55 | Kitware Robot | Note Added: 0037250 | |||
2016-08-12 09:55 | Kitware Robot | Status | expired => closed | ||
2016-08-12 09:55 | Kitware Robot | Resolution | open => moved |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|