When the mapper is called in banded mode via vg msga, several threads can try to access the aligner object in the mapper at the same time. This can cause segfaults and other weirdness.
I would just fix this but I feel I should mention it because I'm having trouble figuring out why this change only seems to be causing segfaults when run on the result of merging current master with the mem-threader branch.
It seems that (given the passing tests) this problem should be something I've introduced, but I'm at a complete loss for how. Also, it seems that things are structured such that we'll get the race on the current master.
Specifically, in vg msga the same aligner is being hit by multiple threads that are all using the same mapper:
When the mapper is called in banded mode via
vg msga
, several threads can try to access the aligner object in the mapper at the same time. This can cause segfaults and other weirdness.I would just fix this but I feel I should mention it because I'm having trouble figuring out why this change only seems to be causing segfaults when run on the result of merging current master with the mem-threader branch.
It seems that (given the passing tests) this problem should be something I've introduced, but I'm at a complete loss for how. Also, it seems that things are structured such that we'll get the race on the current master.
Specifically, in
vg msga
the same aligner is being hit by multiple threads that are all using the same mapper:The threads are launched here:
https://github.com/vgteam/vg/blob/6d385dd69e2140b79a105c5efa4e69ae53cd586d/src/mapper.cpp#L898
And sometimes they all decide to reach this point at the same time:
https://github.com/vgteam/vg/blob/6d385dd69e2140b79a105c5efa4e69ae53cd586d/src/mapper.cpp#L136-L143
:boom:
Why doesn't this explode on travis or before I make the merge?