On 07/20/2015 08:19 AM, James Greenhalgh wrote: > > I think we either want to defer the unordered_remove until we're done > processing all the vector elements, or make sure to look at element 'i' > again after we've moved something new in to it. Correct. Two loops had this mistake -- while others got it right. Sigh. The easiest fix is to change how we increment "i" in those loops so that it's only incremented if we do not delete the path. That happens to also match how other cases are handled. Thanks for catching these mistakes. > > A testcase would need to expose at least two threads which we later want > to cancel, one of which ends up at the end of the vector of threading > opportunities. We should then see only the first of those threads > actually get cancelled, and the second skipped over. Reproducing these > conditions is quite tough, which has stopped me finding a useful example > for the list, I'll be sure to follow-up this thread if I do get to one. Thankfully BZ had two closely related testcases. Bootstrapped and regression tested on x86_64-unknown-linux-gnu. Installed on the trunk. (Unfortunately it didn't resolve the ppc64 issue I was looking at ;( Jeff