Bug #1714: Fix crash at deregistration in OFI RDMA Entry Method API33/3133/4
commitb1b640302086d89784e8a0ed61436bdfc0cd6f93
authorNitin Bhat <nbhat4@illinois.edu>
Mon, 16 Oct 2017 19:16:01 +0000 (16 15:16 -0400)
committerPhil Miller <mille121@illinois.edu>
Fri, 20 Oct 2017 15:17:03 +0000 (20 10:17 -0500)
tree3db3a3c366c12be1cebe014a0a7571ec6591bca2
parent8e4607a736c3f2b4f7ca05837acbb4cce11d1636
Bug #1714: Fix crash at deregistration in OFI RDMA Entry Method API

The crash was occuring intermittently for SMP and "--with-production"
version of examples/zerocopy/pingpong. The race condition arose because
the deregistration code was using a data structure that was a part of
the initial charm message allocated in ckrdma.C. Since the call to the
converse message handler was before the deregistration, there was a
possibility of the worker thread executing the entry method using the
charm message and later deallocating the message before the deregistration.
This caused a segfault while accessing the deallocated data structure in
the deregistration code. The fix was to remove the dependency on the charm
message and store the required field in a stack variable to access it during
deregistration.

Change-Id: I29e0fcb04f0ae1450b13d630adb0859938bd27d4
src/arch/ofi/machine-onesided.c