Looks like the usual lock b0rkage where something tries to unlock an already unlocked lock, to me. In that case, it is a simple software bug.
However, if (and only if) it only happens under x32, but works fine under amd64 on the same box, it could be a bug somewhere else (kernel, libpthreads, processor). FWIW, ensure you have intel-microcode 3.20160714.* or later installed on any box with TSX support. You are at (low?) risk of unpredictable behavior otherwise, but it wouldn't cause a trap on XEND anyway, so it is NOT what you are observing in this bug report. -- Henrique Holschuh