-
-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Unique LabelMap filters producing non-unique labels and causing concurrent pixel writes. #4668
Fix Unique LabelMap filters producing non-unique labels and causing concurrent pixel writes. #4668
Conversation
@blowekamp are you set up to use TSan, or do you want me to try with patch with TSan? |
I believe this does not patch it, it just explicitly checks for label overlaps. |
d97dc16
to
ae7566b
Compare
I think this is pretty close to fixing the issue, more testing is needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the commit message, label map filers
-> label map filters
. The rest looks good on a glance.
7be77cd
to
30b24f3
Compare
Modules/Filtering/LabelMap/include/itkShapeUniqueLabelMapFilter.h
Outdated
Show resolved
Hide resolved
07ae8d7
to
1766c13
Compare
@seanm You can run the sanitizer. However I was able to detect the bug with additional checks before the threading issue occurs. |
1766c13
to
5d9a281
Compare
I'm getting a build error:
and
|
Check the label maps are none overlapping. Overlapping labels are causing thread race conditions in the LabelMapToLabelImage filter.
Two bugs were addressed which could cause overlapping and/or errouneous outputs. 1. When a line we trimmed in the front, it is not placed back into the queue to ensure that it is still the first one, and the asserted assumptions of the order remain true. 2. Fix comparisons between start and ends to be correct for an interval of pixels where the start+length is not included.
5d9a281
to
47eec5a
Compare
@seanm Thanks looks like that should have been ITK_TEST_EXPECT_TRUE. I am surprised that did not produce a warning on any of the builds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to have these addressed! 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solves the itkStatisticsUniqueLabelMapFilterTest1 test failure under TSan! Amazing! We'll see on cdash if it solves other similar failures too...
So this is mergeable now? |
@thewtex I was hoping to get this in for 5.4 but missed it. The current target branch is release-5.4. What should be do to merge this patch? |
@blowekamp outstanding! I will go ahead and merge this one. For future reference, the process is:
|
9834ed2
into
InsightSoftwareConsortium:release-5.4
Cool, I'm excited to see on tomorrow's TSan cdash is this fixes any other tests too: |
Seems it fixed |
Are any of the other failure related to label maps? |
I haven't analyzed each in depth, but here's the list: https://open.cdash.org/viewTest.php?onlyfailed&buildid=9652708 |
Address bugs in unique label map filters
Two bugs were addressed which could cause overlapping and/or errouneous
outputs.
queue to ensure that it is still the first one, and the asserted
assumptions of the order remain true.
interval of pixels where the start+length is not included.
closes #4655
closes #3031
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.