View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013384VTK(No Category)public2012-08-22 04:522016-08-12 09:55
ReporterJohn Stark 
Assigned ToBill Lorensen 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version5.8.0 
Target VersionFixed in Version 
Summary0013384: vtkColorTransferFunction::GetTable race condition
DescriptionWhen vtkColorTransferFunction is used with vtkImageMapToColors a race condition can arise during running leading to corrupted output or a crash.

The issue is caused by the re-allocation and re-computation of the lookup table (LUT) performed in vtkColorTransferFunction::GetTable(). Because vtkImageMapToColors is a multi-threaded algorithm, GetTable can be called by many threads simultaneously. The re-allocation and computation should be protected with a mutex or critical section.

Only vtkImageData using unsigned char or unsigned short pixel data are affected.

My solution was to protect GetTable with a vtkCriticalSection.
Tagshackaton
ProjectTBD
Typecrash
Attached Filespatch file icon ColorTransferFn.patch [^] (2,732 bytes) 2012-08-23 03:58 [Show Content]
cxx file icon ImageMapToColorsBugTest.cxx [^] (2,558 bytes) 2012-08-23 03:58
cxx file icon TestColorTransferFunction.cxx [^] (3,458 bytes) 2013-04-16 16:43

 Relationships

  Notes
(0029049)
John Stark (reporter)
2012-08-23 04:00

I've uploaded a patch with the CriticalSection fix I used, and a test which exposes the bug on my computer. Sorry, the test is missing the necessary #include's, but it came from a larger test suite.
(0030575)
John Stark (reporter)
2013-04-16 16:45
edited on: 2013-04-17 15:04

This is still a problem in the latest master. I uploaded a test that shows the problem at master / 5a986ef5672f139a52188ec267ab3ce2488477af (16 Apr 2013).

Gerrit patch : http://review.source.kitware.com/#/t/2647 [^]

(0031310)
Dave DeMarle (administrator)
2013-07-22 20:46

added myself to reviewer list to help push it through
(0033304)
John Stark (reporter)
2014-08-29 08:42

In writing a test for this I found several other problems with vtkColorTransferFunction:

- In some cases the output depends on whether the input data type was float or uchar, even when the same (integral of course) values are input.
- Opacity (alpha) is handled differently for the float and uchar methods.
- Luminance output is handled differently for the float and uchar methods.

(See http://review.source.kitware.com/#/c/14376/9/Rendering/Core/Testing/Cxx/TestColorTransferFunction.cxx [^])
(0036273)
Berk Geveci (administrator)
2016-07-06 16:48

Setting to status of bugs that have not been updated in the last year to expired. Please re-open if still important.
(0037291)
Kitware Robot (administrator)
2016-08-12 09:55

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2012-08-22 04:52 John Stark New Issue
2012-08-23 03:58 John Stark File Added: ColorTransferFn.patch
2012-08-23 03:58 John Stark File Added: ImageMapToColorsBugTest.cxx
2012-08-23 04:00 John Stark Note Added: 0029049
2013-04-16 16:43 John Stark File Added: TestColorTransferFunction.cxx
2013-04-16 16:45 John Stark Note Added: 0030575
2013-04-17 15:04 John Stark Note Edited: 0030575
2013-07-22 20:46 Dave DeMarle Note Added: 0031310
2014-08-29 08:42 John Stark Note Added: 0033304
2014-09-30 08:44 Bill Lorensen Tag Attached: hackaton
2014-09-30 08:44 Bill Lorensen Assigned To => Bill Lorensen
2014-09-30 08:44 Bill Lorensen Status backlog => tabled
2014-10-01 12:40 Berk Geveci Status tabled => backlog
2016-07-06 16:48 Berk Geveci Status backlog => expired
2016-07-06 16:48 Berk Geveci Note Added: 0036273
2016-08-12 09:55 Kitware Robot Note Added: 0037291
2016-08-12 09:55 Kitware Robot Status expired => closed
2016-08-12 09:55 Kitware Robot Resolution open => moved


Copyright © 2000 - 2018 MantisBT Team