[PATCH] Workaround ASAN race condition in future tests by manually joining threads.
eric at efcs.ca
Thu Nov 20 16:32:26 PST 2014
>>! In D6347#5, @jroelofs wrote:
> So 4 things:
> * I'm a little out of my comfort zone with this thread stuff... pretty far from my area of expertise
> * Perhaps you missed a few, for example: thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp (grep for 'detach' in tests).
I left those out on purpose since the value should not be set until the thread cleans up and exits. So there should be no race condition.
> * Doesn't this reduce the test coverage for the thread.detach() method?
These tests are not intended to test thread.detach(). detach() should be thoroughly tested elsewhere but I'll double check.
> * I *really* *really* don't like the idea of changing tests to push bugs under the rug. It'd be much better to 'XFAIL: asan' these. I have a thought on how to fix asan that I'll add to the PR.
Me too. The initial response to the PR was that this might not be fixable and we don't want tests that occasionally fail with ASAN. We can't XFAIL these tests because they pass 90% of the time. We could mark them as UNSUPPORTED but then you lose test coverage with ASAN. Since the above changes should not change the functionality of the tests I think this is the best approach.
More information about the cfe-commits